Commit 641235d8 authored by Yan, Zheng's avatar Yan, Zheng Committed by Ilya Dryomov

ceph: kill ceph_get_dentry_parent_inode()

use vfs helper dget_parent() instead
Signed-off-by: default avatarYan, Zheng <zyan@redhat.com>
parent 315f2408
...@@ -68,23 +68,6 @@ int ceph_init_dentry(struct dentry *dentry) ...@@ -68,23 +68,6 @@ int ceph_init_dentry(struct dentry *dentry)
return 0; return 0;
} }
struct inode *ceph_get_dentry_parent_inode(struct dentry *dentry)
{
struct inode *inode = NULL;
if (!dentry)
return NULL;
spin_lock(&dentry->d_lock);
if (!IS_ROOT(dentry)) {
inode = d_inode(dentry->d_parent);
ihold(inode);
}
spin_unlock(&dentry->d_lock);
return inode;
}
/* /*
* for readdir, we encode the directory frag and offset within that * for readdir, we encode the directory frag and offset within that
* frag into f_pos. * frag into f_pos.
...@@ -1100,6 +1083,7 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry) ...@@ -1100,6 +1083,7 @@ static int dir_lease_is_valid(struct inode *dir, struct dentry *dentry)
static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags) static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
{ {
int valid = 0; int valid = 0;
struct dentry *parent;
struct inode *dir; struct inode *dir;
if (flags & LOOKUP_RCU) if (flags & LOOKUP_RCU)
...@@ -1108,7 +1092,8 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -1108,7 +1092,8 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
dout("d_revalidate %p '%pd' inode %p offset %lld\n", dentry, dout("d_revalidate %p '%pd' inode %p offset %lld\n", dentry,
dentry, d_inode(dentry), ceph_dentry(dentry)->offset); dentry, d_inode(dentry), ceph_dentry(dentry)->offset);
dir = ceph_get_dentry_parent_inode(dentry); parent = dget_parent(dentry);
dir = d_inode(parent);
/* always trust cached snapped dentries, snapdir dentry */ /* always trust cached snapped dentries, snapdir dentry */
if (ceph_snap(dir) != CEPH_NOSNAP) { if (ceph_snap(dir) != CEPH_NOSNAP) {
...@@ -1132,7 +1117,8 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -1132,7 +1117,8 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
} else { } else {
ceph_dir_clear_complete(dir); ceph_dir_clear_complete(dir);
} }
iput(dir);
dput(parent);
return valid; return valid;
} }
......
...@@ -957,7 +957,6 @@ extern void ceph_dentry_lru_touch(struct dentry *dn); ...@@ -957,7 +957,6 @@ extern void ceph_dentry_lru_touch(struct dentry *dn);
extern void ceph_dentry_lru_del(struct dentry *dn); extern void ceph_dentry_lru_del(struct dentry *dn);
extern void ceph_invalidate_dentry_lease(struct dentry *dentry); extern void ceph_invalidate_dentry_lease(struct dentry *dentry);
extern unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn); extern unsigned ceph_dentry_hash(struct inode *dir, struct dentry *dn);
extern struct inode *ceph_get_dentry_parent_inode(struct dentry *dentry);
extern void ceph_readdir_cache_release(struct ceph_readdir_cache_control *ctl); extern void ceph_readdir_cache_release(struct ceph_readdir_cache_control *ctl);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment