summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zpl_ctldir.c6
-rw-r--r--module/zfs/zpl_file.c7
2 files changed, 6 insertions, 7 deletions
diff --git a/module/zfs/zpl_ctldir.c b/module/zfs/zpl_ctldir.c
index 069834eae..7c4fcea3e 100644
--- a/module/zfs/zpl_ctldir.c
+++ b/module/zfs/zpl_ctldir.c
@@ -52,7 +52,7 @@ zpl_common_open(struct inode *ip, struct file *filp)
static int
zpl_root_iterate(struct file *filp, struct dir_context *ctx)
{
- zfs_sb_t *zsb = ITOZSB(filp->f_path.dentry->d_inode);
+ zfs_sb_t *zsb = ITOZSB(file_inode(filp));
int error = 0;
ZFS_ENTER(zsb);
@@ -249,7 +249,7 @@ zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
static int
zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx)
{
- zfs_sb_t *zsb = ITOZSB(filp->f_path.dentry->d_inode);
+ zfs_sb_t *zsb = ITOZSB(file_inode(filp));
fstrans_cookie_t cookie;
char snapname[MAXNAMELEN];
boolean_t case_conflict;
@@ -447,7 +447,7 @@ zpl_shares_iterate(struct file *filp, struct dir_context *ctx)
{
fstrans_cookie_t cookie;
cred_t *cr = CRED();
- zfs_sb_t *zsb = ITOZSB(filp->f_path.dentry->d_inode);
+ zfs_sb_t *zsb = ITOZSB(file_inode(filp));
znode_t *dzp;
int error = 0;
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
index 4481237bc..c8ac7f8a3 100644
--- a/module/zfs/zpl_file.c
+++ b/module/zfs/zpl_file.c
@@ -78,14 +78,13 @@ zpl_release(struct inode *ip, struct file *filp)
static int
zpl_iterate(struct file *filp, struct dir_context *ctx)
{
- struct dentry *dentry = filp->f_path.dentry;
cred_t *cr = CRED();
int error;
fstrans_cookie_t cookie;
crhold(cr);
cookie = spl_fstrans_mark();
- error = -zfs_readdir(dentry->d_inode, ctx, cr);
+ error = -zfs_readdir(file_inode(filp), ctx, cr);
spl_fstrans_unmark(cookie);
crfree(cr);
ASSERT3S(error, <=, 0);
@@ -135,7 +134,7 @@ static int
zpl_aio_fsync(struct kiocb *kiocb, int datasync)
{
struct file *filp = kiocb->ki_filp;
- return (zpl_fsync(filp, filp->f_path.dentry, datasync));
+ return (zpl_fsync(filp, file_dentry(filp), datasync));
}
#elif defined(HAVE_FSYNC_WITHOUT_DENTRY)
/*
@@ -688,7 +687,7 @@ zpl_fallocate_common(struct inode *ip, int mode, loff_t offset, loff_t len)
static long
zpl_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
{
- return zpl_fallocate_common(filp->f_path.dentry->d_inode,
+ return zpl_fallocate_common(file_inode(filp),
mode, offset, len);
}
#endif /* HAVE_FILE_FALLOCATE */