nfscache.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Request reply cache. This is currently a global cache, but this may
  4. * change in the future and be a per-client cache.
  5. *
  6. * This code is heavily inspired by the 44BSD implementation, although
  7. * it does things a bit differently.
  8. *
  9. * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  10. */
  11. #include <linux/sunrpc/svc_xprt.h>
  12. #include <linux/slab.h>
  13. #include <linux/vmalloc.h>
  14. #include <linux/sunrpc/addr.h>
  15. #include <linux/highmem.h>
  16. #include <linux/log2.h>
  17. #include <linux/hash.h>
  18. #include <net/checksum.h>
  19. #include "nfsd.h"
  20. #include "cache.h"
  21. #include "trace.h"
  22. /*
  23. * We use this value to determine the number of hash buckets from the max
  24. * cache size, the idea being that when the cache is at its maximum number
  25. * of entries, then this should be the average number of entries per bucket.
  26. */
  27. #define TARGET_BUCKET_SIZE 64
  28. struct nfsd_drc_bucket {
  29. struct rb_root rb_head;
  30. struct list_head lru_head;
  31. spinlock_t cache_lock;
  32. };
  33. static struct kmem_cache *drc_slab;
  34. static int nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *vec);
  35. static unsigned long nfsd_reply_cache_count(struct shrinker *shrink,
  36. struct shrink_control *sc);
  37. static unsigned long nfsd_reply_cache_scan(struct shrinker *shrink,
  38. struct shrink_control *sc);
  39. /*
  40. * Put a cap on the size of the DRC based on the amount of available
  41. * low memory in the machine.
  42. *
  43. * 64MB: 8192
  44. * 128MB: 11585
  45. * 256MB: 16384
  46. * 512MB: 23170
  47. * 1GB: 32768
  48. * 2GB: 46340
  49. * 4GB: 65536
  50. * 8GB: 92681
  51. * 16GB: 131072
  52. *
  53. * ...with a hard cap of 256k entries. In the worst case, each entry will be
  54. * ~1k, so the above numbers should give a rough max of the amount of memory
  55. * used in k.
  56. *
  57. * XXX: these limits are per-container, so memory used will increase
  58. * linearly with number of containers. Maybe that's OK.
  59. */
  60. static unsigned int
  61. nfsd_cache_size_limit(void)
  62. {
  63. unsigned int limit;
  64. unsigned long low_pages = totalram_pages() - totalhigh_pages();
  65. limit = (16 * int_sqrt(low_pages)) << (PAGE_SHIFT-10);
  66. return min_t(unsigned int, limit, 256*1024);
  67. }
  68. /*
  69. * Compute the number of hash buckets we need. Divide the max cachesize by
  70. * the "target" max bucket size, and round up to next power of two.
  71. */
  72. static unsigned int
  73. nfsd_hashsize(unsigned int limit)
  74. {
  75. return roundup_pow_of_two(limit / TARGET_BUCKET_SIZE);
  76. }
  77. static u32
  78. nfsd_cache_hash(__be32 xid, struct nfsd_net *nn)
  79. {
  80. return hash_32(be32_to_cpu(xid), nn->maskbits);
  81. }
  82. static struct svc_cacherep *
  83. nfsd_reply_cache_alloc(struct svc_rqst *rqstp, __wsum csum,
  84. struct nfsd_net *nn)
  85. {
  86. struct svc_cacherep *rp;
  87. rp = kmem_cache_alloc(drc_slab, GFP_KERNEL);
  88. if (rp) {
  89. rp->c_state = RC_UNUSED;
  90. rp->c_type = RC_NOCACHE;
  91. RB_CLEAR_NODE(&rp->c_node);
  92. INIT_LIST_HEAD(&rp->c_lru);
  93. memset(&rp->c_key, 0, sizeof(rp->c_key));
  94. rp->c_key.k_xid = rqstp->rq_xid;
  95. rp->c_key.k_proc = rqstp->rq_proc;
  96. rpc_copy_addr((struct sockaddr *)&rp->c_key.k_addr, svc_addr(rqstp));
  97. rpc_set_port((struct sockaddr *)&rp->c_key.k_addr, rpc_get_port(svc_addr(rqstp)));
  98. rp->c_key.k_prot = rqstp->rq_prot;
  99. rp->c_key.k_vers = rqstp->rq_vers;
  100. rp->c_key.k_len = rqstp->rq_arg.len;
  101. rp->c_key.k_csum = csum;
  102. }
  103. return rp;
  104. }
  105. static void
  106. nfsd_reply_cache_free_locked(struct nfsd_drc_bucket *b, struct svc_cacherep *rp,
  107. struct nfsd_net *nn)
  108. {
  109. if (rp->c_type == RC_REPLBUFF && rp->c_replvec.iov_base) {
  110. nn->drc_mem_usage -= rp->c_replvec.iov_len;
  111. kfree(rp->c_replvec.iov_base);
  112. }
  113. if (rp->c_state != RC_UNUSED) {
  114. rb_erase(&rp->c_node, &b->rb_head);
  115. list_del(&rp->c_lru);
  116. atomic_dec(&nn->num_drc_entries);
  117. nn->drc_mem_usage -= sizeof(*rp);
  118. }
  119. kmem_cache_free(drc_slab, rp);
  120. }
  121. static void
  122. nfsd_reply_cache_free(struct nfsd_drc_bucket *b, struct svc_cacherep *rp,
  123. struct nfsd_net *nn)
  124. {
  125. spin_lock(&b->cache_lock);
  126. nfsd_reply_cache_free_locked(b, rp, nn);
  127. spin_unlock(&b->cache_lock);
  128. }
  129. int nfsd_drc_slab_create(void)
  130. {
  131. drc_slab = kmem_cache_create("nfsd_drc",
  132. sizeof(struct svc_cacherep), 0, 0, NULL);
  133. return drc_slab ? 0: -ENOMEM;
  134. }
  135. void nfsd_drc_slab_free(void)
  136. {
  137. kmem_cache_destroy(drc_slab);
  138. }
  139. int nfsd_reply_cache_init(struct nfsd_net *nn)
  140. {
  141. unsigned int hashsize;
  142. unsigned int i;
  143. int status = 0;
  144. nn->max_drc_entries = nfsd_cache_size_limit();
  145. atomic_set(&nn->num_drc_entries, 0);
  146. hashsize = nfsd_hashsize(nn->max_drc_entries);
  147. nn->maskbits = ilog2(hashsize);
  148. nn->nfsd_reply_cache_shrinker.scan_objects = nfsd_reply_cache_scan;
  149. nn->nfsd_reply_cache_shrinker.count_objects = nfsd_reply_cache_count;
  150. nn->nfsd_reply_cache_shrinker.seeks = 1;
  151. status = register_shrinker(&nn->nfsd_reply_cache_shrinker);
  152. if (status)
  153. goto out_nomem;
  154. nn->drc_hashtbl = kvzalloc(array_size(hashsize,
  155. sizeof(*nn->drc_hashtbl)), GFP_KERNEL);
  156. if (!nn->drc_hashtbl)
  157. goto out_shrinker;
  158. for (i = 0; i < hashsize; i++) {
  159. INIT_LIST_HEAD(&nn->drc_hashtbl[i].lru_head);
  160. spin_lock_init(&nn->drc_hashtbl[i].cache_lock);
  161. }
  162. nn->drc_hashsize = hashsize;
  163. return 0;
  164. out_shrinker:
  165. unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
  166. out_nomem:
  167. printk(KERN_ERR "nfsd: failed to allocate reply cache\n");
  168. return -ENOMEM;
  169. }
  170. void nfsd_reply_cache_shutdown(struct nfsd_net *nn)
  171. {
  172. struct svc_cacherep *rp;
  173. unsigned int i;
  174. unregister_shrinker(&nn->nfsd_reply_cache_shrinker);
  175. for (i = 0; i < nn->drc_hashsize; i++) {
  176. struct list_head *head = &nn->drc_hashtbl[i].lru_head;
  177. while (!list_empty(head)) {
  178. rp = list_first_entry(head, struct svc_cacherep, c_lru);
  179. nfsd_reply_cache_free_locked(&nn->drc_hashtbl[i],
  180. rp, nn);
  181. }
  182. }
  183. kvfree(nn->drc_hashtbl);
  184. nn->drc_hashtbl = NULL;
  185. nn->drc_hashsize = 0;
  186. }
  187. /*
  188. * Move cache entry to end of LRU list, and queue the cleaner to run if it's
  189. * not already scheduled.
  190. */
  191. static void
  192. lru_put_end(struct nfsd_drc_bucket *b, struct svc_cacherep *rp)
  193. {
  194. rp->c_timestamp = jiffies;
  195. list_move_tail(&rp->c_lru, &b->lru_head);
  196. }
  197. static long
  198. prune_bucket(struct nfsd_drc_bucket *b, struct nfsd_net *nn)
  199. {
  200. struct svc_cacherep *rp, *tmp;
  201. long freed = 0;
  202. list_for_each_entry_safe(rp, tmp, &b->lru_head, c_lru) {
  203. /*
  204. * Don't free entries attached to calls that are still
  205. * in-progress, but do keep scanning the list.
  206. */
  207. if (rp->c_state == RC_INPROG)
  208. continue;
  209. if (atomic_read(&nn->num_drc_entries) <= nn->max_drc_entries &&
  210. time_before(jiffies, rp->c_timestamp + RC_EXPIRE))
  211. break;
  212. nfsd_reply_cache_free_locked(b, rp, nn);
  213. freed++;
  214. }
  215. return freed;
  216. }
  217. /*
  218. * Walk the LRU list and prune off entries that are older than RC_EXPIRE.
  219. * Also prune the oldest ones when the total exceeds the max number of entries.
  220. */
  221. static long
  222. prune_cache_entries(struct nfsd_net *nn)
  223. {
  224. unsigned int i;
  225. long freed = 0;
  226. for (i = 0; i < nn->drc_hashsize; i++) {
  227. struct nfsd_drc_bucket *b = &nn->drc_hashtbl[i];
  228. if (list_empty(&b->lru_head))
  229. continue;
  230. spin_lock(&b->cache_lock);
  231. freed += prune_bucket(b, nn);
  232. spin_unlock(&b->cache_lock);
  233. }
  234. return freed;
  235. }
  236. static unsigned long
  237. nfsd_reply_cache_count(struct shrinker *shrink, struct shrink_control *sc)
  238. {
  239. struct nfsd_net *nn = container_of(shrink,
  240. struct nfsd_net, nfsd_reply_cache_shrinker);
  241. return atomic_read(&nn->num_drc_entries);
  242. }
  243. static unsigned long
  244. nfsd_reply_cache_scan(struct shrinker *shrink, struct shrink_control *sc)
  245. {
  246. struct nfsd_net *nn = container_of(shrink,
  247. struct nfsd_net, nfsd_reply_cache_shrinker);
  248. return prune_cache_entries(nn);
  249. }
  250. /*
  251. * Walk an xdr_buf and get a CRC for at most the first RC_CSUMLEN bytes
  252. */
  253. static __wsum
  254. nfsd_cache_csum(struct svc_rqst *rqstp)
  255. {
  256. int idx;
  257. unsigned int base;
  258. __wsum csum;
  259. struct xdr_buf *buf = &rqstp->rq_arg;
  260. const unsigned char *p = buf->head[0].iov_base;
  261. size_t csum_len = min_t(size_t, buf->head[0].iov_len + buf->page_len,
  262. RC_CSUMLEN);
  263. size_t len = min(buf->head[0].iov_len, csum_len);
  264. /* rq_arg.head first */
  265. csum = csum_partial(p, len, 0);
  266. csum_len -= len;
  267. /* Continue into page array */
  268. idx = buf->page_base / PAGE_SIZE;
  269. base = buf->page_base & ~PAGE_MASK;
  270. while (csum_len) {
  271. p = page_address(buf->pages[idx]) + base;
  272. len = min_t(size_t, PAGE_SIZE - base, csum_len);
  273. csum = csum_partial(p, len, csum);
  274. csum_len -= len;
  275. base = 0;
  276. ++idx;
  277. }
  278. return csum;
  279. }
  280. static int
  281. nfsd_cache_key_cmp(const struct svc_cacherep *key,
  282. const struct svc_cacherep *rp, struct nfsd_net *nn)
  283. {
  284. if (key->c_key.k_xid == rp->c_key.k_xid &&
  285. key->c_key.k_csum != rp->c_key.k_csum) {
  286. ++nn->payload_misses;
  287. trace_nfsd_drc_mismatch(nn, key, rp);
  288. }
  289. return memcmp(&key->c_key, &rp->c_key, sizeof(key->c_key));
  290. }
  291. /*
  292. * Search the request hash for an entry that matches the given rqstp.
  293. * Must be called with cache_lock held. Returns the found entry or
  294. * inserts an empty key on failure.
  295. */
  296. static struct svc_cacherep *
  297. nfsd_cache_insert(struct nfsd_drc_bucket *b, struct svc_cacherep *key,
  298. struct nfsd_net *nn)
  299. {
  300. struct svc_cacherep *rp, *ret = key;
  301. struct rb_node **p = &b->rb_head.rb_node,
  302. *parent = NULL;
  303. unsigned int entries = 0;
  304. int cmp;
  305. while (*p != NULL) {
  306. ++entries;
  307. parent = *p;
  308. rp = rb_entry(parent, struct svc_cacherep, c_node);
  309. cmp = nfsd_cache_key_cmp(key, rp, nn);
  310. if (cmp < 0)
  311. p = &parent->rb_left;
  312. else if (cmp > 0)
  313. p = &parent->rb_right;
  314. else {
  315. ret = rp;
  316. goto out;
  317. }
  318. }
  319. rb_link_node(&key->c_node, parent, p);
  320. rb_insert_color(&key->c_node, &b->rb_head);
  321. out:
  322. /* tally hash chain length stats */
  323. if (entries > nn->longest_chain) {
  324. nn->longest_chain = entries;
  325. nn->longest_chain_cachesize = atomic_read(&nn->num_drc_entries);
  326. } else if (entries == nn->longest_chain) {
  327. /* prefer to keep the smallest cachesize possible here */
  328. nn->longest_chain_cachesize = min_t(unsigned int,
  329. nn->longest_chain_cachesize,
  330. atomic_read(&nn->num_drc_entries));
  331. }
  332. lru_put_end(b, ret);
  333. return ret;
  334. }
  335. /**
  336. * nfsd_cache_lookup - Find an entry in the duplicate reply cache
  337. * @rqstp: Incoming Call to find
  338. *
  339. * Try to find an entry matching the current call in the cache. When none
  340. * is found, we try to grab the oldest expired entry off the LRU list. If
  341. * a suitable one isn't there, then drop the cache_lock and allocate a
  342. * new one, then search again in case one got inserted while this thread
  343. * didn't hold the lock.
  344. *
  345. * Return values:
  346. * %RC_DOIT: Process the request normally
  347. * %RC_REPLY: Reply from cache
  348. * %RC_DROPIT: Do not process the request further
  349. */
  350. int nfsd_cache_lookup(struct svc_rqst *rqstp)
  351. {
  352. struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
  353. struct svc_cacherep *rp, *found;
  354. __be32 xid = rqstp->rq_xid;
  355. __wsum csum;
  356. u32 hash = nfsd_cache_hash(xid, nn);
  357. struct nfsd_drc_bucket *b = &nn->drc_hashtbl[hash];
  358. int type = rqstp->rq_cachetype;
  359. int rtn = RC_DOIT;
  360. rqstp->rq_cacherep = NULL;
  361. if (type == RC_NOCACHE) {
  362. nfsdstats.rcnocache++;
  363. goto out;
  364. }
  365. csum = nfsd_cache_csum(rqstp);
  366. /*
  367. * Since the common case is a cache miss followed by an insert,
  368. * preallocate an entry.
  369. */
  370. rp = nfsd_reply_cache_alloc(rqstp, csum, nn);
  371. if (!rp)
  372. goto out;
  373. spin_lock(&b->cache_lock);
  374. found = nfsd_cache_insert(b, rp, nn);
  375. if (found != rp) {
  376. nfsd_reply_cache_free_locked(NULL, rp, nn);
  377. rp = found;
  378. goto found_entry;
  379. }
  380. nfsdstats.rcmisses++;
  381. rqstp->rq_cacherep = rp;
  382. rp->c_state = RC_INPROG;
  383. atomic_inc(&nn->num_drc_entries);
  384. nn->drc_mem_usage += sizeof(*rp);
  385. /* go ahead and prune the cache */
  386. prune_bucket(b, nn);
  387. out_unlock:
  388. spin_unlock(&b->cache_lock);
  389. out:
  390. return rtn;
  391. found_entry:
  392. /* We found a matching entry which is either in progress or done. */
  393. nfsdstats.rchits++;
  394. rtn = RC_DROPIT;
  395. /* Request being processed */
  396. if (rp->c_state == RC_INPROG)
  397. goto out_trace;
  398. /* From the hall of fame of impractical attacks:
  399. * Is this a user who tries to snoop on the cache? */
  400. rtn = RC_DOIT;
  401. if (!test_bit(RQ_SECURE, &rqstp->rq_flags) && rp->c_secure)
  402. goto out_trace;
  403. /* Compose RPC reply header */
  404. switch (rp->c_type) {
  405. case RC_NOCACHE:
  406. break;
  407. case RC_REPLSTAT:
  408. svc_putu32(&rqstp->rq_res.head[0], rp->c_replstat);
  409. rtn = RC_REPLY;
  410. break;
  411. case RC_REPLBUFF:
  412. if (!nfsd_cache_append(rqstp, &rp->c_replvec))
  413. goto out_unlock; /* should not happen */
  414. rtn = RC_REPLY;
  415. break;
  416. default:
  417. WARN_ONCE(1, "nfsd: bad repcache type %d\n", rp->c_type);
  418. }
  419. out_trace:
  420. trace_nfsd_drc_found(nn, rqstp, rtn);
  421. goto out_unlock;
  422. }
  423. /**
  424. * nfsd_cache_update - Update an entry in the duplicate reply cache.
  425. * @rqstp: svc_rqst with a finished Reply
  426. * @cachetype: which cache to update
  427. * @statp: Reply's status code
  428. *
  429. * This is called from nfsd_dispatch when the procedure has been
  430. * executed and the complete reply is in rqstp->rq_res.
  431. *
  432. * We're copying around data here rather than swapping buffers because
  433. * the toplevel loop requires max-sized buffers, which would be a waste
  434. * of memory for a cache with a max reply size of 100 bytes (diropokres).
  435. *
  436. * If we should start to use different types of cache entries tailored
  437. * specifically for attrstat and fh's, we may save even more space.
  438. *
  439. * Also note that a cachetype of RC_NOCACHE can legally be passed when
  440. * nfsd failed to encode a reply that otherwise would have been cached.
  441. * In this case, nfsd_cache_update is called with statp == NULL.
  442. */
  443. void nfsd_cache_update(struct svc_rqst *rqstp, int cachetype, __be32 *statp)
  444. {
  445. struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
  446. struct svc_cacherep *rp = rqstp->rq_cacherep;
  447. struct kvec *resv = &rqstp->rq_res.head[0], *cachv;
  448. u32 hash;
  449. struct nfsd_drc_bucket *b;
  450. int len;
  451. size_t bufsize = 0;
  452. if (!rp)
  453. return;
  454. hash = nfsd_cache_hash(rp->c_key.k_xid, nn);
  455. b = &nn->drc_hashtbl[hash];
  456. len = resv->iov_len - ((char*)statp - (char*)resv->iov_base);
  457. len >>= 2;
  458. /* Don't cache excessive amounts of data and XDR failures */
  459. if (!statp || len > (256 >> 2)) {
  460. nfsd_reply_cache_free(b, rp, nn);
  461. return;
  462. }
  463. switch (cachetype) {
  464. case RC_REPLSTAT:
  465. if (len != 1)
  466. printk("nfsd: RC_REPLSTAT/reply len %d!\n",len);
  467. rp->c_replstat = *statp;
  468. break;
  469. case RC_REPLBUFF:
  470. cachv = &rp->c_replvec;
  471. bufsize = len << 2;
  472. cachv->iov_base = kmalloc(bufsize, GFP_KERNEL);
  473. if (!cachv->iov_base) {
  474. nfsd_reply_cache_free(b, rp, nn);
  475. return;
  476. }
  477. cachv->iov_len = bufsize;
  478. memcpy(cachv->iov_base, statp, bufsize);
  479. break;
  480. case RC_NOCACHE:
  481. nfsd_reply_cache_free(b, rp, nn);
  482. return;
  483. }
  484. spin_lock(&b->cache_lock);
  485. nn->drc_mem_usage += bufsize;
  486. lru_put_end(b, rp);
  487. rp->c_secure = test_bit(RQ_SECURE, &rqstp->rq_flags);
  488. rp->c_type = cachetype;
  489. rp->c_state = RC_DONE;
  490. spin_unlock(&b->cache_lock);
  491. return;
  492. }
  493. /*
  494. * Copy cached reply to current reply buffer. Should always fit.
  495. * FIXME as reply is in a page, we should just attach the page, and
  496. * keep a refcount....
  497. */
  498. static int
  499. nfsd_cache_append(struct svc_rqst *rqstp, struct kvec *data)
  500. {
  501. struct kvec *vec = &rqstp->rq_res.head[0];
  502. if (vec->iov_len + data->iov_len > PAGE_SIZE) {
  503. printk(KERN_WARNING "nfsd: cached reply too large (%zd).\n",
  504. data->iov_len);
  505. return 0;
  506. }
  507. memcpy((char*)vec->iov_base + vec->iov_len, data->iov_base, data->iov_len);
  508. vec->iov_len += data->iov_len;
  509. return 1;
  510. }
  511. /*
  512. * Note that fields may be added, removed or reordered in the future. Programs
  513. * scraping this file for info should test the labels to ensure they're
  514. * getting the correct field.
  515. */
  516. static int nfsd_reply_cache_stats_show(struct seq_file *m, void *v)
  517. {
  518. struct nfsd_net *nn = m->private;
  519. seq_printf(m, "max entries: %u\n", nn->max_drc_entries);
  520. seq_printf(m, "num entries: %u\n",
  521. atomic_read(&nn->num_drc_entries));
  522. seq_printf(m, "hash buckets: %u\n", 1 << nn->maskbits);
  523. seq_printf(m, "mem usage: %u\n", nn->drc_mem_usage);
  524. seq_printf(m, "cache hits: %u\n", nfsdstats.rchits);
  525. seq_printf(m, "cache misses: %u\n", nfsdstats.rcmisses);
  526. seq_printf(m, "not cached: %u\n", nfsdstats.rcnocache);
  527. seq_printf(m, "payload misses: %u\n", nn->payload_misses);
  528. seq_printf(m, "longest chain len: %u\n", nn->longest_chain);
  529. seq_printf(m, "cachesize at longest: %u\n", nn->longest_chain_cachesize);
  530. return 0;
  531. }
  532. int nfsd_reply_cache_stats_open(struct inode *inode, struct file *file)
  533. {
  534. struct nfsd_net *nn = net_generic(file_inode(file)->i_sb->s_fs_info,
  535. nfsd_net_id);
  536. return single_open(file, nfsd_reply_cache_stats_show, nn);
  537. }