summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/proc/task.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/proc/task.go
parent6b87378634e1575cf590b7558f19b40b012849c2 (diff)
stateify: convert all packages to use explicit mode.
PiperOrigin-RevId: 207007153 Change-Id: Ifedf1cc3758dc18be16647a4ece9c840c1c636c9
Diffstat (limited to 'pkg/sentry/fs/proc/task.go')
-rw-r--r--pkg/sentry/fs/proc/task.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/pkg/sentry/fs/proc/task.go b/pkg/sentry/fs/proc/task.go
index efc635946..748ca4320 100644
--- a/pkg/sentry/fs/proc/task.go
+++ b/pkg/sentry/fs/proc/task.go
@@ -52,6 +52,8 @@ func getTaskMM(t *kernel.Task) (*mm.MemoryManager, error) {
}
// taskDir represents a task-level directory.
+//
+// +stateify savable
type taskDir struct {
ramfs.Dir
@@ -92,6 +94,8 @@ func newTaskDir(t *kernel.Task, msrc *fs.MountSource, pidns *kernel.PIDNamespace
}
// subtasks represents a /proc/TID/task directory.
+//
+// +stateify savable
type subtasks struct {
ramfs.Dir
@@ -167,6 +171,8 @@ func (s *subtasks) DeprecatedReaddir(ctx context.Context, dirCtx *fs.DirCtx, off
}
// exe is an fs.InodeOperations symlink for the /proc/PID/exe file.
+//
+// +stateify savable
type exe struct {
ramfs.Symlink
@@ -226,6 +232,8 @@ func (e *exe) Readlink(ctx context.Context, inode *fs.Inode) (string, error) {
// namespaceFile represents a file in the namespacefs, such as the files in
// /proc/<pid>/ns.
+//
+// +stateify savable
type namespaceFile struct {
ramfs.Symlink
@@ -274,6 +282,8 @@ func newNamespaceDir(t *kernel.Task, msrc *fs.MountSource) *fs.Inode {
}
// mapsData implements seqfile.SeqSource for /proc/[pid]/maps.
+//
+// +stateify savable
type mapsData struct {
t *kernel.Task
}
@@ -311,6 +321,7 @@ func (md *mapsData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle) ([
return []seqfile.SeqData{}, 0
}
+// +stateify savable
type taskStatData struct {
t *kernel.Task
@@ -391,6 +402,8 @@ func (s *taskStatData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle)
}
// statmData implements seqfile.SeqSource for /proc/[pid]/statm.
+//
+// +stateify savable
type statmData struct {
t *kernel.Task
}
@@ -425,6 +438,8 @@ func (s *statmData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle) ([
}
// statusData implements seqfile.SeqSource for /proc/[pid]/status.
+//
+// +stateify savable
type statusData struct {
t *kernel.Task
pidns *kernel.PIDNamespace
@@ -490,6 +505,7 @@ type ioUsage interface {
IOUsage() *usage.IO
}
+// +stateify savable
type ioData struct {
ioUsage
}
@@ -530,6 +546,8 @@ func (i *ioData) ReadSeqFileData(ctx context.Context, h seqfile.SeqHandle) ([]se
// On Linux, /proc/[pid]/comm is writable, and writing to the comm file changes
// the thread name. We don't implement this yet as there are no known users of
// this feature.
+//
+// +stateify savable
type comm struct {
ramfs.Entry
@@ -559,6 +577,8 @@ func (c *comm) DeprecatedPreadv(ctx context.Context, dst usermem.IOSequence, off
}
// auxvec is a file containing the auxiliary vector for a task.
+//
+// +stateify savable
type auxvec struct {
ramfs.Entry