diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-01-29 18:43:25 +0530 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-14 09:15:28 -0400 |
commit | 5fe0c2378884e68beb532f5890cc0e3539ac747b (patch) | |
tree | be25414052184e146049ea6466854366559d5528 /mm/shmem.c | |
parent | c8b91accfa1059d5565443193d89572eca2f5dd6 (diff) | |
download | linux-5fe0c2378884e68beb532f5890cc0e3539ac747b.tar.gz linux-5fe0c2378884e68beb532f5890cc0e3539ac747b.tar.bz2 linux-5fe0c2378884e68beb532f5890cc0e3539ac747b.zip |
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>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 5ee67c990602..3437b65d6d6e 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2144,8 +2144,10 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len, { struct inode *inode = dentry->d_inode; - if (*len < 3) + if (*len < 3) { + *len = 3; return 255; + } if (inode_unhashed(inode)) { /* Unfortunately insert_inode_hash is not idempotent, |