nlm_prot_server.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. /*-
  2. * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
  3. *
  4. * Copyright (c) 2008 Isilon Inc http://www.isilon.com/
  5. * Authors: Doug Rabson <dfr@rabson.org>
  6. * Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. * 2. Redistributions in binary form must reproduce the above copyright
  14. * notice, this list of conditions and the following disclaimer in the
  15. * documentation and/or other materials provided with the distribution.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  21. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27. * SUCH DAMAGE.
  28. */
  29. #include <sys/cdefs.h>
  30. #ifndef lint
  31. /*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
  32. /*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
  33. __RCSID("$NetBSD: nlm_prot.x,v 1.6 2000/06/07 14:30:15 bouyer Exp $");
  34. #endif /* not lint */
  35. __FBSDID("$FreeBSD$");
  36. #include <sys/param.h>
  37. #include <sys/malloc.h>
  38. #include <sys/systm.h>
  39. #include <nlm/nlm_prot.h>
  40. #include <nlm/nlm.h>
  41. /**********************************************************************/
  42. /*
  43. * Convert between various versions of the protocol structures.
  44. */
  45. static void
  46. nlm_convert_to_nlm4_lock(struct nlm4_lock *dst, struct nlm_lock *src)
  47. {
  48. dst->caller_name = src->caller_name;
  49. dst->fh = src->fh;
  50. dst->oh = src->oh;
  51. dst->svid = src->svid;
  52. dst->l_offset = src->l_offset;
  53. dst->l_len = src->l_len;
  54. }
  55. static void
  56. nlm_convert_to_nlm4_share(struct nlm4_share *dst, struct nlm_share *src)
  57. {
  58. dst->caller_name = src->caller_name;
  59. dst->fh = src->fh;
  60. dst->oh = src->oh;
  61. dst->mode = src->mode;
  62. dst->access = src->access;
  63. }
  64. static void
  65. nlm_convert_to_nlm_holder(struct nlm_holder *dst, struct nlm4_holder *src)
  66. {
  67. dst->exclusive = src->exclusive;
  68. dst->svid = src->svid;
  69. dst->oh = src->oh;
  70. dst->l_offset = src->l_offset;
  71. dst->l_len = src->l_len;
  72. }
  73. static void
  74. nlm_convert_to_nlm4_holder(struct nlm4_holder *dst, struct nlm_holder *src)
  75. {
  76. dst->exclusive = src->exclusive;
  77. dst->svid = src->svid;
  78. dst->oh = src->oh;
  79. dst->l_offset = src->l_offset;
  80. dst->l_len = src->l_len;
  81. }
  82. static enum nlm_stats
  83. nlm_convert_to_nlm_stats(enum nlm4_stats src)
  84. {
  85. if (src > nlm4_deadlck)
  86. return nlm_denied;
  87. return (enum nlm_stats) src;
  88. }
  89. static void
  90. nlm_convert_to_nlm_res(struct nlm_res *dst, struct nlm4_res *src)
  91. {
  92. dst->cookie = src->cookie;
  93. dst->stat.stat = nlm_convert_to_nlm_stats(src->stat.stat);
  94. }
  95. static void
  96. nlm_convert_to_nlm4_res(struct nlm4_res *dst, struct nlm_res *src)
  97. {
  98. dst->cookie = src->cookie;
  99. dst->stat.stat = (enum nlm4_stats) src->stat.stat;
  100. }
  101. /**********************************************************************/
  102. /*
  103. * RPC server stubs.
  104. */
  105. bool_t
  106. nlm_sm_notify_0_svc(struct nlm_sm_status *argp, void *result, struct svc_req *rqstp)
  107. {
  108. nlm_sm_notify(argp);
  109. return (TRUE);
  110. }
  111. bool_t
  112. nlm_test_1_svc(struct nlm_testargs *argp, nlm_testres *result, struct svc_req *rqstp)
  113. {
  114. bool_t retval;
  115. nlm4_testargs args4;
  116. nlm4_testres res4;
  117. args4.cookie = argp->cookie;
  118. args4.exclusive = argp->exclusive;
  119. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  120. retval = nlm4_test_4_svc(&args4, &res4, rqstp);
  121. if (retval) {
  122. result->cookie = res4.cookie;
  123. result->stat.stat = nlm_convert_to_nlm_stats(res4.stat.stat);
  124. if (result->stat.stat == nlm_denied)
  125. nlm_convert_to_nlm_holder(
  126. &result->stat.nlm_testrply_u.holder,
  127. &res4.stat.nlm4_testrply_u.holder);
  128. }
  129. return (retval);
  130. }
  131. bool_t
  132. nlm_lock_1_svc(struct nlm_lockargs *argp, nlm_res *result, struct svc_req *rqstp)
  133. {
  134. bool_t retval;
  135. nlm4_lockargs args4;
  136. nlm4_res res4;
  137. args4.cookie = argp->cookie;
  138. args4.block = argp->block;
  139. args4.exclusive = argp->exclusive;
  140. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  141. args4.reclaim = argp->reclaim;
  142. args4.state = argp->state;
  143. retval = nlm4_lock_4_svc(&args4, &res4, rqstp);
  144. if (retval)
  145. nlm_convert_to_nlm_res(result, &res4);
  146. return (retval);
  147. }
  148. bool_t
  149. nlm_cancel_1_svc(struct nlm_cancargs *argp, nlm_res *result, struct svc_req *rqstp)
  150. {
  151. bool_t retval;
  152. nlm4_cancargs args4;
  153. nlm4_res res4;
  154. args4.cookie = argp->cookie;
  155. args4.block = argp->block;
  156. args4.exclusive = argp->exclusive;
  157. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  158. retval = nlm4_cancel_4_svc(&args4, &res4, rqstp);
  159. if (retval)
  160. nlm_convert_to_nlm_res(result, &res4);
  161. return (retval);
  162. }
  163. bool_t
  164. nlm_unlock_1_svc(struct nlm_unlockargs *argp, nlm_res *result, struct svc_req *rqstp)
  165. {
  166. bool_t retval;
  167. nlm4_unlockargs args4;
  168. nlm4_res res4;
  169. args4.cookie = argp->cookie;
  170. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  171. retval = nlm4_unlock_4_svc(&args4, &res4, rqstp);
  172. if (retval)
  173. nlm_convert_to_nlm_res(result, &res4);
  174. return (retval);
  175. }
  176. bool_t
  177. nlm_granted_1_svc(struct nlm_testargs *argp, nlm_res *result, struct svc_req *rqstp)
  178. {
  179. bool_t retval;
  180. nlm4_testargs args4;
  181. nlm4_res res4;
  182. args4.cookie = argp->cookie;
  183. args4.exclusive = argp->exclusive;
  184. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  185. retval = nlm4_granted_4_svc(&args4, &res4, rqstp);
  186. if (retval)
  187. nlm_convert_to_nlm_res(result, &res4);
  188. return (retval);
  189. }
  190. bool_t
  191. nlm_test_msg_1_svc(struct nlm_testargs *argp, void *result, struct svc_req *rqstp)
  192. {
  193. nlm4_testargs args4;
  194. nlm4_testres res4;
  195. nlm_testres res;
  196. CLIENT *rpc;
  197. char dummy;
  198. args4.cookie = argp->cookie;
  199. args4.exclusive = argp->exclusive;
  200. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  201. if (nlm_do_test(&args4, &res4, rqstp, &rpc))
  202. return (FALSE);
  203. res.cookie = res4.cookie;
  204. res.stat.stat = nlm_convert_to_nlm_stats(res4.stat.stat);
  205. if (res.stat.stat == nlm_denied)
  206. nlm_convert_to_nlm_holder(
  207. &res.stat.nlm_testrply_u.holder,
  208. &res4.stat.nlm4_testrply_u.holder);
  209. if (rpc) {
  210. nlm_test_res_1(&res, &dummy, rpc, NULL, nlm_zero_tv);
  211. CLNT_RELEASE(rpc);
  212. }
  213. xdr_free((xdrproc_t) xdr_nlm_testres, &res);
  214. return (FALSE);
  215. }
  216. bool_t
  217. nlm_lock_msg_1_svc(struct nlm_lockargs *argp, void *result, struct svc_req *rqstp)
  218. {
  219. nlm4_lockargs args4;
  220. nlm4_res res4;
  221. nlm_res res;
  222. CLIENT *rpc;
  223. char dummy;
  224. args4.cookie = argp->cookie;
  225. args4.block = argp->block;
  226. args4.exclusive = argp->exclusive;
  227. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  228. args4.reclaim = argp->reclaim;
  229. args4.state = argp->state;
  230. if (nlm_do_lock(&args4, &res4, rqstp, TRUE, &rpc))
  231. return (FALSE);
  232. nlm_convert_to_nlm_res(&res, &res4);
  233. if (rpc) {
  234. nlm_lock_res_1(&res, &dummy, rpc, NULL, nlm_zero_tv);
  235. CLNT_RELEASE(rpc);
  236. }
  237. xdr_free((xdrproc_t) xdr_nlm_res, &res);
  238. return (FALSE);
  239. }
  240. bool_t
  241. nlm_cancel_msg_1_svc(struct nlm_cancargs *argp, void *result, struct svc_req *rqstp)
  242. {
  243. nlm4_cancargs args4;
  244. nlm4_res res4;
  245. nlm_res res;
  246. CLIENT *rpc;
  247. char dummy;
  248. args4.cookie = argp->cookie;
  249. args4.block = argp->block;
  250. args4.exclusive = argp->exclusive;
  251. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  252. if (nlm_do_cancel(&args4, &res4, rqstp, &rpc))
  253. return (FALSE);
  254. nlm_convert_to_nlm_res(&res, &res4);
  255. if (rpc) {
  256. nlm_cancel_res_1(&res, &dummy, rpc, NULL, nlm_zero_tv);
  257. CLNT_RELEASE(rpc);
  258. }
  259. xdr_free((xdrproc_t) xdr_nlm_res, &res);
  260. return (FALSE);
  261. }
  262. bool_t
  263. nlm_unlock_msg_1_svc(struct nlm_unlockargs *argp, void *result, struct svc_req *rqstp)
  264. {
  265. nlm4_unlockargs args4;
  266. nlm4_res res4;
  267. nlm_res res;
  268. CLIENT *rpc;
  269. char dummy;
  270. args4.cookie = argp->cookie;
  271. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  272. if (nlm_do_unlock(&args4, &res4, rqstp, &rpc))
  273. return (FALSE);
  274. nlm_convert_to_nlm_res(&res, &res4);
  275. if (rpc) {
  276. nlm_unlock_res_1(&res, &dummy, rpc, NULL, nlm_zero_tv);
  277. CLNT_RELEASE(rpc);
  278. }
  279. xdr_free((xdrproc_t) xdr_nlm_res, &res);
  280. return (FALSE);
  281. }
  282. bool_t
  283. nlm_granted_msg_1_svc(struct nlm_testargs *argp, void *result, struct svc_req *rqstp)
  284. {
  285. nlm4_testargs args4;
  286. nlm4_res res4;
  287. nlm_res res;
  288. CLIENT *rpc;
  289. char dummy;
  290. args4.cookie = argp->cookie;
  291. args4.exclusive = argp->exclusive;
  292. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  293. if (nlm_do_granted(&args4, &res4, rqstp, &rpc))
  294. return (FALSE);
  295. nlm_convert_to_nlm_res(&res, &res4);
  296. if (rpc) {
  297. nlm_granted_res_1(&res, &dummy, rpc, NULL, nlm_zero_tv);
  298. CLNT_RELEASE(rpc);
  299. }
  300. xdr_free((xdrproc_t) xdr_nlm_res, &res);
  301. return (FALSE);
  302. }
  303. bool_t
  304. nlm_test_res_1_svc(nlm_testres *argp, void *result, struct svc_req *rqstp)
  305. {
  306. nlm4_testres args4;
  307. args4.cookie = argp->cookie;
  308. if (argp->stat.stat == nlm_denied)
  309. nlm_convert_to_nlm4_holder(
  310. &args4.stat.nlm4_testrply_u.holder,
  311. &argp->stat.nlm_testrply_u.holder);
  312. return (nlm4_test_res_4_svc(&args4, result, rqstp));
  313. }
  314. bool_t
  315. nlm_lock_res_1_svc(nlm_res *argp, void *result, struct svc_req *rqstp)
  316. {
  317. nlm4_res arg4;
  318. nlm_convert_to_nlm4_res(&arg4, argp);
  319. return (nlm4_lock_res_4_svc(&arg4, result, rqstp));
  320. }
  321. bool_t
  322. nlm_cancel_res_1_svc(nlm_res *argp, void *result, struct svc_req *rqstp)
  323. {
  324. nlm4_res arg4;
  325. nlm_convert_to_nlm4_res(&arg4, argp);
  326. return (nlm4_cancel_res_4_svc(&arg4, result, rqstp));
  327. }
  328. bool_t
  329. nlm_unlock_res_1_svc(nlm_res *argp, void *result, struct svc_req *rqstp)
  330. {
  331. nlm4_res arg4;
  332. nlm_convert_to_nlm4_res(&arg4, argp);
  333. return (nlm4_unlock_res_4_svc(&arg4, result, rqstp));
  334. }
  335. bool_t
  336. nlm_granted_res_1_svc(nlm_res *argp, void *result, struct svc_req *rqstp)
  337. {
  338. nlm4_res arg4;
  339. nlm_convert_to_nlm4_res(&arg4, argp);
  340. return (nlm4_granted_res_4_svc(&arg4, result, rqstp));
  341. }
  342. int
  343. nlm_prog_1_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result)
  344. {
  345. (void) xdr_free(xdr_result, result);
  346. return (TRUE);
  347. }
  348. bool_t
  349. nlm_share_3_svc(nlm_shareargs *argp, nlm_shareres *result, struct svc_req *rqstp)
  350. {
  351. bool_t retval;
  352. nlm4_shareargs args4;
  353. nlm4_shareres res4;
  354. args4.cookie = argp->cookie;
  355. nlm_convert_to_nlm4_share(&args4.share, &argp->share);
  356. args4.reclaim = argp->reclaim;
  357. retval = nlm4_share_4_svc(&args4, &res4, rqstp);
  358. if (retval) {
  359. result->cookie = res4.cookie;
  360. result->stat = nlm_convert_to_nlm_stats(res4.stat);
  361. result->sequence = res4.sequence;
  362. }
  363. return (retval);
  364. }
  365. bool_t
  366. nlm_unshare_3_svc(nlm_shareargs *argp, nlm_shareres *result, struct svc_req *rqstp)
  367. {
  368. bool_t retval;
  369. nlm4_shareargs args4;
  370. nlm4_shareres res4;
  371. args4.cookie = argp->cookie;
  372. nlm_convert_to_nlm4_share(&args4.share, &argp->share);
  373. args4.reclaim = argp->reclaim;
  374. retval = nlm4_unshare_4_svc(&args4, &res4, rqstp);
  375. if (retval) {
  376. result->cookie = res4.cookie;
  377. result->stat = nlm_convert_to_nlm_stats(res4.stat);
  378. result->sequence = res4.sequence;
  379. }
  380. return (retval);
  381. }
  382. bool_t
  383. nlm_nm_lock_3_svc(nlm_lockargs *argp, nlm_res *result, struct svc_req *rqstp)
  384. {
  385. bool_t retval;
  386. nlm4_lockargs args4;
  387. nlm4_res res4;
  388. args4.cookie = argp->cookie;
  389. args4.block = argp->block;
  390. args4.exclusive = argp->exclusive;
  391. nlm_convert_to_nlm4_lock(&args4.alock, &argp->alock);
  392. args4.reclaim = argp->reclaim;
  393. args4.state = argp->state;
  394. retval = nlm4_nm_lock_4_svc(&args4, &res4, rqstp);
  395. if (retval)
  396. nlm_convert_to_nlm_res(result, &res4);
  397. return (retval);
  398. }
  399. bool_t
  400. nlm_free_all_3_svc(nlm_notify *argp, void *result, struct svc_req *rqstp)
  401. {
  402. struct nlm4_notify args4;
  403. args4.name = argp->name;
  404. args4.state = argp->state;
  405. return (nlm4_free_all_4_svc(&args4, result, rqstp));
  406. }
  407. int
  408. nlm_prog_3_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result)
  409. {
  410. (void) xdr_free(xdr_result, result);
  411. return (TRUE);
  412. }
  413. bool_t
  414. nlm4_test_4_svc(nlm4_testargs *argp, nlm4_testres *result, struct svc_req *rqstp)
  415. {
  416. nlm_do_test(argp, result, rqstp, NULL);
  417. return (TRUE);
  418. }
  419. bool_t
  420. nlm4_lock_4_svc(nlm4_lockargs *argp, nlm4_res *result, struct svc_req *rqstp)
  421. {
  422. nlm_do_lock(argp, result, rqstp, TRUE, NULL);
  423. return (TRUE);
  424. }
  425. bool_t
  426. nlm4_cancel_4_svc(nlm4_cancargs *argp, nlm4_res *result, struct svc_req *rqstp)
  427. {
  428. nlm_do_cancel(argp, result, rqstp, NULL);
  429. return (TRUE);
  430. }
  431. bool_t
  432. nlm4_unlock_4_svc(nlm4_unlockargs *argp, nlm4_res *result, struct svc_req *rqstp)
  433. {
  434. nlm_do_unlock(argp, result, rqstp, NULL);
  435. return (TRUE);
  436. }
  437. bool_t
  438. nlm4_granted_4_svc(nlm4_testargs *argp, nlm4_res *result, struct svc_req *rqstp)
  439. {
  440. nlm_do_granted(argp, result, rqstp, NULL);
  441. return (TRUE);
  442. }
  443. bool_t
  444. nlm4_test_msg_4_svc(nlm4_testargs *argp, void *result, struct svc_req *rqstp)
  445. {
  446. nlm4_testres res4;
  447. CLIENT *rpc;
  448. char dummy;
  449. if (nlm_do_test(argp, &res4, rqstp, &rpc))
  450. return (FALSE);
  451. if (rpc) {
  452. nlm4_test_res_4(&res4, &dummy, rpc, NULL, nlm_zero_tv);
  453. CLNT_RELEASE(rpc);
  454. }
  455. xdr_free((xdrproc_t) xdr_nlm4_testres, &res4);
  456. return (FALSE);
  457. }
  458. bool_t
  459. nlm4_lock_msg_4_svc(nlm4_lockargs *argp, void *result, struct svc_req *rqstp)
  460. {
  461. nlm4_res res4;
  462. CLIENT *rpc;
  463. char dummy;
  464. if (nlm_do_lock(argp, &res4, rqstp, TRUE, &rpc))
  465. return (FALSE);
  466. if (rpc) {
  467. nlm4_lock_res_4(&res4, &dummy, rpc, NULL, nlm_zero_tv);
  468. CLNT_RELEASE(rpc);
  469. }
  470. xdr_free((xdrproc_t) xdr_nlm4_res, &res4);
  471. return (FALSE);
  472. }
  473. bool_t
  474. nlm4_cancel_msg_4_svc(nlm4_cancargs *argp, void *result, struct svc_req *rqstp)
  475. {
  476. nlm4_res res4;
  477. CLIENT *rpc;
  478. char dummy;
  479. if (nlm_do_cancel(argp, &res4, rqstp, &rpc))
  480. return (FALSE);
  481. if (rpc) {
  482. nlm4_cancel_res_4(&res4, &dummy, rpc, NULL, nlm_zero_tv);
  483. CLNT_RELEASE(rpc);
  484. }
  485. xdr_free((xdrproc_t) xdr_nlm4_res, &res4);
  486. return (FALSE);
  487. }
  488. bool_t
  489. nlm4_unlock_msg_4_svc(nlm4_unlockargs *argp, void *result, struct svc_req *rqstp)
  490. {
  491. nlm4_res res4;
  492. CLIENT *rpc;
  493. char dummy;
  494. if (nlm_do_unlock(argp, &res4, rqstp, &rpc))
  495. return (FALSE);
  496. if (rpc) {
  497. nlm4_unlock_res_4(&res4, &dummy, rpc, NULL, nlm_zero_tv);
  498. CLNT_RELEASE(rpc);
  499. }
  500. xdr_free((xdrproc_t) xdr_nlm4_res, &res4);
  501. return (FALSE);
  502. }
  503. bool_t
  504. nlm4_granted_msg_4_svc(nlm4_testargs *argp, void *result, struct svc_req *rqstp)
  505. {
  506. nlm4_res res4;
  507. CLIENT *rpc;
  508. char dummy;
  509. if (nlm_do_granted(argp, &res4, rqstp, &rpc))
  510. return (FALSE);
  511. if (rpc) {
  512. nlm4_granted_res_4(&res4, &dummy, rpc, NULL, nlm_zero_tv);
  513. CLNT_RELEASE(rpc);
  514. }
  515. xdr_free((xdrproc_t) xdr_nlm4_res, &res4);
  516. return (FALSE);
  517. }
  518. bool_t
  519. nlm4_test_res_4_svc(nlm4_testres *argp, void *result, struct svc_req *rqstp)
  520. {
  521. return (FALSE);
  522. }
  523. bool_t
  524. nlm4_lock_res_4_svc(nlm4_res *argp, void *result, struct svc_req *rqstp)
  525. {
  526. return (FALSE);
  527. }
  528. bool_t
  529. nlm4_cancel_res_4_svc(nlm4_res *argp, void *result, struct svc_req *rqstp)
  530. {
  531. return (FALSE);
  532. }
  533. bool_t
  534. nlm4_unlock_res_4_svc(nlm4_res *argp, void *result, struct svc_req *rqstp)
  535. {
  536. return (FALSE);
  537. }
  538. bool_t
  539. nlm4_granted_res_4_svc(nlm4_res *argp, void *result, struct svc_req *rqstp)
  540. {
  541. nlm_do_granted_res(argp, rqstp);
  542. return (FALSE);
  543. }
  544. bool_t
  545. nlm4_share_4_svc(nlm4_shareargs *argp, nlm4_shareres *result, struct svc_req *rqstp)
  546. {
  547. memset(result, 0, sizeof(*result));
  548. result->stat = nlm4_denied;
  549. return (TRUE);
  550. }
  551. bool_t
  552. nlm4_unshare_4_svc(nlm4_shareargs *argp, nlm4_shareres *result, struct svc_req *rqstp)
  553. {
  554. memset(result, 0, sizeof(*result));
  555. result->stat = nlm4_denied;
  556. return (TRUE);
  557. }
  558. bool_t
  559. nlm4_nm_lock_4_svc(nlm4_lockargs *argp, nlm4_res *result, struct svc_req *rqstp)
  560. {
  561. nlm_do_lock(argp, result, rqstp, FALSE, NULL);
  562. return (TRUE);
  563. }
  564. bool_t
  565. nlm4_free_all_4_svc(nlm4_notify *argp, void *result, struct svc_req *rqstp)
  566. {
  567. nlm_do_free_all(argp);
  568. return (TRUE);
  569. }
  570. int
  571. nlm_prog_4_freeresult(SVCXPRT *transp, xdrproc_t xdr_result, caddr_t result)
  572. {
  573. (void) xdr_free(xdr_result, result);
  574. return (TRUE);
  575. }