fs/hfsplus/options.c
Source file repositories/reference/linux-study-clean/fs/hfsplus/options.c
File Facts
- System
- Linux kernel
- Corpus path
fs/hfsplus/options.c- Extension
.c- Size
- 4244 bytes
- Lines
- 170
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string.hlinux/kernel.hlinux/sched.hlinux/fs_struct.hlinux/fs_context.hlinux/fs_parser.hlinux/nls.hlinux/mount.hlinux/seq_file.hlinux/slab.hhfsplus_fs.h
Detected Declarations
function hfsplus_fill_defaultsfunction hfsplus_parse_paramfunction hfsplus_show_options
Annotated Snippet
if (strlen(param->string) != 4) {
pr_err("creator requires a 4 character value\n");
return -EINVAL;
}
memcpy(&sbi->creator, param->string, 4);
break;
case opt_type:
if (strlen(param->string) != 4) {
pr_err("type requires a 4 character value\n");
return -EINVAL;
}
memcpy(&sbi->type, param->string, 4);
break;
case opt_umask:
sbi->umask = (umode_t)result.uint_32;
break;
case opt_uid:
sbi->uid = result.uid;
set_bit(HFSPLUS_SB_UID, &sbi->flags);
break;
case opt_gid:
sbi->gid = result.gid;
set_bit(HFSPLUS_SB_GID, &sbi->flags);
break;
case opt_part:
sbi->part = result.uint_32;
break;
case opt_session:
sbi->session = result.uint_32;
break;
case opt_nls:
if (sbi->nls) {
pr_err("unable to change nls mapping\n");
return -EINVAL;
}
sbi->nls = load_nls(param->string);
if (!sbi->nls) {
pr_err("unable to load nls mapping \"%s\"\n",
param->string);
return -EINVAL;
}
break;
case opt_decompose:
if (result.negated)
set_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags);
else
clear_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags);
break;
case opt_barrier:
if (result.negated)
set_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags);
else
clear_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags);
break;
case opt_force:
set_bit(HFSPLUS_SB_FORCE, &sbi->flags);
break;
default:
return -EINVAL;
}
return 0;
}
int hfsplus_show_options(struct seq_file *seq, struct dentry *root)
{
struct hfsplus_sb_info *sbi = HFSPLUS_SB(root->d_sb);
if (sbi->creator != HFSPLUS_DEF_CR_TYPE)
seq_show_option_n(seq, "creator", (char *)&sbi->creator, 4);
if (sbi->type != HFSPLUS_DEF_CR_TYPE)
seq_show_option_n(seq, "type", (char *)&sbi->type, 4);
seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask,
from_kuid_munged(&init_user_ns, sbi->uid),
from_kgid_munged(&init_user_ns, sbi->gid));
if (sbi->part >= 0)
seq_printf(seq, ",part=%u", sbi->part);
if (sbi->session >= 0)
seq_printf(seq, ",session=%u", sbi->session);
if (sbi->nls)
seq_printf(seq, ",nls=%s", sbi->nls->charset);
if (test_bit(HFSPLUS_SB_NODECOMPOSE, &sbi->flags))
seq_puts(seq, ",nodecompose");
if (test_bit(HFSPLUS_SB_NOBARRIER, &sbi->flags))
seq_puts(seq, ",nobarrier");
return 0;
}
Annotation
- Immediate include surface: `linux/string.h`, `linux/kernel.h`, `linux/sched.h`, `linux/fs_struct.h`, `linux/fs_context.h`, `linux/fs_parser.h`, `linux/nls.h`, `linux/mount.h`.
- Detected declarations: `function hfsplus_fill_defaults`, `function hfsplus_parse_param`, `function hfsplus_show_options`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
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.