vserver 1.9.3
[linux-2.6.git] / include / linux / nfs.h
index b30265f..ca2ffa6 100644 (file)
@@ -8,6 +8,7 @@
 #define _LINUX_NFS_H
 
 #include <linux/sunrpc/msg_prot.h>
+#include <linux/string.h>
 
 #define NFS_PROGRAM    100003
 #define NFS_PORT       2049
@@ -138,6 +139,22 @@ struct nfs_fh {
        unsigned char           data[NFS_MAXFHSIZE];
 };
 
+/*
+ * Returns a zero iff the size and data fields match.
+ * Checks only "size" bytes in the data field.
+ */
+static inline int nfs_compare_fh(const struct nfs_fh *a, const struct nfs_fh *b)
+{
+       return a->size != b->size || memcmp(a->data, b->data, a->size) != 0;
+}
+
+static inline void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *source)
+{
+       target->size = source->size;
+       memcpy(target->data, source->data, source->size);
+}
+
+
 /*
  * This is really a general kernel constant, but since nothing like
  * this is defined in the kernel headers, I have to do it here.