Author: rmacklem
Date: Sat Apr 25 02:18:59 2020
New Revision: 360289
URL: https://svnweb.freebsd.org/changeset/base/360289

Log:
  Remove Mac OS/X macros that did nothing for FreeBSD.
  
  The macros CAST_USER_ADDR_T() and CAST_DOWN() were used for the Mac OS/X
  port. The first of these macros was a no-op for FreeBSD and the second
  is no longer used.
  This patch gets rid of them. It also deletes the "mbuf_t" typedef which
  is no longer used in the FreeBSD code from nfskpiport.h
  
  This patch should not change semantics.

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfs/nfskpiport.h
  head/sys/fs/nfsclient/nfs_clcomsubs.c
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonsubs.c    Sat Apr 25 00:57:48 2020        
(r360288)
+++ head/sys/fs/nfs/nfs_commonsubs.c    Sat Apr 25 02:18:59 2020        
(r360289)
@@ -652,7 +652,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *ui
                        if (uiop->uio_segflg == UIO_SYSSPACE)
                                NFSBCOPY(mbufcp, uiocp, xfer);
                        else
-                               copyout(mbufcp, CAST_USER_ADDR_T(uiocp), xfer);
+                               copyout(mbufcp, uiocp, xfer);
                        left -= xfer;
                        len -= xfer;
                        mbufcp += xfer;
@@ -3759,8 +3759,7 @@ nfssvc_idname(struct nfsd_idargs *nidp)
        }
        if (nidp->nid_flag & NFSID_INITIALIZE) {
                cp = malloc(nidp->nid_namelen + 1, M_NFSSTRING, M_WAITOK);
-               error = copyin(CAST_USER_ADDR_T(nidp->nid_name), cp,
-                   nidp->nid_namelen);
+               error = copyin(nidp->nid_name, cp, nidp->nid_namelen);
                if (error != 0) {
                        free(cp, M_NFSSTRING);
                        goto out;
@@ -3856,13 +3855,13 @@ nfssvc_idname(struct nfsd_idargs *nidp)
         */
        newusrp = malloc(sizeof(struct nfsusrgrp) + nidp->nid_namelen,
            M_NFSUSERGROUP, M_WAITOK | M_ZERO);
-       error = copyin(CAST_USER_ADDR_T(nidp->nid_name), newusrp->lug_name,
+       error = copyin(nidp->nid_name, newusrp->lug_name,
            nidp->nid_namelen);
        if (error == 0 && nidp->nid_ngroup > 0 &&
            (nidp->nid_flag & NFSID_ADDUID) != 0) {
                grps = malloc(sizeof(gid_t) * nidp->nid_ngroup, M_TEMP,
                    M_WAITOK);
-               error = copyin(CAST_USER_ADDR_T(nidp->nid_grps), grps,
+               error = copyin(nidp->nid_grps, grps,
                    sizeof(gid_t) * nidp->nid_ngroup);
                if (error == 0) {
                        /*

Modified: head/sys/fs/nfs/nfskpiport.h
==============================================================================
--- head/sys/fs/nfs/nfskpiport.h        Sat Apr 25 00:57:48 2020        
(r360288)
+++ head/sys/fs/nfs/nfskpiport.h        Sat Apr 25 02:18:59 2020        
(r360289)
@@ -43,13 +43,9 @@ typedef struct vnode *               vnode_t;
 #define        vnode_mount(v)          ((v)->v_mount)
 #define        vnode_vtype(v)          ((v)->v_type)
 
-typedef struct mbuf *          mbuf_t;
-
 /*
  * This stuff is needed by Darwin for handling the uio structure.
  */
-#define        CAST_USER_ADDR_T(a)     (a)
-#define        CAST_DOWN(c, a)         ((c) (a))
 #define        uio_uio_resid(p)        ((p)->uio_resid)
 #define        uio_uio_resid_add(p, v) ((p)->uio_resid += (v))
 #define        uio_uio_resid_set(p, v) ((p)->uio_resid = (v))

Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clcomsubs.c       Sat Apr 25 00:57:48 2020        
(r360288)
+++ head/sys/fs/nfsclient/nfs_clcomsubs.c       Sat Apr 25 02:18:59 2020        
(r360289)
@@ -105,8 +105,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui
                            NFSBCOPY(uiocp, mtod(mp, caddr_t) + mp->m_len,
                                xfer);
                        else
-                           copyin(CAST_USER_ADDR_T(uiocp), mtod(mp, caddr_t)
-                               + mp->m_len, xfer);
+                           copyin(uiocp, mtod(mp, caddr_t) + mp->m_len, xfer);
                        mp->m_len += xfer;
                        left -= xfer;
                        uiocp += xfer;

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c        Sat Apr 25 00:57:48 2020        
(r360288)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c        Sat Apr 25 02:18:59 2020        
(r360289)
@@ -3712,8 +3712,7 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u
                    len = sizeof (struct nfsd_dumpclients) * dumplist.ndl_size;
                    dumpclients = malloc(len, M_TEMP, M_WAITOK | M_ZERO);
                    nfsrv_dumpclients(dumpclients, dumplist.ndl_size);
-                   error = copyout(dumpclients,
-                       CAST_USER_ADDR_T(dumplist.ndl_list), len);
+                   error = copyout(dumpclients, dumplist.ndl_list, len);
                    free(dumpclients, M_TEMP);
                }
        } else if (uap->flag & NFSSVC_DUMPLOCKS) {
@@ -3732,8 +3731,8 @@ nfssvc_srvcall(struct thread *p, struct nfssvc_args *u
                        nfsrv_dumplocks(nd.ni_vp, dumplocks,
                            dumplocklist.ndllck_size, p);
                        vput(nd.ni_vp);
-                       error = copyout(dumplocks,
-                           CAST_USER_ADDR_T(dumplocklist.ndllck_list), len);
+                       error = copyout(dumplocks, dumplocklist.ndllck_list,
+                           len);
                        free(dumplocks, M_TEMP);
                }
        } else if (uap->flag & NFSSVC_BACKUPSTABLE) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to