summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/attr.go
diff options
context:
space:
mode:
authorZhaozhong Ni <nzz@google.com>2018-08-01 15:42:07 -0700
committerShentubot <shentubot@google.com>2018-08-01 15:43:24 -0700
commitb9e1cf8404ce1263176643dee1a1cc835c9d1448 (patch)
tree5382c24abb8c19a50fe714af8bb83e1fff6eaa31 /pkg/sentry/fs/attr.go
parent6b87378634e1575cf590b7558f19b40b012849c2 (diff)
stateify: convert all packages to use explicit mode.
PiperOrigin-RevId: 207007153 Change-Id: Ifedf1cc3758dc18be16647a4ece9c840c1c636c9
Diffstat (limited to 'pkg/sentry/fs/attr.go')
-rw-r--r--pkg/sentry/fs/attr.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/fs/attr.go b/pkg/sentry/fs/attr.go
index 56a2ad6f7..4178f18b2 100644
--- a/pkg/sentry/fs/attr.go
+++ b/pkg/sentry/fs/attr.go
@@ -91,6 +91,8 @@ func (n InodeType) String() string {
// StableAttr contains Inode attributes that will be stable throughout the
// lifetime of the Inode.
+//
+// +stateify savable
type StableAttr struct {
// Type is the InodeType of a InodeOperations.
Type InodeType
@@ -150,6 +152,8 @@ func IsCharDevice(s StableAttr) bool {
// UnstableAttr contains Inode attributes that may change over the lifetime
// of the Inode.
+//
+// +stateify savable
type UnstableAttr struct {
// Size is the file size in bytes.
Size int64
@@ -186,6 +190,8 @@ func WithCurrentTime(ctx context.Context, u UnstableAttr) UnstableAttr {
}
// AttrMask contains fields to mask StableAttr and UnstableAttr.
+//
+// +stateify savable
type AttrMask struct {
Type bool
DeviceID bool
@@ -227,6 +233,8 @@ func (a AttrMask) Union(b AttrMask) AttrMask {
}
// PermMask are file access permissions.
+//
+// +stateify savable
type PermMask struct {
// Read indicates reading is permitted.
Read bool
@@ -280,6 +288,8 @@ func (p PermMask) SupersetOf(other PermMask) bool {
// FilePermissions represents the permissions of a file, with
// Read/Write/Execute bits for user, group, and other.
+//
+// +stateify savable
type FilePermissions struct {
User PermMask
Group PermMask
@@ -370,6 +380,8 @@ func (f FilePermissions) AnyRead() bool {
}
// FileOwner represents ownership of a file.
+//
+// +stateify savable
type FileOwner struct {
UID auth.KUID
GID auth.KGID