diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2019-07-24 17:58:28 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-07-24 17:59:57 -0700 |
commit | 417096f781c4fe74ff8a6db5c0fa0d46ba08e81d (patch) | |
tree | 709927e1455b973a47c9687db75843444c9b9939 /pkg/sentry/fs/ext/dentry.go | |
parent | 2ed832ff86ee29970d0a3991297de818bda67b9c (diff) |
ext: Add tests for root directory inode.
PiperOrigin-RevId: 259856442
Diffstat (limited to 'pkg/sentry/fs/ext/dentry.go')
-rw-r--r-- | pkg/sentry/fs/ext/dentry.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/sentry/fs/ext/dentry.go b/pkg/sentry/fs/ext/dentry.go index 07be99a84..054fb42b6 100644 --- a/pkg/sentry/fs/ext/dentry.go +++ b/pkg/sentry/fs/ext/dentry.go @@ -31,6 +31,15 @@ type dentry struct { // Compiles only if dentry implements vfs.DentryImpl. var _ vfs.DentryImpl = (*dentry)(nil) +// newDentry is the dentry constructor. +func newDentry(in *inode) *dentry { + d := &dentry{ + inode: in, + } + d.vfsd.Init(d) + return d +} + // IncRef implements vfs.DentryImpl.IncRef. func (d *dentry) IncRef(vfsfs *vfs.Filesystem) { d.inode.incRef() |