fs/fuse/req.c
Source file repositories/reference/linux-study-clean/fs/fuse/req.c
File Facts
- System
- Linux kernel
- Corpus path
fs/fuse/req.c- Extension
.c- Size
- 2509 bytes
- Lines
- 100
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dev.hfuse_i.h
Detected Declarations
function fuse_fill_credsfunction fuse_req_prepfunction __fuse_simple_requestfunction fuse_simple_backgroundfunction fuse_simple_notify_replyexport fuse_simple_background
Annotated Snippet
if (no_idmap) {
args->uid = from_kuid_munged(fc->user_ns, current_fsuid());
args->gid = from_kgid_munged(fc->user_ns, current_fsgid());
} else {
args->uid = FUSE_INVALID_UIDGID;
args->gid = FUSE_INVALID_UIDGID;
}
return 0;
}
WARN_ON(args->nocreds);
/*
* Keep the old behavior when idmappings support was not
* declared by a FUSE server.
*
* For those FUSE servers who support idmapped mounts, we send UID/GID
* only along with "inode creation" fuse requests, otherwise idmap ==
* &invalid_mnt_idmap and req->in.h.{u,g}id will be equal to
* FUSE_INVALID_UIDGID.
*/
if (no_idmap) {
fsuid = current_fsuid();
fsgid = current_fsgid();
}
args->uid = from_kuid(fc->user_ns, fsuid);
args->gid = from_kgid(fc->user_ns, fsgid);
if (no_idmap && unlikely(args->uid == ((uid_t)-1) || args->gid == ((gid_t)-1)))
return -EOVERFLOW;
return 0;
}
static int fuse_req_prep(struct fuse_mount *fm, struct fuse_args *args, struct mnt_idmap *idmap)
{
if (!args->force && fm->fc->conn_error)
return -ECONNREFUSED;
return fuse_fill_creds(fm, args, idmap);
}
ssize_t __fuse_simple_request(struct mnt_idmap *idmap, struct fuse_mount *fm,
struct fuse_args *args)
{
struct fuse_conn *fc = fm->fc;
int err = fuse_req_prep(fm, args, idmap);
if (err)
return err;
return fuse_chan_send(fc->chan, args);
}
int fuse_simple_background(struct fuse_mount *fm, struct fuse_args *args, gfp_t gfp_flags)
{
struct fuse_conn *fc = fm->fc;
int err;
WARN_ON(args->force && !args->nocreds);
err = fuse_req_prep(fm, args, &invalid_mnt_idmap);
if (err)
return err;
return fuse_chan_send_bg(fc->chan, args, gfp_flags);
}
EXPORT_SYMBOL_GPL(fuse_simple_background);
int fuse_simple_notify_reply(struct fuse_mount *fm, struct fuse_args *args, u64 unique)
{
struct fuse_conn *fc = fm->fc;
int err;
WARN_ON(args->force && !args->nocreds);
err = fuse_req_prep(fm, args, &invalid_mnt_idmap);
if (err)
return err;
return fuse_chan_send_notify_reply(fc->chan, args, unique);
}
Annotation
- Immediate include surface: `dev.h`, `fuse_i.h`.
- Detected declarations: `function fuse_fill_creds`, `function fuse_req_prep`, `function __fuse_simple_request`, `function fuse_simple_background`, `function fuse_simple_notify_reply`, `export fuse_simple_background`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: integration 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.