fs/fuse/dev.c
Source file repositories/reference/linux-study-clean/fs/fuse/dev.c
File Facts
- System
- Linux kernel
- Corpus path
fs/fuse/dev.c- Extension
.c- Size
- 56668 bytes
- Lines
- 2431
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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
dev.hargs.hdev_uring_i.hlinux/init.hlinux/module.hlinux/poll.hlinux/sched/signal.hlinux/uio.hlinux/miscdevice.hlinux/pagemap.hlinux/file.hlinux/slab.hlinux/pipe_fs_i.hlinux/swap.hlinux/splice.hlinux/sched.hlinux/seq_file.hfuse_trace.h
Detected Declarations
function fuse_request_initfunction fuse_request_freefunction __fuse_get_requestfunction __fuse_put_requestfunction fuse_chan_set_initializedfunction fuse_block_allocfunction fuse_drop_waitingfunction fuse_put_requestfunction fuse_len_argsfunction fuse_get_unique_lockedfunction fuse_get_uniquefunction fuse_req_hashfunction fuse_dev_wake_and_unlockfunction fuse_dev_queue_forgetfunction fuse_dev_queue_interruptfunction fuse_request_assign_unique_lockedfunction fuse_request_assign_uniquefunction fuse_dev_queue_reqfunction fuse_iqueue_initfunction fuse_chan_releasefunction fuse_chan_freefunction fuse_chan_num_backgroundfunction fuse_chan_max_backgroundfunction fuse_chan_max_background_setfunction fuse_chan_num_waitingfunction fuse_chan_set_fcfunction fuse_chan_io_uring_enablefunction fuse_pqueue_initfunction fuse_dev_install_with_pqfunction fuse_dev_installfunction fuse_dev_putfunction fuse_dev_is_installedfunction fuse_dev_verifyfunction fuse_dev_is_sync_initfunction fuse_send_onefunction fuse_chan_queue_forgetfunction flush_bg_queuefunction fuse_request_bg_finishfunction abortedfunction test_and_set_bitfunction queue_interruptfunction fuse_remove_pending_reqfunction request_wait_answerfunction __fuse_request_sendfunction fuse_adjust_compatfunction fuse_args_to_reqfunction fuse_chan_sendfunction fuse_request_queue_background_uring
Annotated Snippet
const struct file_operations fuse_dev_operations = {
.owner = THIS_MODULE,
.open = fuse_dev_open,
.read_iter = fuse_dev_read,
.splice_read = fuse_dev_splice_read,
.write_iter = fuse_dev_write,
.splice_write = fuse_dev_splice_write,
.poll = fuse_dev_poll,
.release = fuse_dev_release,
.fasync = fuse_dev_fasync,
.unlocked_ioctl = fuse_dev_ioctl,
.compat_ioctl = compat_ptr_ioctl,
#ifdef CONFIG_FUSE_IO_URING
.uring_cmd = fuse_uring_cmd,
#endif
#ifdef CONFIG_PROC_FS
.show_fdinfo = fuse_dev_show_fdinfo,
#endif
};
EXPORT_SYMBOL_GPL(fuse_dev_operations);
static struct miscdevice fuse_miscdevice = {
.minor = FUSE_MINOR,
.name = "fuse",
.fops = &fuse_dev_operations,
};
int __init fuse_dev_init(void)
{
int err = -ENOMEM;
fuse_req_cachep = kmem_cache_create("fuse_request",
sizeof(struct fuse_req),
0, 0, NULL);
if (!fuse_req_cachep)
goto out;
err = misc_register(&fuse_miscdevice);
if (err)
goto out_cache_clean;
return 0;
out_cache_clean:
kmem_cache_destroy(fuse_req_cachep);
out:
return err;
}
void fuse_dev_cleanup(void)
{
misc_deregister(&fuse_miscdevice);
kmem_cache_destroy(fuse_req_cachep);
}
Annotation
- Immediate include surface: `dev.h`, `args.h`, `dev_uring_i.h`, `linux/init.h`, `linux/module.h`, `linux/poll.h`, `linux/sched/signal.h`, `linux/uio.h`.
- Detected declarations: `function fuse_request_init`, `function fuse_request_free`, `function __fuse_get_request`, `function __fuse_put_request`, `function fuse_chan_set_initialized`, `function fuse_block_alloc`, `function fuse_drop_waiting`, `function fuse_put_request`, `function fuse_len_args`, `function fuse_get_unique_locked`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.