X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fzpl_export.c;h=395c5584cce94fe1d837ed495ff8d9eba6eb7507;hb=49d39798f286cce2497a87fc06d78c051ca87570;hp=a3895560048979fe57c825d9c9d3b3a72de61359;hpb=055656d4f4dfc1a85646a2c0cc10b9dce86da72b;p=zfs.git diff --git a/module/zfs/zpl_export.c b/module/zfs/zpl_export.c index a389556..395c558 100644 --- a/module/zfs/zpl_export.c +++ b/module/zfs/zpl_export.c @@ -25,14 +25,20 @@ #include #include +#include #include 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); @@ -42,7 +48,10 @@ zpl_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len, int connectable) fid->fid_len = len_bytes - offsetof(fid_t, fid_data); - rc = zfs_fid(ip, fid); + if (zfsctl_is_node(ip)) + rc = zfsctl_fid(ip, fid); + else + rc = zfs_fid(ip, fid); len_bytes = offsetof(fid_t, fid_data) + fid->fid_len; *max_len = roundup(len_bytes, sizeof (__u32)) / sizeof (__u32); @@ -73,8 +82,6 @@ static struct dentry * zpl_fh_to_dentry(struct super_block *sb, struct fid *fh, int fh_len, int fh_type) { - zfs_sb_t *zsb = sb->s_fs_info; - struct vfsmount *vfs = zsb->z_vfs; fid_t *fid = (fid_t *)fh; struct inode *ip; int len_bytes, rc; @@ -86,7 +93,7 @@ zpl_fh_to_dentry(struct super_block *sb, struct fid *fh, len_bytes < offsetof(fid_t, fid_data) + fid->fid_len) return ERR_PTR(-EINVAL); - rc = zfs_vget(vfs, &ip, fid); + rc = zfs_vget(sb, &ip, fid); if (rc != 0) return ERR_PTR(-rc);