fs/lockd/clnt4xdr.c
Source file repositories/reference/linux-study-clean/fs/lockd/clnt4xdr.c
File Facts
- System
- Linux kernel
- Corpus path
fs/lockd/clnt4xdr.c- Extension
.c- Size
- 13101 bytes
- Lines
- 583
- 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/types.hlinux/sunrpc/xdr.hlinux/sunrpc/clnt.hlinux/sunrpc/stats.hlockd.huapi/linux/nfs3.h
Detected Declarations
function Copyrightfunction nlm4_compute_offsetsfunction encode_boolfunction encode_int32function encode_netobjfunction decode_netobjfunction encode_cookiefunction decode_cookiefunction encode_fhfunction encode_nlm4_statfunction decode_nlm4_statfunction encode_nlm4_holderfunction decode_nlm4_holderfunction encode_caller_namefunction encode_nlm4_lockfunction nlm4_xdr_enc_testargsfunction nlm4_xdr_enc_lockargsfunction nlm4_xdr_enc_cancargsfunction nlm4_xdr_enc_unlockargsfunction nlm4_xdr_enc_resfunction nlm4_xdr_enc_testresfunction decode_nlm4_testrplyfunction nlm4_xdr_dec_testresfunction nlm4_xdr_dec_res
Annotated Snippet
* union nlm4_testrply switch (nlm4_stats stat) {
* case NLM4_DENIED:
* struct nlm4_holder holder;
* default:
* void;
* };
*
* struct nlm4_testres {
* netobj cookie;
* nlm4_testrply test_stat;
* };
*/
static void nlm4_xdr_enc_testres(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{
const struct lockd_res *result = data;
encode_cookie(xdr, &result->cookie);
encode_nlm4_stat(xdr, result->status);
if (result->status == nlm_lck_denied)
encode_nlm4_holder(xdr, result);
}
/*
* NLMv4 XDR decode functions
*
* NLMv4 argument types are defined in Appendix II of RFC 1813:
* "NFS Version 3 Protocol Specification" and Chapter 10 of X/Open's
* "Protocols for Interworking: XNFS, Version 3W".
*/
/*
* union nlm4_testrply switch (nlm4_stats stat) {
* case NLM4_DENIED:
* struct nlm4_holder holder;
* default:
* void;
* };
*
* struct nlm4_testres {
* netobj cookie;
* nlm4_testrply test_stat;
* };
*/
static int decode_nlm4_testrply(struct xdr_stream *xdr,
struct lockd_res *result)
{
int error;
error = decode_nlm4_stat(xdr, &result->status);
if (unlikely(error))
goto out;
if (result->status == nlm_lck_denied)
error = decode_nlm4_holder(xdr, result);
out:
return error;
}
static int nlm4_xdr_dec_testres(struct rpc_rqst *req,
struct xdr_stream *xdr,
void *data)
{
struct lockd_res *result = data;
int error;
error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
goto out;
error = decode_nlm4_testrply(xdr, result);
out:
return error;
}
/*
* struct nlm4_res {
* netobj cookie;
* nlm4_stat stat;
* };
*/
static int nlm4_xdr_dec_res(struct rpc_rqst *req,
struct xdr_stream *xdr,
void *data)
{
struct lockd_res *result = data;
int error;
error = decode_cookie(xdr, &result->cookie);
if (unlikely(error))
Annotation
- Immediate include surface: `linux/types.h`, `linux/sunrpc/xdr.h`, `linux/sunrpc/clnt.h`, `linux/sunrpc/stats.h`, `lockd.h`, `uapi/linux/nfs3.h`.
- Detected declarations: `function Copyright`, `function nlm4_compute_offsets`, `function encode_bool`, `function encode_int32`, `function encode_netobj`, `function decode_netobj`, `function encode_cookie`, `function decode_cookie`, `function encode_fh`, `function encode_nlm4_stat`.
- 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.