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 <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Aneesh Kumar K.V 2011-01-29 18:43:25 +05:30 • committed by Al Viro
commit 5fe0c23788
12 changed files with 59 additions and 18 deletions

View file

@ -637,8 +637,10 @@ static int fuse_encode_fh(struct dentry *dentry, u32 *fh, int *max_len,
u64 nodeid;
u32 generation;
if (*max_len < len)
if (*max_len < len) {
*max_len = len;
return 255;
}
nodeid = get_fuse_inode(inode)->nodeid;
generation = inode->i_generation;