nfsd_file_acquire_opened(9)
π nfsd_file_acquire_opened(9) π
okay so bestie, we're in the Kernel API Manual today and the star of the show is nfsd_file_acquire_opened β literally the function that grabs you a struct nfsd_file using an already-open file instead of going to all the trouble of opening a new one. iconic behavior tbh π
β¨ NAME β¨
nfsd_file_acquire_opened β get a struct nfsd_file using existing open file π«Ά
πΈ SYNOPSIS πΈ
__be32 nfsd_file_acquire_opened (struct svc_rqst *rqstp , struct svc_fh
*fhp , unsigned int may_flags , struct file *file , struct nfsd_file
**pnf );
no cap, that's the whole signature π
π¦ ARGUMENTS π¦
rqstpβ the RPC transaction being executed, i.e. the whole reason we're here rn β¨fhpβ the NFS filehandle of the file just created πmay_flagsβ theNFSD_MAY_settings for the file, so it knows what's allowed πfileβ cached, already-open file. and yes bestie, it may beNULLor not yet opened πpnfβ OUT: the new or foundstruct nfsd_fileobject lands here π
π₯ DESCRIPTION π₯
so the vibe here is: acquire an nfsd_file object that is not GC'ed. that's the whole mission. β
and if one doesn't already exist, and file has FMODE_OPENED set, then use it to instantiate a new nfsd_file instead of opening a new one. the way that saves you an open callβ¦ obsessed ππ
Return values, listen up:
nfs_okβpnfpoints to annfsd_filewith its reference count boosted π (yes, boosted, main character reference count energy)- On error, an
nfsstatvalue in network byte order is returned π
fr fr, remember the network byte order part, it's giving "I will bite you if you forget" π
π SEE ALSO π
Kernel file ./fs/nfsd/filecache.c
nfsd_file_check_write_error(9), nfsd_file_put(9), nfsd_file_put_local(9), nfsd_file_file(9), nfsd_file_dispose_list_delayed(9), nfsd_file_net_dispose(9), nfsd_file_lru_cb(9), nfsd_file_cond_queue(9), nfsd_file_queue_for_close(9), nfsd_file_close_inode(9), nfsd_file_close_inode_sync(9), nfsd_file_close_export(9), __nfsd_file_cache_purge(9), nfsd_file_cache_purge(9), nfsd_file_is_cached(9), nfsd_file_acquire_gc(9), nfsd_file_acquire(9), nfsd_file_acquire_local(9), nfsd_file_acquire_dir(9), nfsd_fsnotify_recalc_mask(9)
like. the whole friend group. go say hi π«Άπ
and that's the page babes π huge shoutout to ./fs/nfsd, dated October 2026, for making this little kernel-API moment possible. slay, periodt, bye πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms