From eae6da3db482f5bc3ca3b02d2ea44dc5f1fc2874 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 7 Jan 2015 17:22:56 +0000 Subject: [PATCH] Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro in the NFS server; garbage collect now-unused NFSMSIZ() and M_HASCL() macros. Also garbage collect now-unused versions in headers for the removed previous NFS client and server. Reviewed by: rmacklem Sponsored by: EMC / Isilon Storage Division --- sys/fs/nfs/nfsm_subs.h | 3 --- sys/fs/nfsserver/nfs_nfsdport.c | 2 +- sys/nfsserver/nfsm_subs.h | 8 -------- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/sys/fs/nfs/nfsm_subs.h b/sys/fs/nfs/nfsm_subs.h index 0c31f56a32c..5f102d35791 100644 --- a/sys/fs/nfs/nfsm_subs.h +++ b/sys/fs/nfs/nfsm_subs.h @@ -46,9 +46,6 @@ /* * First define what the actual subs. return */ -#define M_HASCL(m) ((m)->m_flags & M_EXT) -#define NFSMSIZ(m) ((M_HASCL(m))?MCLBYTES: \ - (((m)->m_flags & M_PKTHDR)?MHLEN:MLEN)) #define NFSM_DATAP(m, s) (m)->m_data += (s) /* diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 17ca5a693ca..0ea48cdc856 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -575,7 +575,7 @@ nfsvno_readlink(struct vnode *vp, struct ucred *cred, struct thread *p, while (len < NFS_MAXPATHLEN) { NFSMGET(mp); MCLGET(mp, M_WAITOK); - mp->m_len = NFSMSIZ(mp); + mp->m_len = M_SIZE(mp); if (len == 0) { mp3 = mp2 = mp; } else { diff --git a/sys/nfsserver/nfsm_subs.h b/sys/nfsserver/nfsm_subs.h index fc9b76daa93..5bf4ca97b20 100644 --- a/sys/nfsserver/nfsm_subs.h +++ b/sys/nfsserver/nfsm_subs.h @@ -46,14 +46,6 @@ * other purpose will be dangerous. (they make weird assumptions) */ -/* - * First define what the actual subs. return - */ - -#define M_HASCL(m) ((m)->m_flags & M_EXT) -#define NFSMSIZ(m) ((M_HASCL(m))?MCLBYTES: \ - (((m)->m_flags & M_PKTHDR)?MHLEN:MLEN)) - /* * Now for the macros that do the simple stuff and call the functions * for the hard stuff.