host.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /*
  2. * linux/fs/lockd/host.c
  3. *
  4. * Management for NLM peer hosts. The nlm_host struct is shared
  5. * between client and server implementation. The only reason to
  6. * do so is to reduce code bloat.
  7. *
  8. * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  9. */
  10. #include <linux/types.h>
  11. #include <linux/slab.h>
  12. #include <linux/in.h>
  13. #include <linux/in6.h>
  14. #include <linux/sunrpc/clnt.h>
  15. #include <linux/sunrpc/svc.h>
  16. #include <linux/lockd/lockd.h>
  17. #include <linux/mutex.h>
  18. #include <net/ipv6.h>
  19. #define NLMDBG_FACILITY NLMDBG_HOSTCACHE
  20. #define NLM_HOST_NRHASH 32
  21. #define NLM_HOST_REBIND (60 * HZ)
  22. #define NLM_HOST_EXPIRE (300 * HZ)
  23. #define NLM_HOST_COLLECT (120 * HZ)
  24. static struct hlist_head nlm_server_hosts[NLM_HOST_NRHASH];
  25. static struct hlist_head nlm_client_hosts[NLM_HOST_NRHASH];
  26. #define for_each_host(host, pos, chain, table) \
  27. for ((chain) = (table); \
  28. (chain) < (table) + NLM_HOST_NRHASH; ++(chain)) \
  29. hlist_for_each_entry((host), (pos), (chain), h_hash)
  30. #define for_each_host_safe(host, pos, next, chain, table) \
  31. for ((chain) = (table); \
  32. (chain) < (table) + NLM_HOST_NRHASH; ++(chain)) \
  33. hlist_for_each_entry_safe((host), (pos), (next), \
  34. (chain), h_hash)
  35. static unsigned long next_gc;
  36. static unsigned long nrhosts;
  37. static DEFINE_MUTEX(nlm_host_mutex);
  38. static void nlm_gc_hosts(void);
  39. struct nlm_lookup_host_info {
  40. const int server; /* search for server|client */
  41. const struct sockaddr *sap; /* address to search for */
  42. const size_t salen; /* it's length */
  43. const unsigned short protocol; /* transport to search for*/
  44. const u32 version; /* NLM version to search for */
  45. const char *hostname; /* remote's hostname */
  46. const size_t hostname_len; /* it's length */
  47. const struct sockaddr *src_sap; /* our address (optional) */
  48. const size_t src_len; /* it's length */
  49. const int noresvport; /* use non-priv port */
  50. };
  51. /*
  52. * Hash function must work well on big- and little-endian platforms
  53. */
  54. static unsigned int __nlm_hash32(const __be32 n)
  55. {
  56. unsigned int hash = (__force u32)n ^ ((__force u32)n >> 16);
  57. return hash ^ (hash >> 8);
  58. }
  59. static unsigned int __nlm_hash_addr4(const struct sockaddr *sap)
  60. {
  61. const struct sockaddr_in *sin = (struct sockaddr_in *)sap;
  62. return __nlm_hash32(sin->sin_addr.s_addr);
  63. }
  64. static unsigned int __nlm_hash_addr6(const struct sockaddr *sap)
  65. {
  66. const struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
  67. const struct in6_addr addr = sin6->sin6_addr;
  68. return __nlm_hash32(addr.s6_addr32[0]) ^
  69. __nlm_hash32(addr.s6_addr32[1]) ^
  70. __nlm_hash32(addr.s6_addr32[2]) ^
  71. __nlm_hash32(addr.s6_addr32[3]);
  72. }
  73. static unsigned int nlm_hash_address(const struct sockaddr *sap)
  74. {
  75. unsigned int hash;
  76. switch (sap->sa_family) {
  77. case AF_INET:
  78. hash = __nlm_hash_addr4(sap);
  79. break;
  80. case AF_INET6:
  81. hash = __nlm_hash_addr6(sap);
  82. break;
  83. default:
  84. hash = 0;
  85. }
  86. return hash & (NLM_HOST_NRHASH - 1);
  87. }
  88. /*
  89. * Allocate and initialize an nlm_host. Common to both client and server.
  90. */
  91. static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
  92. struct nsm_handle *nsm)
  93. {
  94. struct nlm_host *host = NULL;
  95. unsigned long now = jiffies;
  96. if (nsm != NULL)
  97. atomic_inc(&nsm->sm_count);
  98. else {
  99. host = NULL;
  100. nsm = nsm_get_handle(ni->sap, ni->salen,
  101. ni->hostname, ni->hostname_len);
  102. if (unlikely(nsm == NULL)) {
  103. dprintk("lockd: %s failed; no nsm handle\n",
  104. __func__);
  105. goto out;
  106. }
  107. }
  108. host = kmalloc(sizeof(*host), GFP_KERNEL);
  109. if (unlikely(host == NULL)) {
  110. dprintk("lockd: %s failed; no memory\n", __func__);
  111. nsm_release(nsm);
  112. goto out;
  113. }
  114. memcpy(nlm_addr(host), ni->sap, ni->salen);
  115. host->h_addrlen = ni->salen;
  116. rpc_set_port(nlm_addr(host), 0);
  117. host->h_srcaddrlen = 0;
  118. host->h_rpcclnt = NULL;
  119. host->h_name = nsm->sm_name;
  120. host->h_version = ni->version;
  121. host->h_proto = ni->protocol;
  122. host->h_reclaiming = 0;
  123. host->h_server = ni->server;
  124. host->h_noresvport = ni->noresvport;
  125. host->h_inuse = 0;
  126. init_waitqueue_head(&host->h_gracewait);
  127. init_rwsem(&host->h_rwsem);
  128. host->h_state = 0;
  129. host->h_nsmstate = 0;
  130. host->h_pidcount = 0;
  131. atomic_set(&host->h_count, 1);
  132. mutex_init(&host->h_mutex);
  133. host->h_nextrebind = now + NLM_HOST_REBIND;
  134. host->h_expires = now + NLM_HOST_EXPIRE;
  135. INIT_LIST_HEAD(&host->h_lockowners);
  136. spin_lock_init(&host->h_lock);
  137. INIT_LIST_HEAD(&host->h_granted);
  138. INIT_LIST_HEAD(&host->h_reclaim);
  139. host->h_nsmhandle = nsm;
  140. host->h_addrbuf = nsm->sm_addrbuf;
  141. out:
  142. return host;
  143. }
  144. /*
  145. * Destroy an nlm_host and free associated resources
  146. *
  147. * Caller must hold nlm_host_mutex.
  148. */
  149. static void nlm_destroy_host_locked(struct nlm_host *host)
  150. {
  151. struct rpc_clnt *clnt;
  152. dprintk("lockd: destroy host %s\n", host->h_name);
  153. BUG_ON(!list_empty(&host->h_lockowners));
  154. BUG_ON(atomic_read(&host->h_count));
  155. hlist_del_init(&host->h_hash);
  156. nsm_unmonitor(host);
  157. nsm_release(host->h_nsmhandle);
  158. clnt = host->h_rpcclnt;
  159. if (clnt != NULL)
  160. rpc_shutdown_client(clnt);
  161. kfree(host);
  162. nrhosts--;
  163. }
  164. /**
  165. * nlmclnt_lookup_host - Find an NLM host handle matching a remote server
  166. * @sap: network address of server
  167. * @salen: length of server address
  168. * @protocol: transport protocol to use
  169. * @version: NLM protocol version
  170. * @hostname: '\0'-terminated hostname of server
  171. * @noresvport: 1 if non-privileged port should be used
  172. *
  173. * Returns an nlm_host structure that matches the passed-in
  174. * [server address, transport protocol, NLM version, server hostname].
  175. * If one doesn't already exist in the host cache, a new handle is
  176. * created and returned.
  177. */
  178. struct nlm_host *nlmclnt_lookup_host(const struct sockaddr *sap,
  179. const size_t salen,
  180. const unsigned short protocol,
  181. const u32 version,
  182. const char *hostname,
  183. int noresvport)
  184. {
  185. struct nlm_lookup_host_info ni = {
  186. .server = 0,
  187. .sap = sap,
  188. .salen = salen,
  189. .protocol = protocol,
  190. .version = version,
  191. .hostname = hostname,
  192. .hostname_len = strlen(hostname),
  193. .noresvport = noresvport,
  194. };
  195. struct hlist_head *chain;
  196. struct hlist_node *pos;
  197. struct nlm_host *host;
  198. struct nsm_handle *nsm = NULL;
  199. dprintk("lockd: %s(host='%s', vers=%u, proto=%s)\n", __func__,
  200. (hostname ? hostname : "<none>"), version,
  201. (protocol == IPPROTO_UDP ? "udp" : "tcp"));
  202. mutex_lock(&nlm_host_mutex);
  203. chain = &nlm_client_hosts[nlm_hash_address(sap)];
  204. hlist_for_each_entry(host, pos, chain, h_hash) {
  205. if (!rpc_cmp_addr(nlm_addr(host), sap))
  206. continue;
  207. /* Same address. Share an NSM handle if we already have one */
  208. if (nsm == NULL)
  209. nsm = host->h_nsmhandle;
  210. if (host->h_proto != protocol)
  211. continue;
  212. if (host->h_version != version)
  213. continue;
  214. nlm_get_host(host);
  215. dprintk("lockd: %s found host %s (%s)\n", __func__,
  216. host->h_name, host->h_addrbuf);
  217. goto out;
  218. }
  219. host = nlm_alloc_host(&ni, nsm);
  220. if (unlikely(host == NULL))
  221. goto out;
  222. hlist_add_head(&host->h_hash, chain);
  223. nrhosts++;
  224. dprintk("lockd: %s created host %s (%s)\n", __func__,
  225. host->h_name, host->h_addrbuf);
  226. out:
  227. mutex_unlock(&nlm_host_mutex);
  228. return host;
  229. }
  230. /**
  231. * nlmclnt_release_host - release client nlm_host
  232. * @host: nlm_host to release
  233. *
  234. */
  235. void nlmclnt_release_host(struct nlm_host *host)
  236. {
  237. if (host == NULL)
  238. return;
  239. dprintk("lockd: release client host %s\n", host->h_name);
  240. BUG_ON(atomic_read(&host->h_count) < 0);
  241. BUG_ON(host->h_server);
  242. if (atomic_dec_and_test(&host->h_count)) {
  243. BUG_ON(!list_empty(&host->h_lockowners));
  244. BUG_ON(!list_empty(&host->h_granted));
  245. BUG_ON(!list_empty(&host->h_reclaim));
  246. mutex_lock(&nlm_host_mutex);
  247. nlm_destroy_host_locked(host);
  248. mutex_unlock(&nlm_host_mutex);
  249. }
  250. }
  251. /**
  252. * nlmsvc_lookup_host - Find an NLM host handle matching a remote client
  253. * @rqstp: incoming NLM request
  254. * @hostname: name of client host
  255. * @hostname_len: length of client hostname
  256. *
  257. * Returns an nlm_host structure that matches the [client address,
  258. * transport protocol, NLM version, client hostname] of the passed-in
  259. * NLM request. If one doesn't already exist in the host cache, a
  260. * new handle is created and returned.
  261. *
  262. * Before possibly creating a new nlm_host, construct a sockaddr
  263. * for a specific source address in case the local system has
  264. * multiple network addresses. The family of the address in
  265. * rq_daddr is guaranteed to be the same as the family of the
  266. * address in rq_addr, so it's safe to use the same family for
  267. * the source address.
  268. */
  269. struct nlm_host *nlmsvc_lookup_host(const struct svc_rqst *rqstp,
  270. const char *hostname,
  271. const size_t hostname_len)
  272. {
  273. struct hlist_head *chain;
  274. struct hlist_node *pos;
  275. struct nlm_host *host = NULL;
  276. struct nsm_handle *nsm = NULL;
  277. struct sockaddr_in sin = {
  278. .sin_family = AF_INET,
  279. };
  280. struct sockaddr_in6 sin6 = {
  281. .sin6_family = AF_INET6,
  282. };
  283. struct nlm_lookup_host_info ni = {
  284. .server = 1,
  285. .sap = svc_addr(rqstp),
  286. .salen = rqstp->rq_addrlen,
  287. .protocol = rqstp->rq_prot,
  288. .version = rqstp->rq_vers,
  289. .hostname = hostname,
  290. .hostname_len = hostname_len,
  291. .src_len = rqstp->rq_addrlen,
  292. };
  293. dprintk("lockd: %s(host='%*s', vers=%u, proto=%s)\n", __func__,
  294. (int)hostname_len, hostname, rqstp->rq_vers,
  295. (rqstp->rq_prot == IPPROTO_UDP ? "udp" : "tcp"));
  296. mutex_lock(&nlm_host_mutex);
  297. switch (ni.sap->sa_family) {
  298. case AF_INET:
  299. sin.sin_addr.s_addr = rqstp->rq_daddr.addr.s_addr;
  300. ni.src_sap = (struct sockaddr *)&sin;
  301. break;
  302. case AF_INET6:
  303. ipv6_addr_copy(&sin6.sin6_addr, &rqstp->rq_daddr.addr6);
  304. ni.src_sap = (struct sockaddr *)&sin6;
  305. break;
  306. default:
  307. dprintk("lockd: %s failed; unrecognized address family\n",
  308. __func__);
  309. goto out;
  310. }
  311. if (time_after_eq(jiffies, next_gc))
  312. nlm_gc_hosts();
  313. chain = &nlm_server_hosts[nlm_hash_address(ni.sap)];
  314. hlist_for_each_entry(host, pos, chain, h_hash) {
  315. if (!rpc_cmp_addr(nlm_addr(host), ni.sap))
  316. continue;
  317. /* Same address. Share an NSM handle if we already have one */
  318. if (nsm == NULL)
  319. nsm = host->h_nsmhandle;
  320. if (host->h_proto != ni.protocol)
  321. continue;
  322. if (host->h_version != ni.version)
  323. continue;
  324. if (!rpc_cmp_addr(nlm_srcaddr(host), ni.src_sap))
  325. continue;
  326. /* Move to head of hash chain. */
  327. hlist_del(&host->h_hash);
  328. hlist_add_head(&host->h_hash, chain);
  329. nlm_get_host(host);
  330. dprintk("lockd: %s found host %s (%s)\n",
  331. __func__, host->h_name, host->h_addrbuf);
  332. goto out;
  333. }
  334. host = nlm_alloc_host(&ni, nsm);
  335. if (unlikely(host == NULL))
  336. goto out;
  337. memcpy(nlm_srcaddr(host), ni.src_sap, ni.src_len);
  338. host->h_srcaddrlen = ni.src_len;
  339. hlist_add_head(&host->h_hash, chain);
  340. nrhosts++;
  341. dprintk("lockd: %s created host %s (%s)\n",
  342. __func__, host->h_name, host->h_addrbuf);
  343. out:
  344. mutex_unlock(&nlm_host_mutex);
  345. return host;
  346. }
  347. /**
  348. * nlmsvc_release_host - release server nlm_host
  349. * @host: nlm_host to release
  350. *
  351. * Host is destroyed later in nlm_gc_host().
  352. */
  353. void nlmsvc_release_host(struct nlm_host *host)
  354. {
  355. if (host == NULL)
  356. return;
  357. dprintk("lockd: release server host %s\n", host->h_name);
  358. BUG_ON(atomic_read(&host->h_count) < 0);
  359. BUG_ON(!host->h_server);
  360. atomic_dec(&host->h_count);
  361. }
  362. /*
  363. * Create the NLM RPC client for an NLM peer
  364. */
  365. struct rpc_clnt *
  366. nlm_bind_host(struct nlm_host *host)
  367. {
  368. struct rpc_clnt *clnt;
  369. dprintk("lockd: nlm_bind_host %s (%s)\n",
  370. host->h_name, host->h_addrbuf);
  371. /* Lock host handle */
  372. mutex_lock(&host->h_mutex);
  373. /* If we've already created an RPC client, check whether
  374. * RPC rebind is required
  375. */
  376. if ((clnt = host->h_rpcclnt) != NULL) {
  377. if (time_after_eq(jiffies, host->h_nextrebind)) {
  378. rpc_force_rebind(clnt);
  379. host->h_nextrebind = jiffies + NLM_HOST_REBIND;
  380. dprintk("lockd: next rebind in %lu jiffies\n",
  381. host->h_nextrebind - jiffies);
  382. }
  383. } else {
  384. unsigned long increment = nlmsvc_timeout;
  385. struct rpc_timeout timeparms = {
  386. .to_initval = increment,
  387. .to_increment = increment,
  388. .to_maxval = increment * 6UL,
  389. .to_retries = 5U,
  390. };
  391. struct rpc_create_args args = {
  392. .net = &init_net,
  393. .protocol = host->h_proto,
  394. .address = nlm_addr(host),
  395. .addrsize = host->h_addrlen,
  396. .timeout = &timeparms,
  397. .servername = host->h_name,
  398. .program = &nlm_program,
  399. .version = host->h_version,
  400. .authflavor = RPC_AUTH_UNIX,
  401. .flags = (RPC_CLNT_CREATE_NOPING |
  402. RPC_CLNT_CREATE_AUTOBIND),
  403. };
  404. /*
  405. * lockd retries server side blocks automatically so we want
  406. * those to be soft RPC calls. Client side calls need to be
  407. * hard RPC tasks.
  408. */
  409. if (!host->h_server)
  410. args.flags |= RPC_CLNT_CREATE_HARDRTRY;
  411. if (host->h_noresvport)
  412. args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
  413. if (host->h_srcaddrlen)
  414. args.saddress = nlm_srcaddr(host);
  415. clnt = rpc_create(&args);
  416. if (!IS_ERR(clnt))
  417. host->h_rpcclnt = clnt;
  418. else {
  419. printk("lockd: couldn't create RPC handle for %s\n", host->h_name);
  420. clnt = NULL;
  421. }
  422. }
  423. mutex_unlock(&host->h_mutex);
  424. return clnt;
  425. }
  426. /*
  427. * Force a portmap lookup of the remote lockd port
  428. */
  429. void
  430. nlm_rebind_host(struct nlm_host *host)
  431. {
  432. dprintk("lockd: rebind host %s\n", host->h_name);
  433. if (host->h_rpcclnt && time_after_eq(jiffies, host->h_nextrebind)) {
  434. rpc_force_rebind(host->h_rpcclnt);
  435. host->h_nextrebind = jiffies + NLM_HOST_REBIND;
  436. }
  437. }
  438. /*
  439. * Increment NLM host count
  440. */
  441. struct nlm_host * nlm_get_host(struct nlm_host *host)
  442. {
  443. if (host) {
  444. dprintk("lockd: get host %s\n", host->h_name);
  445. atomic_inc(&host->h_count);
  446. host->h_expires = jiffies + NLM_HOST_EXPIRE;
  447. }
  448. return host;
  449. }
  450. static struct nlm_host *next_host_state(struct hlist_head *cache,
  451. struct nsm_handle *nsm,
  452. const struct nlm_reboot *info)
  453. {
  454. struct nlm_host *host = NULL;
  455. struct hlist_head *chain;
  456. struct hlist_node *pos;
  457. mutex_lock(&nlm_host_mutex);
  458. for_each_host(host, pos, chain, cache) {
  459. if (host->h_nsmhandle == nsm
  460. && host->h_nsmstate != info->state) {
  461. host->h_nsmstate = info->state;
  462. host->h_state++;
  463. nlm_get_host(host);
  464. mutex_unlock(&nlm_host_mutex);
  465. goto out;
  466. }
  467. }
  468. out:
  469. mutex_unlock(&nlm_host_mutex);
  470. return host;
  471. }
  472. /**
  473. * nlm_host_rebooted - Release all resources held by rebooted host
  474. * @info: pointer to decoded results of NLM_SM_NOTIFY call
  475. *
  476. * We were notified that the specified host has rebooted. Release
  477. * all resources held by that peer.
  478. */
  479. void nlm_host_rebooted(const struct nlm_reboot *info)
  480. {
  481. struct nsm_handle *nsm;
  482. struct nlm_host *host;
  483. nsm = nsm_reboot_lookup(info);
  484. if (unlikely(nsm == NULL))
  485. return;
  486. /* Mark all hosts tied to this NSM state as having rebooted.
  487. * We run the loop repeatedly, because we drop the host table
  488. * lock for this.
  489. * To avoid processing a host several times, we match the nsmstate.
  490. */
  491. while ((host = next_host_state(nlm_server_hosts, nsm, info)) != NULL) {
  492. nlmsvc_free_host_resources(host);
  493. nlmsvc_release_host(host);
  494. }
  495. while ((host = next_host_state(nlm_client_hosts, nsm, info)) != NULL) {
  496. nlmclnt_recovery(host);
  497. nlmclnt_release_host(host);
  498. }
  499. nsm_release(nsm);
  500. }
  501. /*
  502. * Shut down the hosts module.
  503. * Note that this routine is called only at server shutdown time.
  504. */
  505. void
  506. nlm_shutdown_hosts(void)
  507. {
  508. struct hlist_head *chain;
  509. struct hlist_node *pos;
  510. struct nlm_host *host;
  511. dprintk("lockd: shutting down host module\n");
  512. mutex_lock(&nlm_host_mutex);
  513. /* First, make all hosts eligible for gc */
  514. dprintk("lockd: nuking all hosts...\n");
  515. for_each_host(host, pos, chain, nlm_server_hosts) {
  516. host->h_expires = jiffies - 1;
  517. if (host->h_rpcclnt) {
  518. rpc_shutdown_client(host->h_rpcclnt);
  519. host->h_rpcclnt = NULL;
  520. }
  521. }
  522. /* Then, perform a garbage collection pass */
  523. nlm_gc_hosts();
  524. mutex_unlock(&nlm_host_mutex);
  525. /* complain if any hosts are left */
  526. if (nrhosts != 0) {
  527. printk(KERN_WARNING "lockd: couldn't shutdown host module!\n");
  528. dprintk("lockd: %lu hosts left:\n", nrhosts);
  529. for_each_host(host, pos, chain, nlm_server_hosts) {
  530. dprintk(" %s (cnt %d use %d exp %ld)\n",
  531. host->h_name, atomic_read(&host->h_count),
  532. host->h_inuse, host->h_expires);
  533. }
  534. }
  535. }
  536. /*
  537. * Garbage collect any unused NLM hosts.
  538. * This GC combines reference counting for async operations with
  539. * mark & sweep for resources held by remote clients.
  540. */
  541. static void
  542. nlm_gc_hosts(void)
  543. {
  544. struct hlist_head *chain;
  545. struct hlist_node *pos, *next;
  546. struct nlm_host *host;
  547. dprintk("lockd: host garbage collection\n");
  548. for_each_host(host, pos, chain, nlm_server_hosts)
  549. host->h_inuse = 0;
  550. /* Mark all hosts that hold locks, blocks or shares */
  551. nlmsvc_mark_resources();
  552. for_each_host_safe(host, pos, next, chain, nlm_server_hosts) {
  553. if (atomic_read(&host->h_count) || host->h_inuse
  554. || time_before(jiffies, host->h_expires)) {
  555. dprintk("nlm_gc_hosts skipping %s "
  556. "(cnt %d use %d exp %ld)\n",
  557. host->h_name, atomic_read(&host->h_count),
  558. host->h_inuse, host->h_expires);
  559. continue;
  560. }
  561. nlm_destroy_host_locked(host);
  562. }
  563. next_gc = jiffies + NLM_HOST_COLLECT;
  564. }