nfs_fs.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * linux/include/linux/nfs_fs.h
  4. *
  5. * Copyright (C) 1992 Rick Sladkey
  6. *
  7. * OS-specific nfs filesystem definitions and declarations
  8. */
  9. #ifndef _LINUX_NFS_FS_H
  10. #define _LINUX_NFS_FS_H
  11. #include <uapi/linux/nfs_fs.h>
  12. /*
  13. * Enable dprintk() debugging support for nfs client.
  14. */
  15. #ifdef CONFIG_NFS_DEBUG
  16. # define NFS_DEBUG
  17. #endif
  18. #include <linux/in.h>
  19. #include <linux/mm.h>
  20. #include <linux/pagemap.h>
  21. #include <linux/rbtree.h>
  22. #include <linux/refcount.h>
  23. #include <linux/rwsem.h>
  24. #include <linux/wait.h>
  25. #include <linux/sunrpc/debug.h>
  26. #include <linux/sunrpc/auth.h>
  27. #include <linux/sunrpc/clnt.h>
  28. #include <linux/nfs.h>
  29. #include <linux/nfs2.h>
  30. #include <linux/nfs3.h>
  31. #include <linux/nfs4.h>
  32. #include <linux/nfs_xdr.h>
  33. #include <linux/nfs_fs_sb.h>
  34. #include <linux/mempool.h>
  35. /*
  36. * These are the default flags for swap requests
  37. */
  38. #define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
  39. /*
  40. * NFSv3/v4 Access mode cache entry
  41. */
  42. struct nfs_access_entry {
  43. struct rb_node rb_node;
  44. struct list_head lru;
  45. struct rpc_cred * cred;
  46. __u32 mask;
  47. struct rcu_head rcu_head;
  48. };
  49. struct nfs_lock_context {
  50. refcount_t count;
  51. struct list_head list;
  52. struct nfs_open_context *open_context;
  53. fl_owner_t lockowner;
  54. atomic_t io_count;
  55. };
  56. struct nfs4_state;
  57. struct nfs_open_context {
  58. struct nfs_lock_context lock_context;
  59. fl_owner_t flock_owner;
  60. struct dentry *dentry;
  61. struct rpc_cred *cred;
  62. struct nfs4_state *state;
  63. fmode_t mode;
  64. unsigned long flags;
  65. #define NFS_CONTEXT_ERROR_WRITE (0)
  66. #define NFS_CONTEXT_RESEND_WRITES (1)
  67. #define NFS_CONTEXT_BAD (2)
  68. #define NFS_CONTEXT_UNLOCK (3)
  69. int error;
  70. struct list_head list;
  71. struct nfs4_threshold *mdsthreshold;
  72. };
  73. struct nfs_open_dir_context {
  74. struct list_head list;
  75. struct rpc_cred *cred;
  76. unsigned long attr_gencount;
  77. __u64 dir_cookie;
  78. __u64 dup_cookie;
  79. signed char duped;
  80. };
  81. /*
  82. * NFSv4 delegation
  83. */
  84. struct nfs_delegation;
  85. struct posix_acl;
  86. /*
  87. * nfs fs inode data in memory
  88. */
  89. struct nfs_inode {
  90. /*
  91. * The 64bit 'inode number'
  92. */
  93. __u64 fileid;
  94. /*
  95. * NFS file handle
  96. */
  97. struct nfs_fh fh;
  98. /*
  99. * Various flags
  100. */
  101. unsigned long flags; /* atomic bit ops */
  102. unsigned long cache_validity; /* bit mask */
  103. /*
  104. * read_cache_jiffies is when we started read-caching this inode.
  105. * attrtimeo is for how long the cached information is assumed
  106. * to be valid. A successful attribute revalidation doubles
  107. * attrtimeo (up to acregmax/acdirmax), a failure resets it to
  108. * acregmin/acdirmin.
  109. *
  110. * We need to revalidate the cached attrs for this inode if
  111. *
  112. * jiffies - read_cache_jiffies >= attrtimeo
  113. *
  114. * Please note the comparison is greater than or equal
  115. * so that zero timeout values can be specified.
  116. */
  117. unsigned long read_cache_jiffies;
  118. unsigned long attrtimeo;
  119. unsigned long attrtimeo_timestamp;
  120. unsigned long attr_gencount;
  121. /* "Generation counter" for the attribute cache. This is
  122. * bumped whenever we update the metadata on the
  123. * server.
  124. */
  125. unsigned long cache_change_attribute;
  126. struct rb_root access_cache;
  127. struct list_head access_cache_entry_lru;
  128. struct list_head access_cache_inode_lru;
  129. /*
  130. * This is the cookie verifier used for NFSv3 readdir
  131. * operations
  132. */
  133. __be32 cookieverf[2];
  134. atomic_long_t nrequests;
  135. struct nfs_mds_commit_info commit_info;
  136. /* Open contexts for shared mmap writes */
  137. struct list_head open_files;
  138. /* Readers: in-flight sillydelete RPC calls */
  139. /* Writers: rmdir */
  140. struct rw_semaphore rmdir_sem;
  141. struct mutex commit_mutex;
  142. #if IS_ENABLED(CONFIG_NFS_V4)
  143. struct nfs4_cached_acl *nfs4_acl;
  144. /* NFSv4 state */
  145. struct list_head open_states;
  146. struct nfs_delegation __rcu *delegation;
  147. struct rw_semaphore rwsem;
  148. /* pNFS layout information */
  149. struct pnfs_layout_hdr *layout;
  150. #endif /* CONFIG_NFS_V4*/
  151. /* how many bytes have been written/read and how many bytes queued up */
  152. __u64 write_io;
  153. __u64 read_io;
  154. #ifdef CONFIG_NFS_FSCACHE
  155. struct fscache_cookie *fscache;
  156. #endif
  157. struct inode vfs_inode;
  158. };
  159. struct nfs4_copy_state {
  160. struct list_head copies;
  161. nfs4_stateid stateid;
  162. struct completion completion;
  163. uint64_t count;
  164. struct nfs_writeverf verf;
  165. int error;
  166. int flags;
  167. struct nfs4_state *parent_state;
  168. };
  169. /*
  170. * Access bit flags
  171. */
  172. #define NFS_ACCESS_READ 0x0001
  173. #define NFS_ACCESS_LOOKUP 0x0002
  174. #define NFS_ACCESS_MODIFY 0x0004
  175. #define NFS_ACCESS_EXTEND 0x0008
  176. #define NFS_ACCESS_DELETE 0x0010
  177. #define NFS_ACCESS_EXECUTE 0x0020
  178. /*
  179. * Cache validity bit flags
  180. */
  181. #define NFS_INO_INVALID_DATA BIT(1) /* cached data is invalid */
  182. #define NFS_INO_INVALID_ATIME BIT(2) /* cached atime is invalid */
  183. #define NFS_INO_INVALID_ACCESS BIT(3) /* cached access cred invalid */
  184. #define NFS_INO_INVALID_ACL BIT(4) /* cached acls are invalid */
  185. #define NFS_INO_REVAL_PAGECACHE BIT(5) /* must revalidate pagecache */
  186. #define NFS_INO_REVAL_FORCED BIT(6) /* force revalidation ignoring a delegation */
  187. #define NFS_INO_INVALID_LABEL BIT(7) /* cached label is invalid */
  188. #define NFS_INO_INVALID_CHANGE BIT(8) /* cached change is invalid */
  189. #define NFS_INO_INVALID_CTIME BIT(9) /* cached ctime is invalid */
  190. #define NFS_INO_INVALID_MTIME BIT(10) /* cached mtime is invalid */
  191. #define NFS_INO_INVALID_SIZE BIT(11) /* cached size is invalid */
  192. #define NFS_INO_INVALID_OTHER BIT(12) /* other attrs are invalid */
  193. #define NFS_INO_INVALID_ATTR (NFS_INO_INVALID_CHANGE \
  194. | NFS_INO_INVALID_CTIME \
  195. | NFS_INO_INVALID_MTIME \
  196. | NFS_INO_INVALID_SIZE \
  197. | NFS_INO_INVALID_OTHER) /* inode metadata is invalid */
  198. /*
  199. * Bit offsets in flags field
  200. */
  201. #define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */
  202. #define NFS_INO_STALE (1) /* possible stale inode */
  203. #define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
  204. #define NFS_INO_INVALIDATING (3) /* inode is being invalidated */
  205. #define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
  206. #define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
  207. #define NFS_INO_LAYOUTCOMMIT (9) /* layoutcommit required */
  208. #define NFS_INO_LAYOUTCOMMITTING (10) /* layoutcommit inflight */
  209. #define NFS_INO_LAYOUTSTATS (11) /* layoutstats inflight */
  210. #define NFS_INO_ODIRECT (12) /* I/O setting is O_DIRECT */
  211. static inline struct nfs_inode *NFS_I(const struct inode *inode)
  212. {
  213. return container_of(inode, struct nfs_inode, vfs_inode);
  214. }
  215. static inline struct nfs_server *NFS_SB(const struct super_block *s)
  216. {
  217. return (struct nfs_server *)(s->s_fs_info);
  218. }
  219. static inline struct nfs_fh *NFS_FH(const struct inode *inode)
  220. {
  221. return &NFS_I(inode)->fh;
  222. }
  223. static inline struct nfs_server *NFS_SERVER(const struct inode *inode)
  224. {
  225. return NFS_SB(inode->i_sb);
  226. }
  227. static inline struct rpc_clnt *NFS_CLIENT(const struct inode *inode)
  228. {
  229. return NFS_SERVER(inode)->client;
  230. }
  231. static inline const struct nfs_rpc_ops *NFS_PROTO(const struct inode *inode)
  232. {
  233. return NFS_SERVER(inode)->nfs_client->rpc_ops;
  234. }
  235. static inline unsigned NFS_MINATTRTIMEO(const struct inode *inode)
  236. {
  237. struct nfs_server *nfss = NFS_SERVER(inode);
  238. return S_ISDIR(inode->i_mode) ? nfss->acdirmin : nfss->acregmin;
  239. }
  240. static inline unsigned NFS_MAXATTRTIMEO(const struct inode *inode)
  241. {
  242. struct nfs_server *nfss = NFS_SERVER(inode);
  243. return S_ISDIR(inode->i_mode) ? nfss->acdirmax : nfss->acregmax;
  244. }
  245. static inline int NFS_STALE(const struct inode *inode)
  246. {
  247. return test_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
  248. }
  249. static inline struct fscache_cookie *nfs_i_fscache(struct inode *inode)
  250. {
  251. #ifdef CONFIG_NFS_FSCACHE
  252. return NFS_I(inode)->fscache;
  253. #else
  254. return NULL;
  255. #endif
  256. }
  257. static inline __u64 NFS_FILEID(const struct inode *inode)
  258. {
  259. return NFS_I(inode)->fileid;
  260. }
  261. static inline void set_nfs_fileid(struct inode *inode, __u64 fileid)
  262. {
  263. NFS_I(inode)->fileid = fileid;
  264. }
  265. static inline void nfs_mark_for_revalidate(struct inode *inode)
  266. {
  267. struct nfs_inode *nfsi = NFS_I(inode);
  268. spin_lock(&inode->i_lock);
  269. nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE
  270. | NFS_INO_INVALID_ACCESS
  271. | NFS_INO_INVALID_ACL
  272. | NFS_INO_INVALID_CHANGE
  273. | NFS_INO_INVALID_CTIME;
  274. if (S_ISDIR(inode->i_mode))
  275. nfsi->cache_validity |= NFS_INO_INVALID_DATA;
  276. spin_unlock(&inode->i_lock);
  277. }
  278. static inline int nfs_server_capable(struct inode *inode, int cap)
  279. {
  280. return NFS_SERVER(inode)->caps & cap;
  281. }
  282. static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
  283. {
  284. dentry->d_time = verf;
  285. }
  286. /**
  287. * nfs_save_change_attribute - Returns the inode attribute change cookie
  288. * @dir - pointer to parent directory inode
  289. * The "change attribute" is updated every time we finish an operation
  290. * that will result in a metadata change on the server.
  291. */
  292. static inline unsigned long nfs_save_change_attribute(struct inode *dir)
  293. {
  294. return NFS_I(dir)->cache_change_attribute;
  295. }
  296. /**
  297. * nfs_verify_change_attribute - Detects NFS remote directory changes
  298. * @dir - pointer to parent directory inode
  299. * @chattr - previously saved change attribute
  300. * Return "false" if the verifiers doesn't match the change attribute.
  301. * This would usually indicate that the directory contents have changed on
  302. * the server, and that any dentries need revalidating.
  303. */
  304. static inline int nfs_verify_change_attribute(struct inode *dir, unsigned long chattr)
  305. {
  306. return chattr == NFS_I(dir)->cache_change_attribute;
  307. }
  308. /*
  309. * linux/fs/nfs/inode.c
  310. */
  311. extern int nfs_sync_mapping(struct address_space *mapping);
  312. extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
  313. extern void nfs_zap_caches(struct inode *);
  314. extern void nfs_invalidate_atime(struct inode *);
  315. extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
  316. struct nfs_fattr *, struct nfs4_label *);
  317. struct inode *nfs_ilookup(struct super_block *sb, struct nfs_fattr *, struct nfs_fh *);
  318. extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
  319. extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
  320. extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
  321. extern int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fattr *fattr);
  322. extern int nfs_getattr(const struct path *, struct kstat *, u32, unsigned int);
  323. extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
  324. extern void nfs_access_set_mask(struct nfs_access_entry *, u32);
  325. extern int nfs_permission(struct inode *, int);
  326. extern int nfs_open(struct inode *, struct file *);
  327. extern int nfs_attribute_cache_expired(struct inode *inode);
  328. extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
  329. extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
  330. extern bool nfs_mapping_need_revalidate_inode(struct inode *inode);
  331. extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
  332. extern int nfs_revalidate_mapping_rcu(struct inode *inode);
  333. extern int nfs_setattr(struct dentry *, struct iattr *);
  334. extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, struct nfs_fattr *);
  335. extern void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
  336. struct nfs4_label *label);
  337. extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
  338. extern void put_nfs_open_context(struct nfs_open_context *ctx);
  339. extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
  340. extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode, struct file *filp);
  341. extern void nfs_inode_attach_open_context(struct nfs_open_context *ctx);
  342. extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
  343. extern void nfs_file_clear_open_context(struct file *flip);
  344. extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
  345. extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
  346. extern u64 nfs_compat_user_ino64(u64 fileid);
  347. extern void nfs_fattr_init(struct nfs_fattr *fattr);
  348. extern void nfs_fattr_set_barrier(struct nfs_fattr *fattr);
  349. extern unsigned long nfs_inc_attr_generation_counter(void);
  350. extern struct nfs_fattr *nfs_alloc_fattr(void);
  351. static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
  352. {
  353. kfree(fattr);
  354. }
  355. extern struct nfs_fh *nfs_alloc_fhandle(void);
  356. static inline void nfs_free_fhandle(const struct nfs_fh *fh)
  357. {
  358. kfree(fh);
  359. }
  360. #ifdef NFS_DEBUG
  361. extern u32 _nfs_display_fhandle_hash(const struct nfs_fh *fh);
  362. static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh)
  363. {
  364. return _nfs_display_fhandle_hash(fh);
  365. }
  366. extern void _nfs_display_fhandle(const struct nfs_fh *fh, const char *caption);
  367. #define nfs_display_fhandle(fh, caption) \
  368. do { \
  369. if (unlikely(nfs_debug & NFSDBG_FACILITY)) \
  370. _nfs_display_fhandle(fh, caption); \
  371. } while (0)
  372. #else
  373. static inline u32 nfs_display_fhandle_hash(const struct nfs_fh *fh)
  374. {
  375. return 0;
  376. }
  377. static inline void nfs_display_fhandle(const struct nfs_fh *fh,
  378. const char *caption)
  379. {
  380. }
  381. #endif
  382. /*
  383. * linux/fs/nfs/nfsroot.c
  384. */
  385. extern int nfs_root_data(char **root_device, char **root_data); /*__init*/
  386. /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
  387. extern __be32 root_nfs_parse_addr(char *name); /*__init*/
  388. /*
  389. * linux/fs/nfs/file.c
  390. */
  391. extern const struct file_operations nfs_file_operations;
  392. #if IS_ENABLED(CONFIG_NFS_V4)
  393. extern const struct file_operations nfs4_file_operations;
  394. #endif /* CONFIG_NFS_V4 */
  395. extern const struct address_space_operations nfs_file_aops;
  396. extern const struct address_space_operations nfs_dir_aops;
  397. static inline struct nfs_open_context *nfs_file_open_context(struct file *filp)
  398. {
  399. return filp->private_data;
  400. }
  401. static inline struct rpc_cred *nfs_file_cred(struct file *file)
  402. {
  403. if (file != NULL) {
  404. struct nfs_open_context *ctx =
  405. nfs_file_open_context(file);
  406. if (ctx)
  407. return ctx->cred;
  408. }
  409. return NULL;
  410. }
  411. /*
  412. * linux/fs/nfs/direct.c
  413. */
  414. extern ssize_t nfs_direct_IO(struct kiocb *, struct iov_iter *);
  415. extern ssize_t nfs_file_direct_read(struct kiocb *iocb,
  416. struct iov_iter *iter);
  417. extern ssize_t nfs_file_direct_write(struct kiocb *iocb,
  418. struct iov_iter *iter);
  419. /*
  420. * linux/fs/nfs/dir.c
  421. */
  422. extern const struct file_operations nfs_dir_operations;
  423. extern const struct dentry_operations nfs_dentry_operations;
  424. extern void nfs_force_lookup_revalidate(struct inode *dir);
  425. extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
  426. struct nfs_fattr *fattr, struct nfs4_label *label);
  427. extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags);
  428. extern void nfs_access_zap_cache(struct inode *inode);
  429. /*
  430. * linux/fs/nfs/symlink.c
  431. */
  432. extern const struct inode_operations nfs_symlink_inode_operations;
  433. /*
  434. * linux/fs/nfs/sysctl.c
  435. */
  436. #ifdef CONFIG_SYSCTL
  437. extern int nfs_register_sysctl(void);
  438. extern void nfs_unregister_sysctl(void);
  439. #else
  440. #define nfs_register_sysctl() 0
  441. #define nfs_unregister_sysctl() do { } while(0)
  442. #endif
  443. /*
  444. * linux/fs/nfs/namespace.c
  445. */
  446. extern const struct inode_operations nfs_mountpoint_inode_operations;
  447. extern const struct inode_operations nfs_referral_inode_operations;
  448. extern int nfs_mountpoint_expiry_timeout;
  449. extern void nfs_release_automount_timer(void);
  450. /*
  451. * linux/fs/nfs/unlink.c
  452. */
  453. extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
  454. /*
  455. * linux/fs/nfs/write.c
  456. */
  457. extern int nfs_congestion_kb;
  458. extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
  459. extern int nfs_writepages(struct address_space *, struct writeback_control *);
  460. extern int nfs_flush_incompatible(struct file *file, struct page *page);
  461. extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
  462. /*
  463. * Try to write back everything synchronously (but check the
  464. * return value!)
  465. */
  466. extern int nfs_sync_inode(struct inode *inode);
  467. extern int nfs_wb_all(struct inode *inode);
  468. extern int nfs_wb_page(struct inode *inode, struct page *page);
  469. extern int nfs_wb_page_cancel(struct inode *inode, struct page* page);
  470. extern int nfs_commit_inode(struct inode *, int);
  471. extern struct nfs_commit_data *nfs_commitdata_alloc(bool never_fail);
  472. extern void nfs_commit_free(struct nfs_commit_data *data);
  473. static inline int
  474. nfs_have_writebacks(struct inode *inode)
  475. {
  476. return atomic_long_read(&NFS_I(inode)->nrequests) != 0;
  477. }
  478. /*
  479. * linux/fs/nfs/read.c
  480. */
  481. extern int nfs_readpage(struct file *, struct page *);
  482. extern int nfs_readpages(struct file *, struct address_space *,
  483. struct list_head *, unsigned);
  484. extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
  485. struct page *);
  486. /*
  487. * inline functions
  488. */
  489. static inline loff_t nfs_size_to_loff_t(__u64 size)
  490. {
  491. return min_t(u64, size, OFFSET_MAX);
  492. }
  493. static inline ino_t
  494. nfs_fileid_to_ino_t(u64 fileid)
  495. {
  496. ino_t ino = (ino_t) fileid;
  497. if (sizeof(ino_t) < sizeof(u64))
  498. ino ^= fileid >> (sizeof(u64)-sizeof(ino_t)) * 8;
  499. return ino;
  500. }
  501. #define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
  502. # undef ifdebug
  503. # ifdef NFS_DEBUG
  504. # define ifdebug(fac) if (unlikely(nfs_debug & NFSDBG_##fac))
  505. # define NFS_IFDEBUG(x) x
  506. # else
  507. # define ifdebug(fac) if (0)
  508. # define NFS_IFDEBUG(x)
  509. # endif
  510. #endif