| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: nfs_clcomsubs.c,v 1.3 2021/11/10 15:56:39 msaitoh Exp $ */ | | 1 | /* $NetBSD: nfs_clcomsubs.c,v 1.4 2022/02/09 21:50:24 andvar Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 1989, 1993 | | 3 | * Copyright (c) 1989, 1993 |
4 | * The Regents of the University of California. All rights reserved. | | 4 | * The Regents of the University of California. All rights reserved. |
5 | * | | 5 | * |
6 | * This code is derived from software contributed to Berkeley by | | 6 | * This code is derived from software contributed to Berkeley by |
7 | * Rick Macklem at The University of Guelph. | | 7 | * Rick Macklem at The University of Guelph. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -24,27 +24,27 @@ | | | @@ -24,27 +24,27 @@ |
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | * SUCH DAMAGE. | | 31 | * SUCH DAMAGE. |
32 | * | | 32 | * |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clcomsubs.c 304026 2016-08-12 22:44:59Z rmacklem "); */ | | 36 | /* __FBSDID("FreeBSD: head/sys/fs/nfsclient/nfs_clcomsubs.c 304026 2016-08-12 22:44:59Z rmacklem "); */ |
37 | __RCSID("$NetBSD: nfs_clcomsubs.c,v 1.3 2021/11/10 15:56:39 msaitoh Exp $"); | | 37 | __RCSID("$NetBSD: nfs_clcomsubs.c,v 1.4 2022/02/09 21:50:24 andvar Exp $"); |
38 | | | 38 | |
39 | /* | | 39 | /* |
40 | * These functions support the macros and help fiddle mbuf chains for | | 40 | * These functions support the macros and help fiddle mbuf chains for |
41 | * the nfs op functions. They do things like create the rpc header and | | 41 | * the nfs op functions. They do things like create the rpc header and |
42 | * copy data between mbuf chains and uio lists. | | 42 | * copy data between mbuf chains and uio lists. |
43 | */ | | 43 | */ |
44 | #ifndef APPLEKEXT | | 44 | #ifndef APPLEKEXT |
45 | #include <fs/nfs/common/nfsport.h> | | 45 | #include <fs/nfs/common/nfsport.h> |
46 | | | 46 | |
47 | extern struct nfsstatsv1 nfsstatsv1; | | 47 | extern struct nfsstatsv1 nfsstatsv1; |
48 | extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; | | 48 | extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; |
49 | extern int ncl_mbuf_mlen; | | 49 | extern int ncl_mbuf_mlen; |
50 | extern enum vtype newnv2tov_type[8]; | | 50 | extern enum vtype newnv2tov_type[8]; |
| @@ -240,27 +240,27 @@ nfscl_reqstart(struct nfsrv_descript *nd | | | @@ -240,27 +240,27 @@ nfscl_reqstart(struct nfsrv_descript *nd |
240 | NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); | | 240 | NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); |
241 | *tl = txdr_unsigned(nfsv4_opmap[procnum].op); | | 241 | *tl = txdr_unsigned(nfsv4_opmap[procnum].op); |
242 | } | | 242 | } |
243 | } else { | | 243 | } else { |
244 | (void) nfsm_fhtom(nd, nfhp, fhlen, 0); | | 244 | (void) nfsm_fhtom(nd, nfhp, fhlen, 0); |
245 | } | | 245 | } |
246 | if (procnum < NFSV41_NPROCS) | | 246 | if (procnum < NFSV41_NPROCS) |
247 | NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); | | 247 | NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]); |
248 | } | | 248 | } |
249 | | | 249 | |
250 | #ifndef APPLE | | 250 | #ifndef APPLE |
251 | /* | | 251 | /* |
252 | * copies a uio scatter/gather list to an mbuf chain. | | 252 | * copies a uio scatter/gather list to an mbuf chain. |
253 | * NOTE: can ony handle iovcnt == 1 | | 253 | * NOTE: can only handle iovcnt == 1 |
254 | */ | | 254 | */ |
255 | APPLESTATIC void | | 255 | APPLESTATIC void |
256 | nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) | | 256 | nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) |
257 | { | | 257 | { |
258 | char *uiocp; | | 258 | char *uiocp; |
259 | struct mbuf *mp, *mp2; | | 259 | struct mbuf *mp, *mp2; |
260 | int xfer, left, mlen; | | 260 | int xfer, left, mlen; |
261 | int uiosiz, clflg, rem; | | 261 | int uiosiz, clflg, rem; |
262 | char *cp, *tcp; | | 262 | char *cp, *tcp; |
263 | | | 263 | |
264 | KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); | | 264 | KASSERT(uiop->uio_iovcnt == 1, ("nfsm_uiotombuf: iovcnt != 1")); |
265 | | | 265 | |
266 | if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ | | 266 | if (siz > ncl_mbuf_mlen) /* or should it >= MCLBYTES ?? */ |