diff options
author | Christoph Hellwig <hch@lst.de> | 2007-10-21 19:42:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 11:13:20 -0400 |
commit | c38344fe9e73c99d546cc15a2bb97c7a09942aad (patch) | |
tree | 83d3cb3f57367ef934fd751e01ff0e11a21bf5e5 /fs/xfs/linux-2.6/xfs_export.h | |
parent | a35132068a91907c29328abc3156d31e50673412 (diff) |
xfs: new export ops
This one is a lot more complicated than the previous ones. XFS already had a
very clever scheme for supporting 64bit inode numbers in filehandles, and I've
reworked this to be some kind of a prototype for the generic 64bit inode
filehandle support.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: David Chinner <dgc@sgi.com>
Cc: Timothy Shimmin <tes@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_export.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_export.h | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/fs/xfs/linux-2.6/xfs_export.h b/fs/xfs/linux-2.6/xfs_export.h index 2f36071a86f7..3272b6ae7a35 100644 --- a/fs/xfs/linux-2.6/xfs_export.h +++ b/fs/xfs/linux-2.6/xfs_export.h | |||
@@ -59,50 +59,14 @@ | |||
59 | * a subdirectory) or use the "fsid" export option. | 59 | * a subdirectory) or use the "fsid" export option. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | struct xfs_fid64 { | ||
63 | u64 ino; | ||
64 | u32 gen; | ||
65 | u64 parent_ino; | ||
66 | u32 parent_gen; | ||
67 | } __attribute__((packed)); | ||
68 | |||
62 | /* This flag goes on the wire. Don't play with it. */ | 69 | /* This flag goes on the wire. Don't play with it. */ |
63 | #define XFS_FILEID_TYPE_64FLAG 0x80 /* NFS fileid has 64bit inodes */ | 70 | #define XFS_FILEID_TYPE_64FLAG 0x80 /* NFS fileid has 64bit inodes */ |
64 | 71 | ||
65 | /* Calculate the length in u32 units of the fileid data */ | ||
66 | static inline int | ||
67 | xfs_fileid_length(int hasparent, int is64) | ||
68 | { | ||
69 | return hasparent ? (is64 ? 6 : 4) : (is64 ? 3 : 2); | ||
70 | } | ||
71 | |||
72 | /* | ||
73 | * Decode encoded inode information (either for the inode itself | ||
74 | * or the parent) into an xfs_fid_t structure. Advances and | ||
75 | * returns the new data pointer | ||
76 | */ | ||
77 | static inline __u32 * | ||
78 | xfs_fileid_decode_fid2(__u32 *p, xfs_fid_t *fid, int is64) | ||
79 | { | ||
80 | fid->fid_len = sizeof(xfs_fid_t) - sizeof(fid->fid_len); | ||
81 | fid->fid_pad = 0; | ||
82 | fid->fid_ino = *p++; | ||
83 | #if XFS_BIG_INUMS | ||
84 | if (is64) | ||
85 | fid->fid_ino |= (((__u64)(*p++)) << 32); | ||
86 | #endif | ||
87 | fid->fid_gen = *p++; | ||
88 | return p; | ||
89 | } | ||
90 | |||
91 | /* | ||
92 | * Encode inode information (either for the inode itself or the | ||
93 | * parent) into a fileid buffer. Advances and returns the new | ||
94 | * data pointer. | ||
95 | */ | ||
96 | static inline __u32 * | ||
97 | xfs_fileid_encode_inode(__u32 *p, struct inode *inode, int is64) | ||
98 | { | ||
99 | *p++ = (__u32)inode->i_ino; | ||
100 | #if XFS_BIG_INUMS | ||
101 | if (is64) | ||
102 | *p++ = (__u32)(inode->i_ino >> 32); | ||
103 | #endif | ||
104 | *p++ = inode->i_generation; | ||
105 | return p; | ||
106 | } | ||
107 | |||
108 | #endif /* __XFS_EXPORT_H__ */ | 72 | #endif /* __XFS_EXPORT_H__ */ |