summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/sockfs/sockfs.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2020-10-23 11:41:34 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-23 11:43:32 -0700
commit6ee3520b611ea2b487d4f2e12e0a0a50c62836da (patch)
treed2f8592343fac430efcb845527bf3db0962a1d10 /pkg/sentry/fsimpl/sockfs/sockfs.go
parentf73fad834f099cf866b2fe971485773727b83cb1 (diff)
[vfs] kernfs: Implement remaining InodeAttr fields.
Added the following fields in kernfs.InodeAttr: - blockSize - atime - mtime - ctime Also resolved all TODOs for #1193. Fixes #1193 PiperOrigin-RevId: 338714527
Diffstat (limited to 'pkg/sentry/fsimpl/sockfs/sockfs.go')
-rw-r--r--pkg/sentry/fsimpl/sockfs/sockfs.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/sockfs/sockfs.go b/pkg/sentry/fsimpl/sockfs/sockfs.go
index cf91ea36c..fda1fa942 100644
--- a/pkg/sentry/fsimpl/sockfs/sockfs.go
+++ b/pkg/sentry/fsimpl/sockfs/sockfs.go
@@ -108,13 +108,13 @@ func (i *inode) StatFS(ctx context.Context, fs *vfs.Filesystem) (linux.Statfs, e
// NewDentry constructs and returns a sockfs dentry.
//
// Preconditions: mnt.Filesystem() must have been returned by NewFilesystem().
-func NewDentry(creds *auth.Credentials, mnt *vfs.Mount) *vfs.Dentry {
+func NewDentry(ctx context.Context, mnt *vfs.Mount) *vfs.Dentry {
fs := mnt.Filesystem().Impl().(*filesystem)
// File mode matches net/socket.c:sock_alloc.
filemode := linux.FileMode(linux.S_IFSOCK | 0600)
i := &inode{}
- i.InodeAttrs.Init(creds, linux.UNNAMED_MAJOR, fs.devMinor, fs.Filesystem.NextIno(), filemode)
+ i.InodeAttrs.Init(ctx, auth.CredentialsFromContext(ctx), linux.UNNAMED_MAJOR, fs.devMinor, fs.Filesystem.NextIno(), filemode)
d := &kernfs.Dentry{}
d.Init(&fs.Filesystem, i)