fs/ubifs/super.c
Source file repositories/reference/linux-study-clean/fs/ubifs/super.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ubifs/super.c- Extension
.c- Size
- 66985 bytes
- Lines
- 2516
- 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
linux/init.hlinux/slab.hlinux/module.hlinux/ctype.hlinux/kthread.hlinux/fs_context.hlinux/fs_parser.hlinux/seq_file.hlinux/math64.hlinux/writeback.hubifs.h
Detected Declarations
struct ubifs_fs_contextfunction Copyrightfunction validate_inodefunction ubifs_free_inodefunction ubifs_write_inodefunction ubifs_drop_inodefunction ubifs_evict_inodefunction ubifs_dirty_inodefunction ubifs_statfsfunction ubifs_show_optionsfunction ubifs_sync_fsfunction init_constants_earlyfunction bud_wbuf_callbackfunction init_constants_sbfunction init_constants_masterfunction take_gc_lnumfunction alloc_wbufsfunction free_wbufsfunction free_orphansfunction free_budsfunction rbtree_postorder_for_each_entry_safefunction check_volume_emptyfunction ubifs_parse_paramfunction ubifs_release_optionsfunction destroy_journalfunction bu_initfunction check_free_spacefunction mount_ubifsfunction mountingfunction ubifs_remount_rwfunction ubifs_remount_rofunction ubifs_put_superfunction ubifs_reconfigurefunction ubifs_fill_superfunction sb_testfunction ubifs_get_treefunction kill_ubifs_superfunction ubifs_free_fcfunction ubifs_init_fs_contextfunction inode_slab_ctorfunction ubifs_initfunction ubifs_exit
Annotated Snippet
struct ubifs_fs_context {
struct ubifs_mount_opts mount_opts;
char *auth_key_name;
char *auth_hash_name;
unsigned int no_chk_data_crc:1;
unsigned int bulk_read:1;
unsigned int default_compr:2;
unsigned int assert_action:2;
};
/**
* ubifs_parse_param - parse a parameter.
* @fc: the filesystem context
* @param: the parameter to parse
*
* This function parses UBIFS mount options and returns zero in case success
* and a negative error code in case of failure.
*/
static int ubifs_parse_param(struct fs_context *fc, struct fs_parameter *param)
{
struct ubifs_fs_context *ctx = fc->fs_private;
struct fs_parse_result result;
bool is_remount = (fc->purpose & FS_CONTEXT_FOR_RECONFIGURE);
int opt;
opt = fs_parse(fc, ubifs_fs_param_spec, param, &result);
if (opt < 0)
return opt;
switch (opt) {
/*
* %Opt_fast_unmount and %Opt_norm_unmount options are ignored.
* We accept them in order to be backward-compatible. But this
* should be removed at some point.
*/
case Opt_fast_unmount:
ctx->mount_opts.unmount_mode = 2;
break;
case Opt_norm_unmount:
ctx->mount_opts.unmount_mode = 1;
break;
case Opt_bulk_read:
ctx->mount_opts.bulk_read = 2;
ctx->bulk_read = 1;
break;
case Opt_no_bulk_read:
ctx->mount_opts.bulk_read = 1;
ctx->bulk_read = 0;
break;
case Opt_chk_data_crc:
ctx->mount_opts.chk_data_crc = 2;
ctx->no_chk_data_crc = 0;
break;
case Opt_no_chk_data_crc:
ctx->mount_opts.chk_data_crc = 1;
ctx->no_chk_data_crc = 1;
break;
case Opt_override_compr:
ctx->mount_opts.compr_type = result.uint_32;
ctx->mount_opts.override_compr = 1;
ctx->default_compr = ctx->mount_opts.compr_type;
break;
case Opt_assert:
ctx->assert_action = result.uint_32;
break;
case Opt_auth_key:
if (!is_remount) {
kfree(ctx->auth_key_name);
ctx->auth_key_name = param->string;
param->string = NULL;
}
break;
case Opt_auth_hash_name:
if (!is_remount) {
kfree(ctx->auth_hash_name);
ctx->auth_hash_name = param->string;
param->string = NULL;
}
break;
case Opt_ignore:
break;
}
return 0;
}
/*
* ubifs_release_options - release mount parameters which have been dumped.
* @c: UBIFS file-system description object
*/
Annotation
- Immediate include surface: `linux/init.h`, `linux/slab.h`, `linux/module.h`, `linux/ctype.h`, `linux/kthread.h`, `linux/fs_context.h`, `linux/fs_parser.h`, `linux/seq_file.h`.
- Detected declarations: `struct ubifs_fs_context`, `function Copyright`, `function validate_inode`, `function ubifs_free_inode`, `function ubifs_write_inode`, `function ubifs_drop_inode`, `function ubifs_evict_inode`, `function ubifs_dirty_inode`, `function ubifs_statfs`, `function ubifs_show_options`.
- 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.