Linux 3.5 compat, eops->encode_fh() takes inodes

The export_operations member ->encode_fh() has been updated to
take both the child and parent inodes.  This interface used to
take the child dentry and a bool describing if the parent is needed.

NOTE: While updating this code I noticed that we do not currently
cleanly handle the case where we're passed a connectable parent.
This code should be audited to make sure we're doing the right thing.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #784
This commit is contained in:
Richard Yao
2012-07-23 10:55:48 -07:00
committed by Brian Behlendorf
parent ed3fc80048
commit 756c3e5a9c
60 changed files with 227 additions and 1 deletions
+6 -1
View File
@@ -30,10 +30,15 @@
static int
#ifdef HAVE_ENCODE_FH_WITH_INODE
zpl_encode_fh(struct inode *ip, __u32 *fh, int *max_len, struct inode *parent)
{
#else
zpl_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, int connectable)
{
fid_t *fid = (fid_t *)fh;
struct inode *ip = dentry->d_inode;
#endif /* HAVE_ENCODE_FH_WITH_INODE */
fid_t *fid = (fid_t *)fh;
int len_bytes, rc;
len_bytes = *max_len * sizeof (__u32);