Wed Feb 9 21:50:24 2022 UTC ()
s/ony/only/


(andvar)
diff -r1.3 -r1.4 src/sys/fs/nfs/client/nfs_clcomsubs.c
diff -r1.241 -r1.242 src/sys/nfs/nfs_subs.c

cvs diff -r1.3 -r1.4 src/sys/fs/nfs/client/nfs_clcomsubs.c (expand / switch to unified diff)

--- src/sys/fs/nfs/client/nfs_clcomsubs.c 2021/11/10 15:56:39 1.3
+++ src/sys/fs/nfs/client/nfs_clcomsubs.c 2022/02/09 21:50:24 1.4
@@ -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
47extern struct nfsstatsv1 nfsstatsv1; 47extern struct nfsstatsv1 nfsstatsv1;
48extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS]; 48extern struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS];
49extern int ncl_mbuf_mlen; 49extern int ncl_mbuf_mlen;
50extern enum vtype newnv2tov_type[8]; 50extern 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 */
255APPLESTATIC void 255APPLESTATIC void
256nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) 256nfsm_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 ?? */

cvs diff -r1.241 -r1.242 src/sys/nfs/nfs_subs.c (expand / switch to unified diff)

--- src/sys/nfs/nfs_subs.c 2020/09/05 16:30:12 1.241
+++ src/sys/nfs/nfs_subs.c 2022/02/09 21:50:24 1.242
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: nfs_subs.c,v 1.241 2020/09/05 16:30:12 riastradh Exp $ */ 1/* $NetBSD: nfs_subs.c,v 1.242 2022/02/09 21:50:24 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1989, 1993 4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * Rick Macklem at The University of Guelph. 8 * Rick Macklem at The University of Guelph.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -60,27 +60,27 @@ @@ -60,27 +60,27 @@
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
61 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 61 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
62 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 62 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
63 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 63 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
64 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 64 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
65 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 65 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
66 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 66 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
67 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 67 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
68 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 68 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
69 * POSSIBILITY OF SUCH DAMAGE. 69 * POSSIBILITY OF SUCH DAMAGE.
70 */ 70 */
71 71
72#include <sys/cdefs.h> 72#include <sys/cdefs.h>
73__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.241 2020/09/05 16:30:12 riastradh Exp $"); 73__KERNEL_RCSID(0, "$NetBSD: nfs_subs.c,v 1.242 2022/02/09 21:50:24 andvar Exp $");
74 74
75#ifdef _KERNEL_OPT 75#ifdef _KERNEL_OPT
76#include "opt_nfs.h" 76#include "opt_nfs.h"
77#endif 77#endif
78 78
79/* 79/*
80 * These functions support the macros and help fiddle mbuf chains for 80 * These functions support the macros and help fiddle mbuf chains for
81 * the nfs op functions. They do things like create the rpc header and 81 * the nfs op functions. They do things like create the rpc header and
82 * copy data between mbuf chains and uio lists. 82 * copy data between mbuf chains and uio lists.
83 */ 83 */
84#include <sys/param.h> 84#include <sys/param.h>
85#include <sys/proc.h> 85#include <sys/proc.h>
86#include <sys/systm.h> 86#include <sys/systm.h>
@@ -792,27 +792,27 @@ nfsm_mbuftouio(struct mbuf **mrep, struc @@ -792,27 +792,27 @@ nfsm_mbuftouio(struct mbuf **mrep, struc
792 *dpos = mbufcp; 792 *dpos = mbufcp;
793 *mrep = mp; 793 *mrep = mp;
794 if (rem > 0) { 794 if (rem > 0) {
795 if (len < rem) 795 if (len < rem)
796 error = nfs_adv(mrep, dpos, rem, len); 796 error = nfs_adv(mrep, dpos, rem, len);
797 else 797 else
798 *dpos += rem; 798 *dpos += rem;
799 } 799 }
800 return (error); 800 return (error);
801} 801}
802 802
803/* 803/*
804 * copies a uio scatter/gather list to an mbuf chain. 804 * copies a uio scatter/gather list to an mbuf chain.
805 * NOTE: can ony handle iovcnt == 1 805 * NOTE: can only handle iovcnt == 1
806 */ 806 */
807int 807int
808nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, char **bpos) 808nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, char **bpos)
809{ 809{
810 char *uiocp; 810 char *uiocp;
811 struct mbuf *mp, *mp2; 811 struct mbuf *mp, *mp2;
812 int xfer, left, mlen; 812 int xfer, left, mlen;
813 int uiosiz, clflg, rem; 813 int uiosiz, clflg, rem;
814 char *cp; 814 char *cp;
815 int error; 815 int error;
816 816
817#ifdef DIAGNOSTIC 817#ifdef DIAGNOSTIC
818 if (uiop->uio_iovcnt != 1) 818 if (uiop->uio_iovcnt != 1)