提交 0461ee26 编写于 作者: C Christoph Hellwig 提交者: Al Viro

exportfs: use dget_parent

Use dget_parent instead of opencoding it.  This simplifies the code, but
more importanly prepares for the more complicated locking for a parent
dget in the dcache scale patch series.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 3825bdb7
...@@ -74,21 +74,20 @@ static struct dentry * ...@@ -74,21 +74,20 @@ static struct dentry *
find_disconnected_root(struct dentry *dentry) find_disconnected_root(struct dentry *dentry)
{ {
dget(dentry); dget(dentry);
spin_lock(&dentry->d_lock); while (!IS_ROOT(dentry)) {
while (!IS_ROOT(dentry) && struct dentry *parent = dget_parent(dentry);
(dentry->d_parent->d_flags & DCACHE_DISCONNECTED)) {
struct dentry *parent = dentry->d_parent; if (!(parent->d_flags & DCACHE_DISCONNECTED)) {
dget(parent); dput(parent);
spin_unlock(&dentry->d_lock); break;
}
dput(dentry); dput(dentry);
dentry = parent; dentry = parent;
spin_lock(&dentry->d_lock);
} }
spin_unlock(&dentry->d_lock);
return dentry; return dentry;
} }
/* /*
* Make sure target_dir is fully connected to the dentry tree. * Make sure target_dir is fully connected to the dentry tree.
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册