svc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. /*
  2. * linux/fs/lockd/svc.c
  3. *
  4. * This is the central lockd service.
  5. *
  6. * FIXME: Separate the lockd NFS server functionality from the lockd NFS
  7. * client functionality. Oh why didn't Sun create two separate
  8. * services in the first place?
  9. *
  10. * Authors: Olaf Kirch (okir@monad.swb.de)
  11. *
  12. * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  13. */
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/sysctl.h>
  17. #include <linux/moduleparam.h>
  18. #include <linux/sched.h>
  19. #include <linux/errno.h>
  20. #include <linux/in.h>
  21. #include <linux/uio.h>
  22. #include <linux/smp.h>
  23. #include <linux/mutex.h>
  24. #include <linux/kthread.h>
  25. #include <linux/freezer.h>
  26. #include <linux/sunrpc/types.h>
  27. #include <linux/sunrpc/stats.h>
  28. #include <linux/sunrpc/clnt.h>
  29. #include <linux/sunrpc/svc.h>
  30. #include <linux/sunrpc/svcsock.h>
  31. #include <net/ip.h>
  32. #include <linux/lockd/lockd.h>
  33. #include <linux/nfs.h>
  34. #include "netns.h"
  35. #define NLMDBG_FACILITY NLMDBG_SVC
  36. #define LOCKD_BUFSIZE (1024 + NLMSVC_XDRSIZE)
  37. #define ALLOWED_SIGS (sigmask(SIGKILL))
  38. static struct svc_program nlmsvc_program;
  39. struct nlmsvc_binding * nlmsvc_ops;
  40. EXPORT_SYMBOL_GPL(nlmsvc_ops);
  41. static DEFINE_MUTEX(nlmsvc_mutex);
  42. static unsigned int nlmsvc_users;
  43. static struct task_struct *nlmsvc_task;
  44. static struct svc_rqst *nlmsvc_rqst;
  45. unsigned long nlmsvc_timeout;
  46. int lockd_net_id;
  47. /*
  48. * These can be set at insmod time (useful for NFS as root filesystem),
  49. * and also changed through the sysctl interface. -- Jamie Lokier, Aug 2003
  50. */
  51. static unsigned long nlm_grace_period;
  52. static unsigned long nlm_timeout = LOCKD_DFLT_TIMEO;
  53. static int nlm_udpport, nlm_tcpport;
  54. /* RLIM_NOFILE defaults to 1024. That seems like a reasonable default here. */
  55. static unsigned int nlm_max_connections = 1024;
  56. /*
  57. * Constants needed for the sysctl interface.
  58. */
  59. static const unsigned long nlm_grace_period_min = 0;
  60. static const unsigned long nlm_grace_period_max = 240;
  61. static const unsigned long nlm_timeout_min = 3;
  62. static const unsigned long nlm_timeout_max = 20;
  63. static const int nlm_port_min = 0, nlm_port_max = 65535;
  64. #ifdef CONFIG_SYSCTL
  65. static struct ctl_table_header * nlm_sysctl_table;
  66. #endif
  67. static unsigned long get_lockd_grace_period(void)
  68. {
  69. /* Note: nlm_timeout should always be nonzero */
  70. if (nlm_grace_period)
  71. return roundup(nlm_grace_period, nlm_timeout) * HZ;
  72. else
  73. return nlm_timeout * 5 * HZ;
  74. }
  75. static void grace_ender(struct work_struct *grace)
  76. {
  77. struct delayed_work *dwork = container_of(grace, struct delayed_work,
  78. work);
  79. struct lockd_net *ln = container_of(dwork, struct lockd_net,
  80. grace_period_end);
  81. locks_end_grace(&ln->lockd_manager);
  82. }
  83. static void set_grace_period(struct net *net)
  84. {
  85. unsigned long grace_period = get_lockd_grace_period();
  86. struct lockd_net *ln = net_generic(net, lockd_net_id);
  87. locks_start_grace(net, &ln->lockd_manager);
  88. cancel_delayed_work_sync(&ln->grace_period_end);
  89. schedule_delayed_work(&ln->grace_period_end, grace_period);
  90. }
  91. static void restart_grace(void)
  92. {
  93. if (nlmsvc_ops) {
  94. struct net *net = &init_net;
  95. struct lockd_net *ln = net_generic(net, lockd_net_id);
  96. cancel_delayed_work_sync(&ln->grace_period_end);
  97. locks_end_grace(&ln->lockd_manager);
  98. nlmsvc_invalidate_all();
  99. set_grace_period(net);
  100. }
  101. }
  102. /*
  103. * This is the lockd kernel thread
  104. */
  105. static int
  106. lockd(void *vrqstp)
  107. {
  108. int err = 0;
  109. struct svc_rqst *rqstp = vrqstp;
  110. /* try_to_freeze() is called from svc_recv() */
  111. set_freezable();
  112. /* Allow SIGKILL to tell lockd to drop all of its locks */
  113. allow_signal(SIGKILL);
  114. dprintk("NFS locking service started (ver " LOCKD_VERSION ").\n");
  115. if (!nlm_timeout)
  116. nlm_timeout = LOCKD_DFLT_TIMEO;
  117. nlmsvc_timeout = nlm_timeout * HZ;
  118. /*
  119. * The main request loop. We don't terminate until the last
  120. * NFS mount or NFS daemon has gone away.
  121. */
  122. while (!kthread_should_stop()) {
  123. long timeout = MAX_SCHEDULE_TIMEOUT;
  124. RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
  125. /* update sv_maxconn if it has changed */
  126. rqstp->rq_server->sv_maxconn = nlm_max_connections;
  127. if (signalled()) {
  128. flush_signals(current);
  129. restart_grace();
  130. continue;
  131. }
  132. timeout = nlmsvc_retry_blocked();
  133. /*
  134. * Find a socket with data available and call its
  135. * recvfrom routine.
  136. */
  137. err = svc_recv(rqstp, timeout);
  138. if (err == -EAGAIN || err == -EINTR)
  139. continue;
  140. dprintk("lockd: request from %s\n",
  141. svc_print_addr(rqstp, buf, sizeof(buf)));
  142. svc_process(rqstp);
  143. }
  144. flush_signals(current);
  145. if (nlmsvc_ops)
  146. nlmsvc_invalidate_all();
  147. nlm_shutdown_hosts();
  148. return 0;
  149. }
  150. static int create_lockd_listener(struct svc_serv *serv, const char *name,
  151. struct net *net, const int family,
  152. const unsigned short port)
  153. {
  154. struct svc_xprt *xprt;
  155. xprt = svc_find_xprt(serv, name, net, family, 0);
  156. if (xprt == NULL)
  157. return svc_create_xprt(serv, name, net, family, port,
  158. SVC_SOCK_DEFAULTS);
  159. svc_xprt_put(xprt);
  160. return 0;
  161. }
  162. static int create_lockd_family(struct svc_serv *serv, struct net *net,
  163. const int family)
  164. {
  165. int err;
  166. err = create_lockd_listener(serv, "udp", net, family, nlm_udpport);
  167. if (err < 0)
  168. return err;
  169. return create_lockd_listener(serv, "tcp", net, family, nlm_tcpport);
  170. }
  171. /*
  172. * Ensure there are active UDP and TCP listeners for lockd.
  173. *
  174. * Even if we have only TCP NFS mounts and/or TCP NFSDs, some
  175. * local services (such as rpc.statd) still require UDP, and
  176. * some NFS servers do not yet support NLM over TCP.
  177. *
  178. * Returns zero if all listeners are available; otherwise a
  179. * negative errno value is returned.
  180. */
  181. static int make_socks(struct svc_serv *serv, struct net *net)
  182. {
  183. static int warned;
  184. int err;
  185. err = create_lockd_family(serv, net, PF_INET);
  186. if (err < 0)
  187. goto out_err;
  188. err = create_lockd_family(serv, net, PF_INET6);
  189. if (err < 0 && err != -EAFNOSUPPORT)
  190. goto out_err;
  191. warned = 0;
  192. return 0;
  193. out_err:
  194. if (warned++ == 0)
  195. printk(KERN_WARNING
  196. "lockd_up: makesock failed, error=%d\n", err);
  197. return err;
  198. }
  199. static int lockd_up_net(struct svc_serv *serv, struct net *net)
  200. {
  201. struct lockd_net *ln = net_generic(net, lockd_net_id);
  202. int error;
  203. if (ln->nlmsvc_users++)
  204. return 0;
  205. error = svc_bind(serv, net);
  206. if (error)
  207. goto err_bind;
  208. error = make_socks(serv, net);
  209. if (error < 0)
  210. goto err_socks;
  211. set_grace_period(net);
  212. dprintk("lockd_up_net: per-net data created; net=%p\n", net);
  213. return 0;
  214. err_socks:
  215. svc_rpcb_cleanup(serv, net);
  216. err_bind:
  217. ln->nlmsvc_users--;
  218. return error;
  219. }
  220. static void lockd_down_net(struct svc_serv *serv, struct net *net)
  221. {
  222. struct lockd_net *ln = net_generic(net, lockd_net_id);
  223. if (ln->nlmsvc_users) {
  224. if (--ln->nlmsvc_users == 0) {
  225. nlm_shutdown_hosts_net(net);
  226. cancel_delayed_work_sync(&ln->grace_period_end);
  227. locks_end_grace(&ln->lockd_manager);
  228. svc_shutdown_net(serv, net);
  229. dprintk("lockd_down_net: per-net data destroyed; net=%p\n", net);
  230. }
  231. } else {
  232. printk(KERN_ERR "lockd_down_net: no users! task=%p, net=%p\n",
  233. nlmsvc_task, net);
  234. BUG();
  235. }
  236. }
  237. static int lockd_start_svc(struct svc_serv *serv)
  238. {
  239. int error;
  240. if (nlmsvc_rqst)
  241. return 0;
  242. /*
  243. * Create the kernel thread and wait for it to start.
  244. */
  245. nlmsvc_rqst = svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
  246. if (IS_ERR(nlmsvc_rqst)) {
  247. error = PTR_ERR(nlmsvc_rqst);
  248. printk(KERN_WARNING
  249. "lockd_up: svc_rqst allocation failed, error=%d\n",
  250. error);
  251. goto out_rqst;
  252. }
  253. svc_sock_update_bufs(serv);
  254. serv->sv_maxconn = nlm_max_connections;
  255. nlmsvc_task = kthread_run(lockd, nlmsvc_rqst, serv->sv_name);
  256. if (IS_ERR(nlmsvc_task)) {
  257. error = PTR_ERR(nlmsvc_task);
  258. printk(KERN_WARNING
  259. "lockd_up: kthread_run failed, error=%d\n", error);
  260. goto out_task;
  261. }
  262. dprintk("lockd_up: service started\n");
  263. return 0;
  264. out_task:
  265. svc_exit_thread(nlmsvc_rqst);
  266. nlmsvc_task = NULL;
  267. out_rqst:
  268. nlmsvc_rqst = NULL;
  269. return error;
  270. }
  271. static struct svc_serv *lockd_create_svc(void)
  272. {
  273. struct svc_serv *serv;
  274. /*
  275. * Check whether we're already up and running.
  276. */
  277. if (nlmsvc_rqst) {
  278. /*
  279. * Note: increase service usage, because later in case of error
  280. * svc_destroy() will be called.
  281. */
  282. svc_get(nlmsvc_rqst->rq_server);
  283. return nlmsvc_rqst->rq_server;
  284. }
  285. /*
  286. * Sanity check: if there's no pid,
  287. * we should be the first user ...
  288. */
  289. if (nlmsvc_users)
  290. printk(KERN_WARNING
  291. "lockd_up: no pid, %d users??\n", nlmsvc_users);
  292. serv = svc_create(&nlmsvc_program, LOCKD_BUFSIZE, NULL);
  293. if (!serv) {
  294. printk(KERN_WARNING "lockd_up: create service failed\n");
  295. return ERR_PTR(-ENOMEM);
  296. }
  297. dprintk("lockd_up: service created\n");
  298. return serv;
  299. }
  300. /*
  301. * Bring up the lockd process if it's not already up.
  302. */
  303. int lockd_up(struct net *net)
  304. {
  305. struct svc_serv *serv;
  306. int error;
  307. mutex_lock(&nlmsvc_mutex);
  308. serv = lockd_create_svc();
  309. if (IS_ERR(serv)) {
  310. error = PTR_ERR(serv);
  311. goto err_create;
  312. }
  313. error = lockd_up_net(serv, net);
  314. if (error < 0)
  315. goto err_net;
  316. error = lockd_start_svc(serv);
  317. if (error < 0)
  318. goto err_start;
  319. nlmsvc_users++;
  320. /*
  321. * Note: svc_serv structures have an initial use count of 1,
  322. * so we exit through here on both success and failure.
  323. */
  324. err_net:
  325. svc_destroy(serv);
  326. err_create:
  327. mutex_unlock(&nlmsvc_mutex);
  328. return error;
  329. err_start:
  330. lockd_down_net(serv, net);
  331. goto err_net;
  332. }
  333. EXPORT_SYMBOL_GPL(lockd_up);
  334. /*
  335. * Decrement the user count and bring down lockd if we're the last.
  336. */
  337. void
  338. lockd_down(struct net *net)
  339. {
  340. mutex_lock(&nlmsvc_mutex);
  341. lockd_down_net(nlmsvc_rqst->rq_server, net);
  342. if (nlmsvc_users) {
  343. if (--nlmsvc_users)
  344. goto out;
  345. } else {
  346. printk(KERN_ERR "lockd_down: no users! task=%p\n",
  347. nlmsvc_task);
  348. BUG();
  349. }
  350. if (!nlmsvc_task) {
  351. printk(KERN_ERR "lockd_down: no lockd running.\n");
  352. BUG();
  353. }
  354. kthread_stop(nlmsvc_task);
  355. dprintk("lockd_down: service stopped\n");
  356. svc_exit_thread(nlmsvc_rqst);
  357. dprintk("lockd_down: service destroyed\n");
  358. nlmsvc_task = NULL;
  359. nlmsvc_rqst = NULL;
  360. out:
  361. mutex_unlock(&nlmsvc_mutex);
  362. }
  363. EXPORT_SYMBOL_GPL(lockd_down);
  364. #ifdef CONFIG_SYSCTL
  365. /*
  366. * Sysctl parameters (same as module parameters, different interface).
  367. */
  368. static ctl_table nlm_sysctls[] = {
  369. {
  370. .procname = "nlm_grace_period",
  371. .data = &nlm_grace_period,
  372. .maxlen = sizeof(unsigned long),
  373. .mode = 0644,
  374. .proc_handler = proc_doulongvec_minmax,
  375. .extra1 = (unsigned long *) &nlm_grace_period_min,
  376. .extra2 = (unsigned long *) &nlm_grace_period_max,
  377. },
  378. {
  379. .procname = "nlm_timeout",
  380. .data = &nlm_timeout,
  381. .maxlen = sizeof(unsigned long),
  382. .mode = 0644,
  383. .proc_handler = proc_doulongvec_minmax,
  384. .extra1 = (unsigned long *) &nlm_timeout_min,
  385. .extra2 = (unsigned long *) &nlm_timeout_max,
  386. },
  387. {
  388. .procname = "nlm_udpport",
  389. .data = &nlm_udpport,
  390. .maxlen = sizeof(int),
  391. .mode = 0644,
  392. .proc_handler = proc_dointvec_minmax,
  393. .extra1 = (int *) &nlm_port_min,
  394. .extra2 = (int *) &nlm_port_max,
  395. },
  396. {
  397. .procname = "nlm_tcpport",
  398. .data = &nlm_tcpport,
  399. .maxlen = sizeof(int),
  400. .mode = 0644,
  401. .proc_handler = proc_dointvec_minmax,
  402. .extra1 = (int *) &nlm_port_min,
  403. .extra2 = (int *) &nlm_port_max,
  404. },
  405. {
  406. .procname = "nsm_use_hostnames",
  407. .data = &nsm_use_hostnames,
  408. .maxlen = sizeof(int),
  409. .mode = 0644,
  410. .proc_handler = proc_dointvec,
  411. },
  412. {
  413. .procname = "nsm_local_state",
  414. .data = &nsm_local_state,
  415. .maxlen = sizeof(int),
  416. .mode = 0644,
  417. .proc_handler = proc_dointvec,
  418. },
  419. { }
  420. };
  421. static ctl_table nlm_sysctl_dir[] = {
  422. {
  423. .procname = "nfs",
  424. .mode = 0555,
  425. .child = nlm_sysctls,
  426. },
  427. { }
  428. };
  429. static ctl_table nlm_sysctl_root[] = {
  430. {
  431. .procname = "fs",
  432. .mode = 0555,
  433. .child = nlm_sysctl_dir,
  434. },
  435. { }
  436. };
  437. #endif /* CONFIG_SYSCTL */
  438. /*
  439. * Module (and sysfs) parameters.
  440. */
  441. #define param_set_min_max(name, type, which_strtol, min, max) \
  442. static int param_set_##name(const char *val, struct kernel_param *kp) \
  443. { \
  444. char *endp; \
  445. __typeof__(type) num = which_strtol(val, &endp, 0); \
  446. if (endp == val || *endp || num < (min) || num > (max)) \
  447. return -EINVAL; \
  448. *((type *) kp->arg) = num; \
  449. return 0; \
  450. }
  451. static inline int is_callback(u32 proc)
  452. {
  453. return proc == NLMPROC_GRANTED
  454. || proc == NLMPROC_GRANTED_MSG
  455. || proc == NLMPROC_TEST_RES
  456. || proc == NLMPROC_LOCK_RES
  457. || proc == NLMPROC_CANCEL_RES
  458. || proc == NLMPROC_UNLOCK_RES
  459. || proc == NLMPROC_NSM_NOTIFY;
  460. }
  461. static int lockd_authenticate(struct svc_rqst *rqstp)
  462. {
  463. rqstp->rq_client = NULL;
  464. switch (rqstp->rq_authop->flavour) {
  465. case RPC_AUTH_NULL:
  466. case RPC_AUTH_UNIX:
  467. if (rqstp->rq_proc == 0)
  468. return SVC_OK;
  469. if (is_callback(rqstp->rq_proc)) {
  470. /* Leave it to individual procedures to
  471. * call nlmsvc_lookup_host(rqstp)
  472. */
  473. return SVC_OK;
  474. }
  475. return svc_set_client(rqstp);
  476. }
  477. return SVC_DENIED;
  478. }
  479. param_set_min_max(port, int, simple_strtol, 0, 65535)
  480. param_set_min_max(grace_period, unsigned long, simple_strtoul,
  481. nlm_grace_period_min, nlm_grace_period_max)
  482. param_set_min_max(timeout, unsigned long, simple_strtoul,
  483. nlm_timeout_min, nlm_timeout_max)
  484. MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
  485. MODULE_DESCRIPTION("NFS file locking service version " LOCKD_VERSION ".");
  486. MODULE_LICENSE("GPL");
  487. module_param_call(nlm_grace_period, param_set_grace_period, param_get_ulong,
  488. &nlm_grace_period, 0644);
  489. module_param_call(nlm_timeout, param_set_timeout, param_get_ulong,
  490. &nlm_timeout, 0644);
  491. module_param_call(nlm_udpport, param_set_port, param_get_int,
  492. &nlm_udpport, 0644);
  493. module_param_call(nlm_tcpport, param_set_port, param_get_int,
  494. &nlm_tcpport, 0644);
  495. module_param(nsm_use_hostnames, bool, 0644);
  496. module_param(nlm_max_connections, uint, 0644);
  497. static int lockd_init_net(struct net *net)
  498. {
  499. struct lockd_net *ln = net_generic(net, lockd_net_id);
  500. INIT_DELAYED_WORK(&ln->grace_period_end, grace_ender);
  501. INIT_LIST_HEAD(&ln->grace_list);
  502. spin_lock_init(&ln->nsm_clnt_lock);
  503. return 0;
  504. }
  505. static void lockd_exit_net(struct net *net)
  506. {
  507. }
  508. static struct pernet_operations lockd_net_ops = {
  509. .init = lockd_init_net,
  510. .exit = lockd_exit_net,
  511. .id = &lockd_net_id,
  512. .size = sizeof(struct lockd_net),
  513. };
  514. /*
  515. * Initialising and terminating the module.
  516. */
  517. static int __init init_nlm(void)
  518. {
  519. int err;
  520. #ifdef CONFIG_SYSCTL
  521. err = -ENOMEM;
  522. nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
  523. if (nlm_sysctl_table == NULL)
  524. goto err_sysctl;
  525. #endif
  526. err = register_pernet_subsys(&lockd_net_ops);
  527. if (err)
  528. goto err_pernet;
  529. return 0;
  530. err_pernet:
  531. #ifdef CONFIG_SYSCTL
  532. unregister_sysctl_table(nlm_sysctl_table);
  533. #endif
  534. err_sysctl:
  535. return err;
  536. }
  537. static void __exit exit_nlm(void)
  538. {
  539. /* FIXME: delete all NLM clients */
  540. nlm_shutdown_hosts();
  541. unregister_pernet_subsys(&lockd_net_ops);
  542. #ifdef CONFIG_SYSCTL
  543. unregister_sysctl_table(nlm_sysctl_table);
  544. #endif
  545. }
  546. module_init(init_nlm);
  547. module_exit(exit_nlm);
  548. /*
  549. * Define NLM program and procedures
  550. */
  551. static struct svc_version nlmsvc_version1 = {
  552. .vs_vers = 1,
  553. .vs_nproc = 17,
  554. .vs_proc = nlmsvc_procedures,
  555. .vs_xdrsize = NLMSVC_XDRSIZE,
  556. };
  557. static struct svc_version nlmsvc_version3 = {
  558. .vs_vers = 3,
  559. .vs_nproc = 24,
  560. .vs_proc = nlmsvc_procedures,
  561. .vs_xdrsize = NLMSVC_XDRSIZE,
  562. };
  563. #ifdef CONFIG_LOCKD_V4
  564. static struct svc_version nlmsvc_version4 = {
  565. .vs_vers = 4,
  566. .vs_nproc = 24,
  567. .vs_proc = nlmsvc_procedures4,
  568. .vs_xdrsize = NLMSVC_XDRSIZE,
  569. };
  570. #endif
  571. static struct svc_version * nlmsvc_version[] = {
  572. [1] = &nlmsvc_version1,
  573. [3] = &nlmsvc_version3,
  574. #ifdef CONFIG_LOCKD_V4
  575. [4] = &nlmsvc_version4,
  576. #endif
  577. };
  578. static struct svc_stat nlmsvc_stats;
  579. #define NLM_NRVERS ARRAY_SIZE(nlmsvc_version)
  580. static struct svc_program nlmsvc_program = {
  581. .pg_prog = NLM_PROGRAM, /* program number */
  582. .pg_nvers = NLM_NRVERS, /* number of entries in nlmsvc_version */
  583. .pg_vers = nlmsvc_version, /* version table */
  584. .pg_name = "lockd", /* service name */
  585. .pg_class = "nfsd", /* share authentication with nfsd */
  586. .pg_stats = &nlmsvc_stats, /* stats table */
  587. .pg_authenticate = &lockd_authenticate /* export authentication */
  588. };