fs/9p/vfs_super.c
Source file repositories/reference/linux-study-clean/fs/9p/vfs_super.c
File Facts
- System
- Linux kernel
- Corpus path
fs/9p/vfs_super.c- Extension
.c- Size
- 8364 bytes
- Lines
- 367
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/errno.hlinux/fs.hlinux/file.hlinux/stat.hlinux/string.hlinux/pagemap.hlinux/mount.hlinux/sched.hlinux/slab.hlinux/statfs.hlinux/magic.hlinux/fscache.hlinux/fs_context.hnet/9p/9p.hnet/9p/client.hv9fs.hv9fs_vfs.hfid.hxattr.hacl.h
Detected Declarations
function v9fs_fill_superfunction v9fs_get_treefunction v9fs_kill_superfunction v9fs_umount_beginfunction v9fs_statfsfunction v9fs_drop_inodefunction v9fs_write_inodefunction v9fs_write_inode_dotlfunction v9fs_free_fcfunction v9fs_init_fs_context
Annotated Snippet
if (res == 0) {
buf->f_type = rs.type;
buf->f_bsize = rs.bsize;
buf->f_blocks = rs.blocks;
buf->f_bfree = rs.bfree;
buf->f_bavail = rs.bavail;
buf->f_files = rs.files;
buf->f_ffree = rs.ffree;
buf->f_fsid = u64_to_fsid(rs.fsid);
buf->f_namelen = rs.namelen;
}
if (res != -ENOSYS)
goto done;
}
res = simple_statfs(dentry, buf);
done:
p9_fid_put(fid);
return res;
}
static int v9fs_drop_inode(struct inode *inode)
{
struct v9fs_session_info *v9ses;
v9ses = v9fs_inode2v9ses(inode);
if (v9ses->cache & (CACHE_META|CACHE_LOOSE))
return inode_generic_drop(inode);
/*
* in case of non cached mode always drop the
* inode because we want the inode attribute
* to always match that on the server.
*/
return 1;
}
static int v9fs_write_inode(struct inode *inode,
struct writeback_control *wbc)
{
/*
* send an fsync request to server irrespective of
* wbc->sync_mode.
*/
p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
return netfs_unpin_writeback(inode, wbc);
}
static int v9fs_write_inode_dotl(struct inode *inode,
struct writeback_control *wbc)
{
p9_debug(P9_DEBUG_VFS, "%s: inode %p\n", __func__, inode);
return netfs_unpin_writeback(inode, wbc);
}
static const struct super_operations v9fs_super_ops = {
.alloc_inode = v9fs_alloc_inode,
.free_inode = v9fs_free_inode,
.statfs = simple_statfs,
.drop_inode = v9fs_drop_inode,
.evict_inode = v9fs_evict_inode,
.show_options = v9fs_show_options,
.umount_begin = v9fs_umount_begin,
.write_inode = v9fs_write_inode,
};
static const struct super_operations v9fs_super_ops_dotl = {
.alloc_inode = v9fs_alloc_inode,
.free_inode = v9fs_free_inode,
.statfs = v9fs_statfs,
.drop_inode = v9fs_drop_inode,
.evict_inode = v9fs_evict_inode,
.show_options = v9fs_show_options,
.umount_begin = v9fs_umount_begin,
.write_inode = v9fs_write_inode_dotl,
};
static void v9fs_free_fc(struct fs_context *fc)
{
struct v9fs_context *ctx = fc->fs_private;
if (!ctx)
return;
/* These should be NULL by now but guard against leaks */
kfree(ctx->session_opts.uname);
kfree(ctx->session_opts.aname);
#ifdef CONFIG_9P_FSCACHE
kfree(ctx->session_opts.cachetag);
#endif
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/errno.h`, `linux/fs.h`, `linux/file.h`, `linux/stat.h`, `linux/string.h`, `linux/pagemap.h`.
- Detected declarations: `function v9fs_fill_super`, `function v9fs_get_tree`, `function v9fs_kill_super`, `function v9fs_umount_begin`, `function v9fs_statfs`, `function v9fs_drop_inode`, `function v9fs_write_inode`, `function v9fs_write_inode_dotl`, `function v9fs_free_fc`, `function v9fs_init_fs_context`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.