fs/nfsd/nfsproc.c
Source file repositories/reference/linux-study-clean/fs/nfsd/nfsproc.c
File Facts
- System
- Linux kernel
- Corpus path
fs/nfsd/nfsproc.c- Extension
.c- Size
- 23189 bytes
- Lines
- 851
- 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/namei.hcache.hxdr.hvfs.htrace.h
Detected Declarations
function Copyrightfunction nfsd_proc_nullfunction nfsd_proc_getattrfunction nfsd_proc_setattrfunction nfsd_proc_rootfunction nfsd_proc_lookupfunction nfsd_proc_readlinkfunction nfsd_proc_readfunction nfsd_proc_writecachefunction nfsd_proc_writefunction createfunction nfsd_proc_removefunction nfsd_proc_renamefunction nfsd_proc_linkfunction nfsd_proc_symlinkfunction nfsd_proc_mkdirfunction nfsd_proc_rmdirfunction nfsd_init_dirlist_pagesfunction nfsd_proc_readdirfunction nfsd_proc_statfs
Annotated Snippet
setattr_prepare(&nop_mnt_idmap, fhp->fh_dentry, iap) != 0) {
/*
* Turn off ATTR_[AM]TIME_SET but leave ATTR_[AM]TIME.
* This will cause notify_change to set these times
* to "now"
*/
iap->ia_valid &= ~BOTH_TIME_SET;
}
}
resp->status = nfsd_setattr(rqstp, fhp, &attrs, NULL);
if (resp->status != nfs_ok)
goto out;
resp->status = fh_getattr(&resp->fh, &resp->stat);
out:
resp->status = nfsd_map_status(resp->status);
return rpc_success;
}
/* Obsolete, replaced by MNTPROC_MNT. */
static __be32
nfsd_proc_root(struct svc_rqst *rqstp)
{
return rpc_success;
}
/*
* Look up a path name component
* Note: the dentry in the resp->fh may be negative if the file
* doesn't exist yet.
* N.B. After this call resp->fh needs an fh_put
*/
static __be32
nfsd_proc_lookup(struct svc_rqst *rqstp)
{
struct nfsd_diropargs *argp = rqstp->rq_argp;
struct nfsd_diropres *resp = rqstp->rq_resp;
dprintk("nfsd: LOOKUP %s %.*s\n",
SVCFH_fmt(&argp->fh), argp->len, argp->name);
fh_init(&resp->fh, NFS_FHSIZE);
resp->status = nfsd_lookup(rqstp, &argp->fh, argp->name, argp->len,
&resp->fh);
fh_put(&argp->fh);
if (resp->status != nfs_ok)
goto out;
resp->status = fh_getattr(&resp->fh, &resp->stat);
out:
resp->status = nfsd_map_status(resp->status);
return rpc_success;
}
/*
* Read a symlink.
*/
static __be32
nfsd_proc_readlink(struct svc_rqst *rqstp)
{
struct nfsd_fhandle *argp = rqstp->rq_argp;
struct nfsd_readlinkres *resp = rqstp->rq_resp;
dprintk("nfsd: READLINK %s\n", SVCFH_fmt(&argp->fh));
/* Read the symlink. */
resp->len = NFS_MAXPATHLEN;
resp->page = *(rqstp->rq_next_page++);
resp->status = nfsd_readlink(rqstp, &argp->fh,
page_address(resp->page), &resp->len);
fh_put(&argp->fh);
resp->status = nfsd_map_status(resp->status);
return rpc_success;
}
/*
* Read a portion of a file.
* N.B. After this call resp->fh needs an fh_put
*/
static __be32
nfsd_proc_read(struct svc_rqst *rqstp)
{
struct nfsd_readargs *argp = rqstp->rq_argp;
struct nfsd_readres *resp = rqstp->rq_resp;
u32 eof;
dprintk("nfsd: READ %s %d bytes at %d\n",
SVCFH_fmt(&argp->fh),
Annotation
- Immediate include surface: `linux/namei.h`, `cache.h`, `xdr.h`, `vfs.h`, `trace.h`.
- Detected declarations: `function Copyright`, `function nfsd_proc_null`, `function nfsd_proc_getattr`, `function nfsd_proc_setattr`, `function nfsd_proc_root`, `function nfsd_proc_lookup`, `function nfsd_proc_readlink`, `function nfsd_proc_read`, `function nfsd_proc_writecache`, `function nfsd_proc_write`.
- 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.