summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2004-03-04 15:57:24 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-04 15:57:24 -0800
commit1610726a58e3a6b0776c83868f6855c5ebba2e4b (patch)
treed6dc21914afec9cc79e873aa55e09db3b2803514 /include/linux
parentb02a51da5d13842971f9a8a0d6a8607a3211accb (diff)
[PATCH] kNFSd - Tidy up new filehandle type.
nfsd uses several different mechanisms for identifying the filesystem from the filehandle. This patch: Marks type 2 as deprecated - it wastes space, and space in the filehandle is not unlimited Adds type 3 which handles new, large device number in 32bits of space Tidies up the code for determining which type to use in a newly created filehandle - the addition of type 2 broke this code.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfsd/nfsfh.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 06281634b083..bb842ea41033 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -66,8 +66,9 @@ struct nfs_fhbase_old {
* 0 - 4 byte device id (ms-2-bytes major, ls-2-bytes minor), 4byte inode number
* NOTE: we cannot use the kdev_t device id value, because kdev_t.h
* says we mustn't. We must break it up and reassemble.
- * Possible future encodings:
* 1 - 4 byte user specified identifier
+ * 2 - 4 byte major, 4 byte minor, 4 byte inode number - DEPRECATED
+ * 3 - 4 byte device id, encoded for user-space, 4 byte inode number
*
* The fileid_type identified how the file within the filesystem is encoded.
* This is (will be) passed to, and set by, the underlying filesystem if it supports
@@ -114,6 +115,7 @@ struct knfsd_fh {
#define fh_auth_type fh_base.fh_new.fb_auth_type
#define fh_fileid_type fh_base.fh_new.fb_fileid_type
#define fh_auth fh_base.fh_new.fb_auth
+#define fh_fsid fh_base.fh_new.fb_auth
#ifdef __KERNEL__
@@ -183,6 +185,23 @@ static inline void mk_fsid_v2(u32 *fsidv, dev_t dev, ino_t ino)
fsidv[2] = ino_t_to_u32(ino);
}
+static inline void mk_fsid_v3(u32 *fsidv, dev_t dev, ino_t ino)
+{
+ fsidv[0] = new_encode_dev(dev);
+ fsidv[1] = ino_t_to_u32(ino);
+}
+
+static inline int key_len(int type)
+{
+ switch(type) {
+ case 0: return 8;
+ case 1: return 4;
+ case 2: return 12;
+ case 3: return 8;
+ default: return 0;
+ }
+}
+
/*
* Shorthand for dprintk()'s
*/