fs/9p/vfs_inode_dotl.c
Source file repositories/reference/linux-study-clean/fs/9p/vfs_inode_dotl.c
File Facts
- System
- Linux kernel
- Corpus path
fs/9p/vfs_inode_dotl.c- Extension
.c- Size
- 25213 bytes
- Lines
- 997
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/errno.hlinux/fs.hlinux/file.hlinux/pagemap.hlinux/stat.hlinux/string.hlinux/namei.hlinux/sched.hlinux/slab.hlinux/xattr.hlinux/posix_acl.hnet/9p/9p.hnet/9p/client.hv9fs.hv9fs_vfs.hfid.hcache.hxattr.hacl.h
Detected Declarations
struct dotl_openflag_mapstruct dotl_iattr_mapfunction v9fs_get_fsgid_for_createfunction v9fs_test_inode_dotlfunction v9fs_test_new_inode_dotlfunction v9fs_set_inode_dotlfunction v9fs_inode_from_fid_dotlfunction v9fs_mapped_dotl_flagsfunction v9fs_open_to_dotl_flagsfunction v9fs_vfs_create_dotlfunction v9fs_vfs_atomic_open_dotlfunction v9fs_vfs_getattr_dotlfunction v9fs_mapped_iattr_validfunction v9fs_vfs_setattr_dotlfunction v9fs_stat2inode_dotlfunction v9fs_vfs_symlink_dotlfunction v9fs_vfs_link_dotlfunction v9fs_vfs_mknod_dotlfunction v9fs_vfs_get_link_nocache_dotlfunction v9fs_vfs_get_link_dotlfunction v9fs_refresh_inode_dotl
Annotated Snippet
struct dotl_openflag_map {
int open_flag;
int dotl_flag;
};
static int v9fs_mapped_dotl_flags(int flags)
{
int i;
int rflags = 0;
struct dotl_openflag_map dotl_oflag_map[] = {
{ O_CREAT, P9_DOTL_CREATE },
{ O_EXCL, P9_DOTL_EXCL },
{ O_NOCTTY, P9_DOTL_NOCTTY },
{ O_APPEND, P9_DOTL_APPEND },
{ O_NONBLOCK, P9_DOTL_NONBLOCK },
{ O_DSYNC, P9_DOTL_DSYNC },
{ FASYNC, P9_DOTL_FASYNC },
{ O_DIRECT, P9_DOTL_DIRECT },
{ O_LARGEFILE, P9_DOTL_LARGEFILE },
{ O_DIRECTORY, P9_DOTL_DIRECTORY },
{ O_NOFOLLOW, P9_DOTL_NOFOLLOW },
{ O_NOATIME, P9_DOTL_NOATIME },
{ O_CLOEXEC, P9_DOTL_CLOEXEC },
{ O_SYNC, P9_DOTL_SYNC},
};
for (i = 0; i < ARRAY_SIZE(dotl_oflag_map); i++) {
if (flags & dotl_oflag_map[i].open_flag)
rflags |= dotl_oflag_map[i].dotl_flag;
}
return rflags;
}
/**
* v9fs_open_to_dotl_flags- convert Linux specific open flags to
* plan 9 open flag.
* @flags: flags to convert
*/
int v9fs_open_to_dotl_flags(int flags)
{
int rflags = 0;
/*
* We have same bits for P9_DOTL_READONLY, P9_DOTL_WRONLY
* and P9_DOTL_NOACCESS
*/
rflags |= flags & O_ACCMODE;
rflags |= v9fs_mapped_dotl_flags(flags);
return rflags;
}
/**
* v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol.
* @idmap: The user namespace of the mount
* @dir: directory inode that is being created
* @dentry: dentry that is being deleted
* @omode: create permissions
* @excl: True if the file must not yet exist
*
*/
static int
v9fs_vfs_create_dotl(struct mnt_idmap *idmap, struct inode *dir,
struct dentry *dentry, umode_t omode, bool excl)
{
return v9fs_vfs_mknod_dotl(idmap, dir, dentry, omode, 0);
}
static int
v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
struct file *file, unsigned int flags, umode_t omode)
{
int err = 0;
kgid_t gid;
umode_t mode;
int p9_omode = v9fs_open_to_dotl_flags(flags);
const unsigned char *name = NULL;
struct p9_qid qid;
struct inode *inode;
struct p9_fid *fid = NULL;
struct p9_fid *dfid = NULL, *ofid = NULL;
struct v9fs_session_info *v9ses;
struct posix_acl *pacl = NULL, *dacl = NULL;
if (d_in_lookup(dentry)) {
struct dentry *res = v9fs_vfs_lookup(dir, dentry, 0);
if (res || d_really_is_positive(dentry))
return finish_no_open(file, res);
}
/* Only creates */
Annotation
- Immediate include surface: `linux/module.h`, `linux/errno.h`, `linux/fs.h`, `linux/file.h`, `linux/pagemap.h`, `linux/stat.h`, `linux/string.h`, `linux/namei.h`.
- Detected declarations: `struct dotl_openflag_map`, `struct dotl_iattr_map`, `function v9fs_get_fsgid_for_create`, `function v9fs_test_inode_dotl`, `function v9fs_test_new_inode_dotl`, `function v9fs_set_inode_dotl`, `function v9fs_inode_from_fid_dotl`, `function v9fs_mapped_dotl_flags`, `function v9fs_open_to_dotl_flags`, `function v9fs_vfs_create_dotl`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.