exportfs: Return the minimum required handle size
The exportfs encode handle function should return the minimum required handle size. This helps user to find out the handle size by passing 0 handle size in the first step and then redoing to the call again with the returned handle size value. Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
committed by
Al Viro
parent
c8b91accfa
commit
5fe0c23788
@@ -21,9 +21,13 @@ static int btrfs_encode_fh(struct dentry *dentry, u32 *fh, int *max_len,
|
||||
int len = *max_len;
|
||||
int type;
|
||||
|
||||
if ((len < BTRFS_FID_SIZE_NON_CONNECTABLE) ||
|
||||
(connectable && len < BTRFS_FID_SIZE_CONNECTABLE))
|
||||
if (connectable && (len < BTRFS_FID_SIZE_CONNECTABLE)) {
|
||||
*max_len = BTRFS_FID_SIZE_CONNECTABLE;
|
||||
return 255;
|
||||
} else if (len < BTRFS_FID_SIZE_NON_CONNECTABLE) {
|
||||
*max_len = BTRFS_FID_SIZE_NON_CONNECTABLE;
|
||||
return 255;
|
||||
}
|
||||
|
||||
len = BTRFS_FID_SIZE_NON_CONNECTABLE;
|
||||
type = FILEID_BTRFS_WITHOUT_PARENT;
|
||||
|
Reference in New Issue
Block a user