From 2e7fa77fc9ce0347720919976c606e6ecdab3042 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 17 Dec 2012 16:05:08 -0800 Subject: [PATCH] --- yaml --- r: 346514 b: refs/heads/master c: 711c7bf9914060d7aaf3c1a15f38094a5d5e748f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/exportfs/expfs.c | 19 ++++++++++++++----- trunk/include/linux/exportfs.h | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index ac6901096d43..df130b7d9fac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ab49bdecc3ebb46ab661f5f05d5c5ea9606406c6 +refs/heads/master: 711c7bf9914060d7aaf3c1a15f38094a5d5e748f diff --git a/trunk/fs/exportfs/expfs.c b/trunk/fs/exportfs/expfs.c index 10f137381ac7..606bb074c501 100644 --- a/trunk/fs/exportfs/expfs.c +++ b/trunk/fs/exportfs/expfs.c @@ -341,10 +341,21 @@ static int export_encode_fh(struct inode *inode, struct fid *fid, return type; } +int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, + int *max_len, struct inode *parent) +{ + const struct export_operations *nop = inode->i_sb->s_export_op; + + if (nop && nop->encode_fh) + return nop->encode_fh(inode, fid->raw, max_len, parent); + + return export_encode_fh(inode, fid, max_len, parent); +} +EXPORT_SYMBOL_GPL(exportfs_encode_inode_fh); + int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, int connectable) { - const struct export_operations *nop = dentry->d_sb->s_export_op; int error; struct dentry *p = NULL; 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, */ parent = p->d_inode; } - if (nop && nop->encode_fh) - error = nop->encode_fh(inode, fid->raw, max_len, parent); - else - error = export_encode_fh(inode, fid, max_len, parent); + + error = exportfs_encode_inode_fh(inode, fid, max_len, parent); dput(p); return error; diff --git a/trunk/include/linux/exportfs.h b/trunk/include/linux/exportfs.h index 12291a7ee275..c7e6b6392ab8 100644 --- a/trunk/include/linux/exportfs.h +++ b/trunk/include/linux/exportfs.h @@ -177,6 +177,8 @@ struct export_operations { int (*commit_metadata)(struct inode *inode); }; +extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, + int *max_len, struct inode *parent); extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, int connectable); extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,