Replace all instances of the typedef mbuf_t with "struct mbuf *".

The typedef mbuf_t was used for the Mac OS/X port of the code long ago.
Since this port is no longer used and the use of mbuf_t obscures what
the code does (and is not consistent with style(9)), it is no longer needed.
This patch replaces all instances of mbuf_t with "struct mbuf *", so that
it is no longer used.

This patch should not result in any semantic change.
This commit is contained in:
Rick Macklem
2020-04-17 21:17:51 +00:00
parent f953e7317a
commit ae070589d3
8 changed files with 31 additions and 31 deletions
+4 -4
View File
@@ -638,10 +638,10 @@ struct nfsgss_mechlist {
* This structure is used by the server for describing each request. * This structure is used by the server for describing each request.
*/ */
struct nfsrv_descript { struct nfsrv_descript {
mbuf_t nd_mrep; /* Request mbuf list */ struct mbuf *nd_mrep; /* Request mbuf list */
mbuf_t nd_md; /* Current dissect mbuf */ struct mbuf *nd_md; /* Current dissect mbuf */
mbuf_t nd_mreq; /* Reply mbuf list */ struct mbuf *nd_mreq; /* Reply mbuf list */
mbuf_t nd_mb; /* Current build mbuf */ struct mbuf *nd_mb; /* Current build mbuf */
NFSSOCKADDR_T nd_nam; /* and socket addr */ NFSSOCKADDR_T nd_nam; /* and socket addr */
NFSSOCKADDR_T nd_nam2; /* return socket addr */ NFSSOCKADDR_T nd_nam2; /* return socket addr */
caddr_t nd_dpos; /* Current dissect pos */ caddr_t nd_dpos; /* Current dissect pos */
+8 -8
View File
@@ -611,7 +611,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz)
{ {
char *mbufcp, *uiocp; char *mbufcp, *uiocp;
int xfer, left, len; int xfer, left, len;
mbuf_t mp; struct mbuf *mp;
long uiosiz, rem; long uiosiz, rem;
int error = 0; int error = 0;
@@ -694,7 +694,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio *uiop, int siz)
APPLESTATIC void * APPLESTATIC void *
nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) nfsm_dissct(struct nfsrv_descript *nd, int siz, int how)
{ {
mbuf_t mp2; struct mbuf *mp2;
int siz2, xfer; int siz2, xfer;
caddr_t p; caddr_t p;
int left; int left;
@@ -808,9 +808,9 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int left)
APPLESTATIC int APPLESTATIC int
nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz)
{ {
mbuf_t m2; struct mbuf *m2;
int xfer, left; int xfer, left;
mbuf_t m1; struct mbuf *m1;
int rem, bytesize; int rem, bytesize;
u_int32_t *tl; u_int32_t *tl;
char *cp2; char *cp2;
@@ -1014,7 +1014,7 @@ APPLESTATIC void
newnfs_trimleading(nd) newnfs_trimleading(nd)
struct nfsrv_descript *nd; struct nfsrv_descript *nd;
{ {
mbuf_t m, n; struct mbuf *m, *n;
int offs; int offs;
/* /*
@@ -1059,7 +1059,7 @@ newnfs_trimleading(nd)
APPLESTATIC void APPLESTATIC void
newnfs_trimtrailing(nd, mb, bpos) newnfs_trimtrailing(nd, mb, bpos)
struct nfsrv_descript *nd; struct nfsrv_descript *nd;
mbuf_t mb; struct mbuf *mb;
caddr_t bpos; caddr_t bpos;
{ {
@@ -2423,7 +2423,7 @@ nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz)
{ {
char *cp; char *cp;
int xfer, len; int xfer, len;
mbuf_t mp; struct mbuf *mp;
int rem, error = 0; int rem, error = 0;
mp = nd->nd_md; mp = nd->nd_md;
@@ -4437,7 +4437,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char **cpp2, int *slenp)
APPLESTATIC void APPLESTATIC void
nfsrvd_rephead(struct nfsrv_descript *nd) nfsrvd_rephead(struct nfsrv_descript *nd)
{ {
mbuf_t mreq; struct mbuf *mreq;
/* /*
* If this is a big reply, use a cluster. * If this is a big reply, use a cluster.
+7 -7
View File
@@ -325,7 +325,7 @@ int nfsm_fhtom(struct nfsrv_descript *, u_int8_t *, int, int);
int nfsm_advance(struct nfsrv_descript *, int, int); int nfsm_advance(struct nfsrv_descript *, int, int);
void *nfsm_dissct(struct nfsrv_descript *, int, int); void *nfsm_dissct(struct nfsrv_descript *, int, int);
void newnfs_trimleading(struct nfsrv_descript *); void newnfs_trimleading(struct nfsrv_descript *);
void newnfs_trimtrailing(struct nfsrv_descript *, mbuf_t, void newnfs_trimtrailing(struct nfsrv_descript *, struct mbuf *,
caddr_t); caddr_t);
void newnfs_copycred(struct nfscred *, struct ucred *); void newnfs_copycred(struct nfscred *, struct ucred *);
void newnfs_copyincred(struct ucred *, struct nfscred *); void newnfs_copyincred(struct ucred *, struct nfscred *);
@@ -390,7 +390,7 @@ int nfsv4_fillattr(struct nfsrv_descript *, struct mount *, vnode_t, NFSACL_T *,
struct vattr *, fhandle_t *, int, nfsattrbit_t *, struct vattr *, fhandle_t *, int, nfsattrbit_t *,
struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *); struct ucred *, NFSPROC_T *, int, int, int, int, uint64_t, struct statfs *);
void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *); void nfsrv_fillattr(struct nfsrv_descript *, struct nfsvattr *);
void nfsrv_adj(mbuf_t, int, int); void nfsrv_adj(struct mbuf *, int, int);
void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *); void nfsrv_postopattr(struct nfsrv_descript *, int, struct nfsvattr *);
int nfsd_errmap(struct nfsrv_descript *); int nfsd_errmap(struct nfsrv_descript *);
void nfsv4_uidtostr(uid_t, u_char **, int *); void nfsv4_uidtostr(uid_t, u_char **, int *);
@@ -679,12 +679,12 @@ int nfsvno_namei(struct nfsrv_descript *, struct nameidata *,
vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *); vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *);
void nfsvno_setpathbuf(struct nameidata *, char **, u_long **); void nfsvno_setpathbuf(struct nameidata *, char **, u_long **);
void nfsvno_relpathbuf(struct nameidata *); void nfsvno_relpathbuf(struct nameidata *);
int nfsvno_readlink(vnode_t, struct ucred *, NFSPROC_T *, mbuf_t *, int nfsvno_readlink(vnode_t, struct ucred *, NFSPROC_T *, struct mbuf **,
mbuf_t *, int *); struct mbuf **, int *);
int nfsvno_read(vnode_t, off_t, int, struct ucred *, NFSPROC_T *, int nfsvno_read(vnode_t, off_t, int, struct ucred *, NFSPROC_T *,
mbuf_t *, mbuf_t *); struct mbuf **, struct mbuf **);
int nfsvno_write(vnode_t, off_t, int, int *, mbuf_t, char *, struct ucred *, int nfsvno_write(vnode_t, off_t, int, int *, struct mbuf *, char *,
NFSPROC_T *); struct ucred *, NFSPROC_T *);
int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *, int nfsvno_createsub(struct nfsrv_descript *, struct nameidata *,
vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T, vnode_t *, struct nfsvattr *, int *, int32_t *, NFSDEV_T,
struct nfsexstuff *); struct nfsexstuff *);
+1 -1
View File
@@ -53,7 +53,7 @@ struct nfsrvcache {
u_int32_t rc_xid; /* rpc id number */ u_int32_t rc_xid; /* rpc id number */
time_t rc_timestamp; /* Time done */ time_t rc_timestamp; /* Time done */
union { union {
mbuf_t repmb; /* Reply mbuf list OR */ struct mbuf *repmb; /* Reply mbuf list OR */
int repstat; /* Reply status */ int repstat; /* Reply status */
} rc_un; } rc_un;
union { union {
+4 -4
View File
@@ -285,7 +285,7 @@ static void nfsrc_lock(struct nfsrvcache *rp);
static void nfsrc_unlock(struct nfsrvcache *rp); static void nfsrc_unlock(struct nfsrvcache *rp);
static void nfsrc_wanted(struct nfsrvcache *rp); static void nfsrc_wanted(struct nfsrvcache *rp);
static void nfsrc_freecache(struct nfsrvcache *rp); static void nfsrc_freecache(struct nfsrvcache *rp);
static int nfsrc_getlenandcksum(mbuf_t m1, u_int16_t *cksum); static int nfsrc_getlenandcksum(struct mbuf *m1, u_int16_t *cksum);
static void nfsrc_marksametcpconn(u_int64_t); static void nfsrc_marksametcpconn(u_int64_t);
/* /*
@@ -460,7 +460,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd)
{ {
struct nfsrvcache *rp; struct nfsrvcache *rp;
struct nfsrvcache *retrp = NULL; struct nfsrvcache *retrp = NULL;
mbuf_t m; struct mbuf *m;
struct mtx *mutex; struct mtx *mutex;
rp = nd->nd_rp; rp = nd->nd_rp;
@@ -1013,10 +1013,10 @@ nfsrvd_derefcache(struct nfsrvcache *rp)
* NFSRVCACHE_CHECKLEN bytes. * NFSRVCACHE_CHECKLEN bytes.
*/ */
static int static int
nfsrc_getlenandcksum(mbuf_t m1, u_int16_t *cksum) nfsrc_getlenandcksum(struct mbuf *m1, u_int16_t *cksum)
{ {
int len = 0, cklen; int len = 0, cklen;
mbuf_t m; struct mbuf *m;
m = m1; m = m1;
while (m) { while (m) {
+3 -3
View File
@@ -665,7 +665,7 @@ nfsrvd_readlink(struct nfsrv_descript *nd, __unused int isdgram,
vnode_t vp, __unused struct nfsexstuff *exp) vnode_t vp, __unused struct nfsexstuff *exp)
{ {
u_int32_t *tl; u_int32_t *tl;
mbuf_t mp = NULL, mpend = NULL; struct mbuf *mp = NULL, *mpend = NULL;
int getret = 1, len; int getret = 1, len;
struct nfsvattr nva; struct nfsvattr nva;
struct thread *p = curthread; struct thread *p = curthread;
@@ -710,7 +710,7 @@ nfsrvd_read(struct nfsrv_descript *nd, __unused int isdgram,
{ {
u_int32_t *tl; u_int32_t *tl;
int error = 0, cnt, getret = 1, gotproxystateid, reqlen, eof = 0; int error = 0, cnt, getret = 1, gotproxystateid, reqlen, eof = 0;
mbuf_t m2, m3; struct mbuf *m2, *m3;
struct nfsvattr nva; struct nfsvattr nva;
off_t off = 0x0; off_t off = 0x0;
struct nfsstate st, *stp = &st; struct nfsstate st, *stp = &st;
@@ -5532,7 +5532,7 @@ nfsrvd_getxattr(struct nfsrv_descript *nd, __unused int isdgram,
vnode_t vp, __unused struct nfsexstuff *exp) vnode_t vp, __unused struct nfsexstuff *exp)
{ {
uint32_t *tl; uint32_t *tl;
mbuf_t mp = NULL, mpend = NULL; struct mbuf *mp = NULL, *mpend = NULL;
int error, len; int error, len;
char *name; char *name;
struct thread *p = curthread; struct thread *p = curthread;
+1 -1
View File
@@ -4417,7 +4417,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp,
int trunc, fhandle_t *fhp, struct nfsvattr *nap, nfsattrbit_t *attrbitp, int trunc, fhandle_t *fhp, struct nfsvattr *nap, nfsattrbit_t *attrbitp,
int laytype, NFSPROC_T *p) int laytype, NFSPROC_T *p)
{ {
mbuf_t m; struct mbuf *m;
u_int32_t *tl; u_int32_t *tl;
struct nfsrv_descript *nd; struct nfsrv_descript *nd;
struct ucred *cred; struct ucred *cred;
+3 -3
View File
@@ -1274,9 +1274,9 @@ static short *nfsrv_v4errmap[] = {
* boundary and only trims off the back end * boundary and only trims off the back end
*/ */
APPLESTATIC void APPLESTATIC void
nfsrv_adj(mbuf_t mp, int len, int nul) nfsrv_adj(struct mbuf *mp, int len, int nul)
{ {
mbuf_t m; struct mbuf *m;
int count, i; int count, i;
char *cp; char *cp;
@@ -1838,7 +1838,7 @@ nfsrv_parsename(struct nfsrv_descript *nd, char *bufp, u_long *hashp,
NFSPATHLEN_T *outlenp) NFSPATHLEN_T *outlenp)
{ {
char *fromcp, *tocp, val = '\0'; char *fromcp, *tocp, val = '\0';
mbuf_t md; struct mbuf *md;
int i; int i;
int rem, len, error = 0, pubtype = 0, outlen = 0, percent = 0; int rem, len, error = 0, pubtype = 0, outlen = 0, percent = 0;
char digit; char digit;