diff options
Diffstat (limited to 'fs/exportfs')
-rw-r--r-- | fs/exportfs/expfs.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index 10f137381ac7..606bb074c501 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
@@ -341,10 +341,21 @@ static int export_encode_fh(struct inode *inode, struct fid *fid, | |||
341 | return type; | 341 | return type; |
342 | } | 342 | } |
343 | 343 | ||
344 | int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, | ||
345 | int *max_len, struct inode *parent) | ||
346 | { | ||
347 | const struct export_operations *nop = inode->i_sb->s_export_op; | ||
348 | |||
349 | if (nop && nop->encode_fh) | ||
350 | return nop->encode_fh(inode, fid->raw, max_len, parent); | ||
351 | |||
352 | return export_encode_fh(inode, fid, max_len, parent); | ||
353 | } | ||
354 | EXPORT_SYMBOL_GPL(exportfs_encode_inode_fh); | ||
355 | |||
344 | int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, | 356 | int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, |
345 | int connectable) | 357 | int connectable) |
346 | { | 358 | { |
347 | const struct export_operations *nop = dentry->d_sb->s_export_op; | ||
348 | int error; | 359 | int error; |
349 | struct dentry *p = NULL; | 360 | struct dentry *p = NULL; |
350 | struct inode *inode = dentry->d_inode, *parent = NULL; | 361 | struct inode *inode = dentry->d_inode, *parent = NULL; |
@@ -357,10 +368,8 @@ int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, | |||
357 | */ | 368 | */ |
358 | parent = p->d_inode; | 369 | parent = p->d_inode; |
359 | } | 370 | } |
360 | if (nop && nop->encode_fh) | 371 | |
361 | error = nop->encode_fh(inode, fid->raw, max_len, parent); | 372 | error = exportfs_encode_inode_fh(inode, fid, max_len, parent); |
362 | else | ||
363 | error = export_encode_fh(inode, fid, max_len, parent); | ||
364 | dput(p); | 373 | dput(p); |
365 | 374 | ||
366 | return error; | 375 | return error; |