]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/sunrpc/xdr.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[linux-2.6-omap-h63xx.git] / include / linux / sunrpc / xdr.h
index 9e340fa23c0633f55c6e152d049874c41282f78a..e4057d729f036c8a3b80e3100a704e03ef0c6d4a 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/uio.h>
 #include <asm/byteorder.h>
 #include <linux/scatterlist.h>
+#include <linux/smp_lock.h>
 
 /*
  * Buffer adjustment
@@ -35,6 +36,21 @@ struct xdr_netobj {
  */
 typedef int    (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj);
 
+/*
+ * We're still requiring the BKL in the xdr code until it's been
+ * more carefully audited, at which point this wrapper will become
+ * unnecessary.
+ */
+static inline int rpc_call_xdrproc(kxdrproc_t xdrproc, void *rqstp, __be32 *data, void *obj)
+{
+       int ret;
+
+       lock_kernel();
+       ret = xdrproc(rqstp, data, obj);
+       unlock_kernel();
+       return ret;
+}
+
 /*
  * Basic structure for transmission/reception of a client XDR message.
  * Features a header (for a linear buffer containing RPC headers
@@ -54,7 +70,10 @@ struct xdr_buf {
 
        struct page **  pages;          /* Array of contiguous pages */
        unsigned int    page_base,      /* Start of page data */
-                       page_len;       /* Length of page data */
+                       page_len,       /* Length of page data */
+                       flags;          /* Flags for data disposition */
+#define XDRBUF_READ            0x01            /* target of file read */
+#define XDRBUF_WRITE           0x02            /* source of file write */
 
        unsigned int    buflen,         /* Total length of storage buffer */
                        len;            /* Length of XDR encoded message */
@@ -93,7 +112,8 @@ struct xdr_buf {
 __be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len);
 __be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len);
 __be32 *xdr_encode_string(__be32 *p, const char *s);
-__be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen);
+__be32 *xdr_decode_string_inplace(__be32 *p, char **sp, unsigned int *lenp,
+                       unsigned int maxlen);
 __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *);
 __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *);