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:
Aneesh Kumar K.V
2011-01-29 18:43:25 +05:30
committed by Al Viro
parent c8b91accfa
commit 5fe0c23788
12 changed files with 59 additions and 18 deletions

View File

@ -1593,8 +1593,13 @@ int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp,
struct inode *inode = dentry->d_inode;
int maxlen = *lenp;
if (maxlen < 3)
if (need_parent && (maxlen < 5)) {
*lenp = 5;
return 255;
} else if (maxlen < 3) {
*lenp = 3;
return 255;
}
data[0] = inode->i_ino;
data[1] = le32_to_cpu(INODE_PKEY(inode)->k_dir_id);