Defer kernfs openflag handling to inode implementations.

Some implementations handle more flags than others, so it doesn't
make sense to have one set of rules for all.

This change should functionally be a no-op.

PiperOrigin-RevId: 502712415
This commit is contained in:
Lucas Manning
2023-01-17 16:01:40 -08:00
committed by gVisor bot
parent d3c86781ab
commit 3c93bb1040
6 changed files with 14 additions and 6 deletions
+2
View File
@@ -222,6 +222,8 @@ func (i *rootInode) masterClose(ctx context.Context, t *Terminal) {
// Open implements kernfs.Inode.Open.
func (i *rootInode) Open(ctx context.Context, rp *vfs.ResolvingPath, d *kernfs.Dentry, opts vfs.OpenOptions) (*vfs.FileDescription, error) {
opts.Flags &= linux.O_ACCMODE | linux.O_CREAT | linux.O_EXCL | linux.O_TRUNC |
linux.O_DIRECTORY | linux.O_NOFOLLOW | linux.O_NONBLOCK | linux.O_NOCTTY
fd, err := kernfs.NewGenericDirectoryFD(rp.Mount(), d, &i.OrderedChildren, &i.locks, &opts, kernfs.GenericDirectoryFDOptions{
SeekEnd: kernfs.SeekEndStaticEntries,
})