summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_common.h
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2004-12-06 17:33:52 +0000
committerps <ps@FreeBSD.org>2004-12-06 17:33:52 +0000
commit5feadd3eba463ffad1e8b8e55a5ff30c5ccc861a (patch)
tree534a6e09b19a42319606629ce43460d95a24d8ef /sys/nfs/nfs_common.h
parente196d800834b17b34ab2b098462739d2da4b3a24 (diff)
downloadFreeBSD-src-5feadd3eba463ffad1e8b8e55a5ff30c5ccc861a.zip
FreeBSD-src-5feadd3eba463ffad1e8b8e55a5ff30c5ccc861a.tar.gz
Add non-blocking versions of nfsm_dissect() and friends, for use from
socket callbacks or similar callers, from both the NFS client and the server. Instituted nfsm_dissect_nonblock(), nfsm_dissect_xx_nonblock(). And nfsm_disct() now takes an extra M_TRYWAIT/M_DONTWAIT argument. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfs/nfs_common.h')
-rw-r--r--sys/nfs/nfs_common.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h
index f68dad1..877b351 100644
--- a/sys/nfs/nfs_common.h
+++ b/sys/nfs/nfs_common.h
@@ -48,7 +48,7 @@ extern nfstype nfsv3_type[];
int nfs_adv(struct mbuf **, caddr_t *, int, int);
u_quad_t nfs_curusec(void);
-void *nfsm_disct(struct mbuf **, caddr_t *, int, int);
+void *nfsm_disct(struct mbuf **, caddr_t *, int, int, int);
/* ****************************** */
/* Build request/reply phase macros */
@@ -62,6 +62,7 @@ void *nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos);
/* Interpretation phase macros */
void *nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos);
+void *nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos);
int nfsm_strsiz_xx(int *s, int m, struct mbuf **md, caddr_t *dpos);
int nfsm_adv_xx(int s, struct mbuf **md, caddr_t *dpos);
@@ -94,6 +95,14 @@ do { \
(c)ret; \
})
+#define nfsm_dissect_nonblock(c, s) \
+({ \
+ void *ret; \
+ ret = nfsm_dissect_xx_nonblock((s), &md, &dpos); \
+ nfsm_dcheckp(ret, mrep); \
+ (c)ret; \
+})
+
#define nfsm_strsiz(s,m) \
do { \
int t1; \
OpenPOWER on IntegriCloud