nfs_srvsubs.c (106264) | nfs_srvsubs.c (109623) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95 |
37 * $FreeBSD: head/sys/nfsserver/nfs_srvsubs.c 106264 2002-10-31 22:35:03Z jeff $ | 37 * $FreeBSD: head/sys/nfsserver/nfs_srvsubs.c 109623 2003-01-21 08:56:16Z alfred $ |
38 */ 39 40#include <sys/cdefs.h> | 38 */ 39 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/nfsserver/nfs_srvsubs.c 106264 2002-10-31 22:35:03Z jeff $"); | 41__FBSDID("$FreeBSD: head/sys/nfsserver/nfs_srvsubs.c 109623 2003-01-21 08:56:16Z alfred $"); |
42 43/* 44 * These functions support the macros and help fiddle mbuf chains for 45 * the nfs op functions. They do things like create the rpc header and 46 * copy data between mbuf chains and uio lists. 47 */ 48 49#include "opt_inet6.h" --- 550 unchanged lines hidden (view full) --- 600 struct iovec aiov; 601 struct uio auio; 602 struct vnode *dp; 603 int error, rdonly, linklen; 604 struct componentname *cnp = &ndp->ni_cnd; 605 606 *retdirp = NULL; 607 cnp->cn_flags |= NOMACCHECK; | 42 43/* 44 * These functions support the macros and help fiddle mbuf chains for 45 * the nfs op functions. They do things like create the rpc header and 46 * copy data between mbuf chains and uio lists. 47 */ 48 49#include "opt_inet6.h" --- 550 unchanged lines hidden (view full) --- 600 struct iovec aiov; 601 struct uio auio; 602 struct vnode *dp; 603 int error, rdonly, linklen; 604 struct componentname *cnp = &ndp->ni_cnd; 605 606 *retdirp = NULL; 607 cnp->cn_flags |= NOMACCHECK; |
608 cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK); | 608 cnp->cn_pnbuf = uma_zalloc(namei_zone, 0); |
609 610 /* 611 * Copy the name from the mbuf list to ndp->ni_pnbuf 612 * and set the various ndp fields appropriately. 613 */ 614 fromcp = *dposp; 615 tocp = cnp->cn_pnbuf; 616 md = *mdp; --- 48 unchanged lines hidden (view full) --- 665 */ 666 *retdirp = dp; 667 668 if (pubflag) { 669 /* 670 * Oh joy. For WebNFS, handle those pesky '%' escapes, 671 * and the 'native path' indicator. 672 */ | 609 610 /* 611 * Copy the name from the mbuf list to ndp->ni_pnbuf 612 * and set the various ndp fields appropriately. 613 */ 614 fromcp = *dposp; 615 tocp = cnp->cn_pnbuf; 616 md = *mdp; --- 48 unchanged lines hidden (view full) --- 665 */ 666 *retdirp = dp; 667 668 if (pubflag) { 669 /* 670 * Oh joy. For WebNFS, handle those pesky '%' escapes, 671 * and the 'native path' indicator. 672 */ |
673 cp = uma_zalloc(namei_zone, M_WAITOK); | 673 cp = uma_zalloc(namei_zone, 0); |
674 fromcp = cnp->cn_pnbuf; 675 tocp = cp; 676 if ((unsigned char)*fromcp >= WEBNFS_SPECCHAR_START) { 677 switch ((unsigned char)*fromcp) { 678 case WEBNFS_NATIVE_CHAR: 679 /* 680 * 'Native' path for us is the same 681 * as a path according to the NFS spec, --- 92 unchanged lines hidden (view full) --- 774 goto badlink2; 775 } 776 777 if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { 778 error = ELOOP; 779 goto badlink2; 780 } 781 if (ndp->ni_pathlen > 1) | 674 fromcp = cnp->cn_pnbuf; 675 tocp = cp; 676 if ((unsigned char)*fromcp >= WEBNFS_SPECCHAR_START) { 677 switch ((unsigned char)*fromcp) { 678 case WEBNFS_NATIVE_CHAR: 679 /* 680 * 'Native' path for us is the same 681 * as a path according to the NFS spec, --- 92 unchanged lines hidden (view full) --- 774 goto badlink2; 775 } 776 777 if (ndp->ni_loopcnt++ >= MAXSYMLINKS) { 778 error = ELOOP; 779 goto badlink2; 780 } 781 if (ndp->ni_pathlen > 1) |
782 cp = uma_zalloc(namei_zone, M_WAITOK); | 782 cp = uma_zalloc(namei_zone, 0); |
783 else 784 cp = cnp->cn_pnbuf; 785 aiov.iov_base = cp; 786 aiov.iov_len = MAXPATHLEN; 787 auio.uio_iov = &aiov; 788 auio.uio_iovcnt = 1; 789 auio.uio_offset = 0; 790 auio.uio_rw = UIO_READ; --- 491 unchanged lines hidden (view full) --- 1282nfsm_clget_xx(u_int32_t **tl, struct mbuf *mb, struct mbuf **mp, 1283 char **bp, char **be, caddr_t bpos) 1284{ 1285 struct mbuf *nmp; 1286 1287 if (*bp >= *be) { 1288 if (*mp == mb) 1289 (*mp)->m_len += *bp - bpos; | 783 else 784 cp = cnp->cn_pnbuf; 785 aiov.iov_base = cp; 786 aiov.iov_len = MAXPATHLEN; 787 auio.uio_iov = &aiov; 788 auio.uio_iovcnt = 1; 789 auio.uio_offset = 0; 790 auio.uio_rw = UIO_READ; --- 491 unchanged lines hidden (view full) --- 1282nfsm_clget_xx(u_int32_t **tl, struct mbuf *mb, struct mbuf **mp, 1283 char **bp, char **be, caddr_t bpos) 1284{ 1285 struct mbuf *nmp; 1286 1287 if (*bp >= *be) { 1288 if (*mp == mb) 1289 (*mp)->m_len += *bp - bpos; |
1290 MGET(nmp, M_TRYWAIT, MT_DATA); 1291 MCLGET(nmp, M_TRYWAIT); | 1290 MGET(nmp, 0, MT_DATA); 1291 MCLGET(nmp, 0); |
1292 nmp->m_len = NFSMSIZ(nmp); 1293 (*mp)->m_next = nmp; 1294 *mp = nmp; 1295 *bp = mtod(*mp, caddr_t); 1296 *be = *bp + (*mp)->m_len; 1297 } 1298 *tl = (u_int32_t *)*bp; 1299} --- 100 unchanged lines hidden --- | 1292 nmp->m_len = NFSMSIZ(nmp); 1293 (*mp)->m_next = nmp; 1294 *mp = nmp; 1295 *bp = mtod(*mp, caddr_t); 1296 *be = *bp + (*mp)->m_len; 1297 } 1298 *tl = (u_int32_t *)*bp; 1299} --- 100 unchanged lines hidden --- |