How raghaddahman/libnfs works
libnfs is a network NFS client library with raw asynchronous RPC and higher-level asynchronous and synchronous filesystem APIs. An application configures a context and server/share, mounts it, then issues filesystem operations; the sync API offers a blocking interface while the async and raw APIs expose task/callback-driven operation. NFSv3 is the default, with NFSv4.0–4.2 features, including zero-copy I/O and v4.1+ sessions and raw backchannel support. The repository also includes RPC server components. Edges are limited to README-documented relationships or relationships visible in the supplied source index and excerpts; many internal call paths were not sampled.
Main entry points: libnfs.h Public NFS API · libnfs-server.c RPC Server Framework · pdu.c RPC Engine · libnfs-raw-nfs4.c NFS4 RPC
Components 27
Client APIs
- Public NFS API
include/nfsc/libnfs.h - Client Context
lib/libnfs.c - Sync API Bridge
lib/libnfs-sync.c - Mount Client
mount/mount.c
NFS Protocols
- NFS v2/v3 Client
lib/nfs_v3.c - NFS v4 Client
lib/nfs_v4.c - NFS Operations
nfs/nfs.c - NFS4 Operations
nfs4/nfs4.c - Mount RPC
mount/libnfs-raw-mount.c - NFS RPC
nfs/libnfs-raw-nfs.c - NFS4 RPC
nfs4/libnfs-raw-nfs4.c - Portmapper
portmap/portmap.c - Lock Services
nlm/nlm.c - Status Monitor
nsm/nsm.c - Quota RPC
rquota/rquota.c
RPC Transport
- RPC Engine
lib/pdu.c - Socket Transport
lib/socket.c - ZDR Encoding
lib/libnfs-zdr.c - Service Thread
lib/multithreading.c
Transport Integrations
- TLS Handshake
tls/handshake.c - RDMA Transport
lib/rdma.c
RPC Servers
- RPC Server Framework
servers/libnfs-server.c - Mount Server
servers/nfsd/mountd.c - NFS Server
servers/nfsd/nfsd.c - RPCbind Server
servers/rpcbind/rpcbind.c - Statd Server
servers/statd/rpc.statd.c
Other components
- Application
Connections 22
- Application → Public NFS API: uses
README - Public NFS API → Client Context: calls
- Public NFS API → Sync API Bridge: offers blocking calls
README - Public NFS API → NFS v2/v3 Client: offers async filesystem
README - Public NFS API → NFS v4 Client: selects v4 dialect
README - Application → Mount Client: mounts share
README - Mount Client → Mount RPC: uses mount protocol
mount/mount.c - NFS v4 Client → NFS4 RPC: issues compound calls
lib/nfs_v4.c - NFS Operations → NFS RPC: uses NFS RPC
- NFS4 Operations → NFS4 RPC: uses NFS4 RPC
- Application → NFS4 RPC: can issue raw tasks
README - NFS4 RPC → RPC Engine: queues RPC tasks
- Portmapper → RPC Engine: queues RPC tasks
portmap/portmap.c - RPC Engine → ZDR Encoding: encodes RPC data
- RPC Engine → Socket Transport: uses socket I/O
- Socket Transport → TLS Handshake: supports TLS
- Socket Transport → RDMA Transport: supports RDMA
- Application → Service Thread: starts service thread
README - Application → RPC Server Framework: runs RPC services
- RPC Server Framework → Mount Server: supports mount service
servers/nfsd/mountd.c - RPC Server Framework → RPCbind Server: supports rpcbind service
servers/rpcbind/rpcbind.c - RPC Server Framework → Statd Server: supports statd service
servers/statd/rpc.statd.c