fs/autofs/autofs_i.h
Source file repositories/reference/linux-study-clean/fs/autofs/autofs_i.h
File Facts
- System
- Linux kernel
- Corpus path
fs/autofs/autofs_i.h- Extension
.h- Size
- 8346 bytes
- Lines
- 307
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/auto_fs.hlinux/auto_dev-ioctl.hlinux/kernel.hlinux/slab.hlinux/time.hlinux/string.hlinux/wait.hlinux/sched.hlinux/sched/signal.huapi/linux/mount.hlinux/mount.hlinux/namei.hlinux/uaccess.hlinux/mutex.hlinux/spinlock.hlinux/list.hlinux/completion.hlinux/file.hlinux/magic.hlinux/fs_context.hlinux/fs_parser.h../mount.hlinux/ns_common.h
Detected Declarations
struct autofs_infostruct autofs_wait_queuestruct autofs_sb_infofunction autofs_oz_modefunction autofs_emptyfunction __managed_dentry_set_managedfunction managed_dentry_set_managedfunction __managed_dentry_clear_managedfunction managed_dentry_clear_managedfunction autofs_check_pipefunction autofs_set_packet_pipe_flagsfunction autofs_prepare_pipefunction autofs_get_devfunction autofs_get_inofunction __autofs_add_expiringfunction autofs_add_expiringfunction autofs_del_expiring
Annotated Snippet
extern const struct file_operations autofs_dir_operations;
extern const struct file_operations autofs_root_operations;
extern const struct dentry_operations autofs_dentry_operations;
/* VFS automount flags management functions */
static inline void __managed_dentry_set_managed(struct dentry *dentry)
{
dentry->d_flags |= (DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT);
}
static inline void managed_dentry_set_managed(struct dentry *dentry)
{
spin_lock(&dentry->d_lock);
__managed_dentry_set_managed(dentry);
spin_unlock(&dentry->d_lock);
}
static inline void __managed_dentry_clear_managed(struct dentry *dentry)
{
dentry->d_flags &= ~(DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT);
}
static inline void managed_dentry_clear_managed(struct dentry *dentry)
{
spin_lock(&dentry->d_lock);
__managed_dentry_clear_managed(dentry);
spin_unlock(&dentry->d_lock);
}
/* Initializing function */
extern const struct fs_parameter_spec autofs_param_specs[];
int autofs_init_fs_context(struct fs_context *fc);
struct autofs_info *autofs_new_ino(struct autofs_sb_info *);
void autofs_clean_ino(struct autofs_info *);
static inline int autofs_check_pipe(struct file *pipe)
{
if (pipe->f_mode & FMODE_PATH)
return -EINVAL;
if (!(pipe->f_mode & FMODE_CAN_WRITE))
return -EINVAL;
if (!S_ISFIFO(file_inode(pipe)->i_mode))
return -EINVAL;
return 0;
}
static inline void autofs_set_packet_pipe_flags(struct file *pipe)
{
/* We want a packet pipe */
pipe->f_flags |= O_DIRECT;
/* We don't expect -EAGAIN */
pipe->f_flags &= ~O_NONBLOCK;
}
static inline int autofs_prepare_pipe(struct file *pipe)
{
int ret = autofs_check_pipe(pipe);
if (ret < 0)
return ret;
autofs_set_packet_pipe_flags(pipe);
return 0;
}
/* Queue management functions */
int autofs_wait(struct autofs_sb_info *,
const struct path *, enum autofs_notify);
int autofs_wait_release(struct autofs_sb_info *, autofs_wqt_t, int);
void autofs_catatonic_mode(struct autofs_sb_info *);
static inline u32 autofs_get_dev(struct autofs_sb_info *sbi)
{
return new_encode_dev(sbi->sb->s_dev);
}
static inline u64 autofs_get_ino(struct autofs_sb_info *sbi)
{
return d_inode(sbi->sb->s_root)->i_ino;
}
static inline void __autofs_add_expiring(struct dentry *dentry)
{
struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
struct autofs_info *ino = autofs_dentry_ino(dentry);
if (ino) {
if (list_empty(&ino->expiring))
list_add(&ino->expiring, &sbi->expiring_list);
}
Annotation
- Immediate include surface: `linux/auto_fs.h`, `linux/auto_dev-ioctl.h`, `linux/kernel.h`, `linux/slab.h`, `linux/time.h`, `linux/string.h`, `linux/wait.h`, `linux/sched.h`.
- Detected declarations: `struct autofs_info`, `struct autofs_wait_queue`, `struct autofs_sb_info`, `function autofs_oz_mode`, `function autofs_empty`, `function __managed_dentry_set_managed`, `function managed_dentry_set_managed`, `function __managed_dentry_clear_managed`, `function managed_dentry_clear_managed`, `function autofs_check_pipe`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern 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.