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