summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2010-03-30 19:52:45 +0000
committerMarius Strobl <marius@FreeBSD.org>2010-03-30 19:52:45 +0000
commit5416fb7aa435734955936afcfeb082eb2043921f (patch)
treed426746927319e56436946bf9bb63f0d13135988 /sys
parentd7ef2f0c92199b7883ffd2f9b429fe33d8422ca3 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_common.c43
-rw-r--r--sys/nfs/nfs_common.h3
2 files changed, 24 insertions, 22 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c
index 54c3f418f9ff..4aebe12a8bdd 100644
--- a/sys/nfs/nfs_common.c
+++ b/sys/nfs/nfs_common.c
@@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
/*
* These functions support the macros and help fiddle mbuf chains for
- * the nfs op functions. They do things like create the rpc header and
+ * the nfs op functions. They do things like create the rpc header and
* copy data between mbuf chains and uio lists.
*/
@@ -76,10 +76,11 @@ nfstype nfsv3_type[9] = {
NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON
};
-static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how);
+static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos,
+ int how);
u_quad_t
-nfs_curusec(void)
+nfs_curusec(void)
{
struct timeval tv;
@@ -177,7 +178,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *dposp, int siz, int left, int how)
while (left == 0) {
*mdp = mp = mp->m_next;
if (mp == NULL)
- return NULL;
+ return (NULL);
left = mp->m_len;
*dposp = mtod(mp, caddr_t);
}
@@ -185,13 +186,13 @@ nfsm_disct(struct mbuf **mdp, caddr_t *dposp, int siz, int left, int how)
ret = *dposp;
*dposp += siz;
} else if (mp->m_next == NULL) {
- return NULL;
+ return (NULL);
} else if (siz > MHLEN) {
panic("nfs S too big");
} else {
MGET(mp2, how, MT_DATA);
if (mp2 == NULL)
- return NULL;
+ return (NULL);
mp2->m_len = siz;
mp2->m_next = mp->m_next;
mp->m_next = mp2;
@@ -207,7 +208,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *dposp, int siz, int left, int how)
/* Loop around copying up the siz2 bytes */
while (siz2 > 0) {
if (mp2 == NULL)
- return NULL;
+ return (NULL);
xfer = (siz2 > mp2->m_len) ? mp2->m_len : siz2;
if (xfer > 0) {
bcopy(mtod(mp2, caddr_t), ptr, xfer);
@@ -230,7 +231,7 @@ nfsm_disct(struct mbuf **mdp, caddr_t *dposp, int siz, int left, int how)
*dposp = npos;
}
}
- return ret;
+ return (ret);
}
/*
@@ -274,19 +275,21 @@ nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos)
ret = *bpos;
(*mb)->m_len += s;
*bpos += s;
- return ret;
+ return (ret);
}
void *
nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos)
{
- return nfsm_dissect_xx_sub(s, md, dpos, M_TRYWAIT);
+
+ return (nfsm_dissect_xx_sub(s, md, dpos, M_TRYWAIT));
}
void *
nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos)
{
- return nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT);
+
+ return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT));
}
static void *
@@ -300,10 +303,10 @@ nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how)
if (t1 >= s) {
ret = *dpos;
*dpos += s;
- return ret;
+ return (ret);
}
- cp2 = nfsm_disct(md, dpos, s, t1, how);
- return cp2;
+ cp2 = nfsm_disct(md, dpos, s, t1, how);
+ return (cp2);
}
int
@@ -313,11 +316,11 @@ nfsm_strsiz_xx(int *s, int m, struct mbuf **mb, caddr_t *bpos)
tl = nfsm_dissect_xx(NFSX_UNSIGNED, mb, bpos);
if (tl == NULL)
- return EBADRPC;
+ return (EBADRPC);
*s = fxdr_unsigned(int32_t, *tl);
if (*s > m)
- return EBADRPC;
- return 0;
+ return (EBADRPC);
+ return (0);
}
int
@@ -328,10 +331,10 @@ nfsm_adv_xx(int s, struct mbuf **md, caddr_t *dpos)
t1 = mtod(*md, caddr_t) + (*md)->m_len - *dpos;
if (t1 >= s) {
*dpos += s;
- return 0;
+ return (0);
}
t1 = nfs_adv(md, dpos, s, t1);
if (t1)
- return t1;
- return 0;
+ return (t1);
+ return (0);
}
diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h
index 7c0613095939..9ad1c1139a6b 100644
--- a/sys/nfs/nfs_common.h
+++ b/sys/nfs/nfs_common.h
@@ -33,7 +33,6 @@
* $FreeBSD$
*/
-
#ifndef _NFS_NFS_COMMON_H_
#define _NFS_NFS_COMMON_H_
@@ -86,7 +85,7 @@ do { \
goto nfsmout; \
} \
} while (0)
-
+
#define nfsm_dissect(c, s) \
({ \
void *ret; \