From owner-svn-src-head@FreeBSD.ORG Tue Mar 12 13:42:49 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A912F313; Tue, 12 Mar 2013 13:42:49 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D11EA23; Tue, 12 Mar 2013 13:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2CDgnfd096144; Tue, 12 Mar 2013 13:42:49 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2CDgl72096130; Tue, 12 Mar 2013 13:42:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201303121342.r2CDgl72096130@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 12 Mar 2013 13:42:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248207 - in head/sys: arm/at91 kern net netinet/libalias netpfil/pf nfs nfsclient sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2013 13:42:49 -0000 Author: glebius Date: Tue Mar 12 13:42:47 2013 New Revision: 248207 URL: http://svnweb.freebsd.org/changeset/base/248207 Log: Functions m_getm2() and m_get2() have different order of arguments, and that can drive someone crazy. While m_get2() is young and not documented yet, change its order of arguments to match m_getm2(). Sorry for churn, but better now than later. Modified: head/sys/arm/at91/if_ate.c head/sys/kern/uipc_mbuf.c head/sys/net/bpf.c head/sys/netinet/libalias/alias.c head/sys/netpfil/pf/if_pfsync.c head/sys/nfs/krpc_subr.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/mbuf.h Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/arm/at91/if_ate.c Tue Mar 12 13:42:47 2013 (r248207) @@ -900,8 +900,8 @@ ate_intr(void *xsc) remain = (sc->rx_descs[idx].status & ETH_LEN_MASK) - 4; /* Get an appropriately sized mbuf. */ - mb = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, - remain + ETHER_ALIGN); + mb = m_get2(remain + ETHER_ALIGN, M_NOWAIT, MT_DATA, + M_PKTHDR); if (mb == NULL) { sc->ifp->if_iqdrops++; rxdhead->status = 0; Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/kern/uipc_mbuf.c Tue Mar 12 13:42:47 2013 (r248207) @@ -88,7 +88,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, m_defrag * m_get2() allocates minimum mbuf that would fit "size" argument. */ struct mbuf * -m_get2(int how, short type, int flags, int size) +m_get2(int size, int how, short type, int flags) { struct mb_args args; struct mbuf *m, *n; Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/net/bpf.c Tue Mar 12 13:42:47 2013 (r248207) @@ -525,7 +525,7 @@ bpf_movein(struct uio *uio, int linktype if (len < hlen || len - hlen > ifp->if_mtu) return (EMSGSIZE); - m = m_get2(M_WAITOK, MT_DATA, M_PKTHDR, len); + m = m_get2(len, M_WAITOK, MT_DATA, M_PKTHDR); if (m == NULL) return (EIO); m->m_pkthdr.len = m->m_len = len; Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/netinet/libalias/alias.c Tue Mar 12 13:42:47 2013 (r248207) @@ -1760,7 +1760,7 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m) && M_TRAILINGSPACE(m) >= RESERVE) return (m); - mcl = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, len + RESERVE); + mcl = m_get2(len + RESERVE, M_NOWAIT, MT_DATA, M_PKTHDR); if (mcl == NULL) goto bad; Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/netpfil/pf/if_pfsync.c Tue Mar 12 13:42:47 2013 (r248207) @@ -1505,7 +1505,7 @@ pfsync_sendout(int schedswi) return; } - m = m_get2(M_NOWAIT, MT_DATA, M_PKTHDR, max_linkhdr + sc->sc_len); + m = m_get2(max_linkhdr + sc->sc_len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { sc->sc_ifp->if_oerrors++; V_pfsyncstats.pfsyncs_onomem++; Modified: head/sys/nfs/krpc_subr.c ============================================================================== --- head/sys/nfs/krpc_subr.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/nfs/krpc_subr.c Tue Mar 12 13:42:47 2013 (r248207) @@ -459,7 +459,7 @@ xdr_string_encode(char *str, int len) if (mlen > MCLBYTES) /* If too big, we just can't do it. */ return (NULL); - m = m_get2(M_WAITOK, MT_DATA, 0, mlen); + m = m_get2(mlen, M_WAITOK, MT_DATA, 0); xs = mtod(m, struct xdr_string *); m->m_len = mlen; xs->len = txdr_unsigned(len); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/nfsclient/nfs_vfsops.c Tue Mar 12 13:42:47 2013 (r248207) @@ -298,7 +298,7 @@ nfs_statfs(struct mount *mp, struct stat } else mtx_unlock(&nmp->nm_mtx); nfsstats.rpccnt[NFSPROC_FSSTAT]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3)); + mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -356,7 +356,7 @@ nfs_fsinfo(struct nfsmount *nmp, struct u_int64_t maxfsize; nfsstats.rpccnt[NFSPROC_FSINFO]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(1)); + mreq = m_get2(NFSX_FH(1), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, 1); Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/nfsclient/nfs_vnops.c Tue Mar 12 13:42:47 2013 (r248207) @@ -294,7 +294,7 @@ nfs3_access_otw(struct vnode *vp, int wm struct nfsnode *np = VTONFS(vp); nfsstats.rpccnt[NFSPROC_ACCESS]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + NFSX_UNSIGNED); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED, M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -714,7 +714,7 @@ nfs_getattr(struct vop_getattr_args *ap) goto nfsmout; } nfsstats.rpccnt[NFSPROC_GETATTR]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3)); + mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -873,7 +873,7 @@ nfs_setattrrpc(struct vnode *vp, struct int v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_SETATTR]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + NFSX_SATTR(v3)); + mreq = m_get2(NFSX_FH(v3) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -1037,8 +1037,8 @@ nfs_lookup(struct vop_lookup_args *ap) nfsstats.lookupcache_misses++; nfsstats.rpccnt[NFSPROC_LOOKUP]++; len = cnp->cn_namelen; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len)); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len), M_WAITOK, + MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -1251,7 +1251,7 @@ nfs_readlinkrpc(struct vnode *vp, struct int v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_READLINK]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3)); + mreq = m_get2(NFSX_FH(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -1306,8 +1306,8 @@ nfs_readrpc(struct vnode *vp, struct uio while (tsiz > 0) { nfsstats.rpccnt[NFSPROC_READ]++; len = (tsiz > rsize) ? rsize : tsiz; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED * 3); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED * 3, M_WAITOK, + MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -1379,8 +1379,8 @@ nfs_writerpc(struct vnode *vp, struct ui while (tsiz > 0) { nfsstats.rpccnt[NFSPROC_WRITE]++; len = (tsiz > wsize) ? wsize : tsiz; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len)); + mreq = m_get2(NFSX_FH(v3) + 5 * NFSX_UNSIGNED + nfsm_rndup(len), + M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -1502,8 +1502,8 @@ nfs_mknodrpc(struct vnode *dvp, struct v if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) return (error); nfsstats.rpccnt[NFSPROC_MKNOD]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 4 * NFSX_UNSIGNED + - nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3)); + mreq = m_get2(NFSX_FH(v3) + 4 * NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -1606,8 +1606,8 @@ nfs_create(struct vop_create_args *ap) fmode |= O_EXCL; again: nfsstats.rpccnt[NFSPROC_CREATE]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 2 * NFSX_UNSIGNED + - nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3)); + mreq = m_get2(NFSX_FH(v3) + 2 * NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen) + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -1788,8 +1788,8 @@ nfs_removerpc(struct vnode *dvp, const c int v3 = NFS_ISV3(dvp); nfsstats.rpccnt[NFSPROC_REMOVE]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen)); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(namelen), + M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -1924,8 +1924,8 @@ nfs_renamerpc(struct vnode *fdvp, const int v3 = NFS_ISV3(fdvp); nfsstats.rpccnt[NFSPROC_RENAME]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, (NFSX_FH(v3) + NFSX_UNSIGNED)*2 + - nfsm_rndup(fnamelen) + nfsm_rndup(tnamelen)); + mreq = m_get2((NFSX_FH(v3) + NFSX_UNSIGNED)*2 + nfsm_rndup(fnamelen) + + nfsm_rndup(tnamelen), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(fdvp, v3); @@ -1983,8 +1983,8 @@ nfs_link(struct vop_link_args *ap) v3 = NFS_ISV3(vp); nfsstats.rpccnt[NFSPROC_LINK]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3)*2 + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen)); + mreq = m_get2(NFSX_FH(v3)*2 + NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -2029,8 +2029,9 @@ nfs_symlink(struct vop_symlink_args *ap) nfsstats.rpccnt[NFSPROC_SYMLINK]++; slen = strlen(ap->a_target); - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(v3) + 2*NFSX_UNSIGNED + - nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3)); + mreq = m_get2(NFSX_FH(v3) + 2*NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3), + M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -2123,8 +2124,8 @@ nfs_mkdir(struct vop_mkdir_args *ap) return (error); len = cnp->cn_namelen; nfsstats.rpccnt[NFSPROC_MKDIR]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) + NFSX_SATTR(v3)); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len) + + NFSX_SATTR(v3), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -2188,8 +2189,8 @@ nfs_rmdir(struct vop_rmdir_args *ap) if (dvp == vp) return (EINVAL); nfsstats.rpccnt[NFSPROC_RMDIR]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(cnp->cn_namelen)); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + + nfsm_rndup(cnp->cn_namelen), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -2307,8 +2308,8 @@ nfs_readdirrpc(struct vnode *vp, struct */ while (more_dirs && bigenough) { nfsstats.rpccnt[NFSPROC_READDIR]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_READDIR(v3)); + mreq = m_get2(NFSX_FH(v3) + NFSX_READDIR(v3), M_WAITOK, + MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, v3); @@ -2513,8 +2514,8 @@ nfs_readdirplusrpc(struct vnode *vp, str */ while (more_dirs && bigenough) { nfsstats.rpccnt[NFSPROC_READDIRPLUS]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(1) + 6 * NFSX_UNSIGNED); + mreq = m_get2(NFSX_FH(1) + 6 * NFSX_UNSIGNED, M_WAITOK, + MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, 1); @@ -2818,8 +2819,8 @@ nfs_lookitup(struct vnode *dvp, const ch int v3 = NFS_ISV3(dvp); nfsstats.rpccnt[NFSPROC_LOOKUP]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, - NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len)); + mreq = m_get2(NFSX_FH(v3) + NFSX_UNSIGNED + nfsm_rndup(len), + M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(dvp, v3); @@ -2897,7 +2898,7 @@ nfs_commit(struct vnode *vp, u_quad_t of } mtx_unlock(&nmp->nm_mtx); nfsstats.rpccnt[NFSPROC_COMMIT]++; - mreq = m_get2(M_WAITOK, MT_DATA, 0, NFSX_FH(1)); + mreq = m_get2(NFSX_FH(1), M_WAITOK, MT_DATA, 0); mb = mreq; bpos = mtod(mb, caddr_t); nfsm_fhtom(vp, 1); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Tue Mar 12 13:29:24 2013 (r248206) +++ head/sys/sys/mbuf.h Tue Mar 12 13:42:47 2013 (r248207) @@ -801,7 +801,7 @@ int m_dup_pkthdr(struct mbuf *, struct u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); -struct mbuf *m_get2(int, short, int, int); +struct mbuf *m_get2(int, int, short, int); struct mbuf *m_getjcl(int, short, int, int); struct mbuf *m_getm2(struct mbuf *, int, int, short, int); struct mbuf *m_getptr(struct mbuf *, int, int *);