mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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:
parent
c8b91accfa
commit
5fe0c23788
12 changed files with 59 additions and 18 deletions
|
|
@ -36,9 +36,13 @@ static int gfs2_encode_fh(struct dentry *dentry, __u32 *p, int *len,
|
|||
struct super_block *sb = inode->i_sb;
|
||||
struct gfs2_inode *ip = GFS2_I(inode);
|
||||
|
||||
if (*len < GFS2_SMALL_FH_SIZE ||
|
||||
(connectable && *len < GFS2_LARGE_FH_SIZE))
|
||||
if (connectable && (*len < GFS2_LARGE_FH_SIZE)) {
|
||||
*len = GFS2_LARGE_FH_SIZE;
|
||||
return 255;
|
||||
} else if (*len < GFS2_SMALL_FH_SIZE) {
|
||||
*len = GFS2_SMALL_FH_SIZE;
|
||||
return 255;
|
||||
}
|
||||
|
||||
fh[0] = cpu_to_be32(ip->i_no_formal_ino >> 32);
|
||||
fh[1] = cpu_to_be32(ip->i_no_formal_ino & 0xFFFFFFFF);
|
||||
|
|
|
|||
Loading…
Reference in a new issue