fs/orangefs/super.c
Source file repositories/reference/linux-study-clean/fs/orangefs/super.c
File Facts
- System
- Linux kernel
- Corpus path
fs/orangefs/super.c- Extension
.c- Size
- 17571 bytes
- Lines
- 665
- 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.
- 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
protocol.horangefs-kernel.horangefs-bufmap.hlinux/hashtable.hlinux/seq_file.h
Detected Declarations
function orangefs_show_optionsfunction orangefs_parse_paramfunction orangefs_inode_cache_ctorfunction orangefs_free_inodefunction hash_for_each_safefunction orangefs_destroy_inodefunction orangefs_write_inodefunction orangefs_statfsfunction orangefs_reconfigurefunction orangefs_remountfunction fsid_key_table_initializefunction fsid_key_table_finalizefunction orangefs_encode_fhfunction orangefs_unmountfunction orangefs_fill_sbfunction orangefs_get_treefunction orangefs_free_fcfunction orangefs_init_fs_contextfunction orangefs_kill_sbfunction orangefs_inode_cache_initializefunction orangefs_inode_cache_finalize
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* (C) 2001 Clemson University and The University of Chicago
*
* See COPYING in top-level directory.
*/
#include "protocol.h"
#include "orangefs-kernel.h"
#include "orangefs-bufmap.h"
#include <linux/hashtable.h>
#include <linux/seq_file.h>
/* a cache for orangefs-inode objects (i.e. orangefs inode private data) */
static struct kmem_cache *orangefs_inode_cache;
/* list for storing orangefs specific superblocks in use */
LIST_HEAD(orangefs_superblocks);
DEFINE_SPINLOCK(orangefs_superblocks_lock);
enum {
Opt_acl,
Opt_intr,
Opt_local_lock,
};
const struct fs_parameter_spec orangefs_fs_param_spec[] = {
fsparam_flag ("acl", Opt_acl),
fsparam_flag ("intr", Opt_intr),
fsparam_flag ("local_lock", Opt_local_lock),
{}
};
uint64_t orangefs_features;
static int orangefs_show_options(struct seq_file *m, struct dentry *root)
{
struct orangefs_sb_info_s *orangefs_sb = ORANGEFS_SB(root->d_sb);
if (root->d_sb->s_flags & SB_POSIXACL)
seq_puts(m, ",acl");
if (orangefs_sb->flags & ORANGEFS_OPT_INTR)
seq_puts(m, ",intr");
if (orangefs_sb->flags & ORANGEFS_OPT_LOCAL_LOCK)
seq_puts(m, ",local_lock");
return 0;
}
static int orangefs_parse_param(struct fs_context *fc,
struct fs_parameter *param)
{
struct orangefs_sb_info_s *orangefs_sb = fc->s_fs_info;
struct fs_parse_result result;
int opt;
opt = fs_parse(fc, orangefs_fs_param_spec, param, &result);
if (opt < 0)
return opt;
switch (opt) {
case Opt_acl:
fc->sb_flags |= SB_POSIXACL;
break;
case Opt_intr:
orangefs_sb->flags |= ORANGEFS_OPT_INTR;
break;
case Opt_local_lock:
orangefs_sb->flags |= ORANGEFS_OPT_LOCAL_LOCK;
break;
}
return 0;
}
static void orangefs_inode_cache_ctor(void *req)
{
struct orangefs_inode_s *orangefs_inode = req;
inode_init_once(&orangefs_inode->vfs_inode);
init_rwsem(&orangefs_inode->xattr_sem);
}
static struct inode *orangefs_alloc_inode(struct super_block *sb)
{
struct orangefs_inode_s *orangefs_inode;
orangefs_inode = alloc_inode_sb(sb, orangefs_inode_cache, GFP_KERNEL);
if (!orangefs_inode)
Annotation
- Immediate include surface: `protocol.h`, `orangefs-kernel.h`, `orangefs-bufmap.h`, `linux/hashtable.h`, `linux/seq_file.h`.
- Detected declarations: `function orangefs_show_options`, `function orangefs_parse_param`, `function orangefs_inode_cache_ctor`, `function orangefs_free_inode`, `function hash_for_each_safe`, `function orangefs_destroy_inode`, `function orangefs_write_inode`, `function orangefs_statfs`, `function orangefs_reconfigure`, `function orangefs_remount`.
- 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.