David Howells wrote:
(*) FAT has had its fh type #defined (FAT_FILEID).
(*) FUSE has had its fh types #defined (FUSE_FILEID, FUSE_FILEID_PARENT).
(*) ISOFS has had its fh types #defined (ISOFS_FILEID, ISOFS_FILEID_PARENT).
(*) OCFS2 has had its fh types #defined (OCFS2_FILEID, OCFS2_FILEID_PARENT).
You define these in the filesystem c files themselves as #defines. UDF
and BTRFS place theirs in the enum fid_type definition itself (in
linux/exportfs.h). Is there any reason why you didn't do this?
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
-static int export_encode_fh(struct dentry *dentry, struct fid *fid,
- int *max_len, int connectable)
+static enum fid_type export_encode_fh(struct dentry *dentry, struct fid *fid,
+ int *max_len, int connectable)
{
struct inode * inode = dentry->d_inode;
int len = *max_len;
int type = FILEID_INO32_GEN;
^^^^
this should be changed to enum fid_type
-
+
if (len < 2 || (connectable && len < 4))
- return 255;
+ return FILEID_ERROR;
len = 2;
fid->i32.ino = inode->i_ino;
@@ -341,24 +341,71 @@ static int export_encode_fh(struct dentry *dentry, struct fid *fid,
return type;
}
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -610,8 +610,11 @@ static struct dentry *fuse_get_dentry(struct super_block *sb,
return ERR_PTR(err);
}
-static int fuse_encode_fh(struct dentry *dentry, u32 *fh, int *max_len,
- int connectable)
+#define FUSE_FILEID ((enum fid_type) 0x81)
+#define FUSE_FILEID_PARENT ((enum fid_type) 0x82)
Move to enum fid_type in linux/exportfs.h?
diff --git a/fs/isofs/export.c b/fs/isofs/export.c
index e81a305..b66c083 100644
--- a/fs/isofs/export.c
+++ b/fs/isofs/export.c
@@ -106,7 +106,10 @@ static struct dentry *isofs_export_get_parent(struct dentry *child)
return rv;
}
-static int
+#define ISOFS_FILEID ((enum fid_type) 1)
+#define ISOFS_FILEID_PARENT ((enum fid_type) 2)
+
Move to enum fid_type in linux/exportfs.h?
Type 1 and 2 are also used by the generic fid_types FILEID_INO32_GEN
and FILEID_INO32_GEN_PARENT, but (obviously) their formats are different.
Phillip
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html