Commit 8b61e74f authored by Al Viro's avatar Al Viro

get rid of {lock,unlock}_rcu_walk()

those have become aliases for rcu_read_{lock,unlock}()
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 48a066e7
...@@ -482,16 +482,6 @@ EXPORT_SYMBOL(path_put); ...@@ -482,16 +482,6 @@ EXPORT_SYMBOL(path_put);
* to restart the path walk from the beginning in ref-walk mode. * to restart the path walk from the beginning in ref-walk mode.
*/ */
static inline void lock_rcu_walk(void)
{
rcu_read_lock();
}
static inline void unlock_rcu_walk(void)
{
rcu_read_unlock();
}
/** /**
* unlazy_walk - try to switch to ref-walk mode. * unlazy_walk - try to switch to ref-walk mode.
* @nd: nameidata pathwalk data * @nd: nameidata pathwalk data
...@@ -523,7 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) ...@@ -523,7 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
if (!lockref_get_not_dead(&parent->d_lockref)) { if (!lockref_get_not_dead(&parent->d_lockref)) {
nd->path.dentry = NULL; nd->path.dentry = NULL;
unlock_rcu_walk(); rcu_read_unlock();
return -ECHILD; return -ECHILD;
} }
...@@ -561,17 +551,17 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry) ...@@ -561,17 +551,17 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
spin_unlock(&fs->lock); spin_unlock(&fs->lock);
} }
unlock_rcu_walk(); rcu_read_unlock();
return 0; return 0;
unlock_and_drop_dentry: unlock_and_drop_dentry:
spin_unlock(&fs->lock); spin_unlock(&fs->lock);
drop_dentry: drop_dentry:
unlock_rcu_walk(); rcu_read_unlock();
dput(dentry); dput(dentry);
goto drop_root_mnt; goto drop_root_mnt;
out: out:
unlock_rcu_walk(); rcu_read_unlock();
drop_root_mnt: drop_root_mnt:
if (!(nd->flags & LOOKUP_ROOT)) if (!(nd->flags & LOOKUP_ROOT))
nd->root.mnt = NULL; nd->root.mnt = NULL;
...@@ -604,21 +594,21 @@ static int complete_walk(struct nameidata *nd) ...@@ -604,21 +594,21 @@ static int complete_walk(struct nameidata *nd)
nd->root.mnt = NULL; nd->root.mnt = NULL;
if (!legitimize_mnt(nd->path.mnt, nd->m_seq)) { if (!legitimize_mnt(nd->path.mnt, nd->m_seq)) {
unlock_rcu_walk(); rcu_read_unlock();
return -ECHILD; return -ECHILD;
} }
if (unlikely(!lockref_get_not_dead(&dentry->d_lockref))) { if (unlikely(!lockref_get_not_dead(&dentry->d_lockref))) {
unlock_rcu_walk(); rcu_read_unlock();
mntput(nd->path.mnt); mntput(nd->path.mnt);
return -ECHILD; return -ECHILD;
} }
if (read_seqcount_retry(&dentry->d_seq, nd->seq)) { if (read_seqcount_retry(&dentry->d_seq, nd->seq)) {
unlock_rcu_walk(); rcu_read_unlock();
dput(dentry); dput(dentry);
mntput(nd->path.mnt); mntput(nd->path.mnt);
return -ECHILD; return -ECHILD;
} }
unlock_rcu_walk(); rcu_read_unlock();
} }
if (likely(!(nd->flags & LOOKUP_JUMPED))) if (likely(!(nd->flags & LOOKUP_JUMPED)))
...@@ -1174,7 +1164,7 @@ static int follow_dotdot_rcu(struct nameidata *nd) ...@@ -1174,7 +1164,7 @@ static int follow_dotdot_rcu(struct nameidata *nd)
nd->flags &= ~LOOKUP_RCU; nd->flags &= ~LOOKUP_RCU;
if (!(nd->flags & LOOKUP_ROOT)) if (!(nd->flags & LOOKUP_ROOT))
nd->root.mnt = NULL; nd->root.mnt = NULL;
unlock_rcu_walk(); rcu_read_unlock();
return -ECHILD; return -ECHILD;
} }
...@@ -1501,7 +1491,7 @@ static void terminate_walk(struct nameidata *nd) ...@@ -1501,7 +1491,7 @@ static void terminate_walk(struct nameidata *nd)
nd->flags &= ~LOOKUP_RCU; nd->flags &= ~LOOKUP_RCU;
if (!(nd->flags & LOOKUP_ROOT)) if (!(nd->flags & LOOKUP_ROOT))
nd->root.mnt = NULL; nd->root.mnt = NULL;
unlock_rcu_walk(); rcu_read_unlock();
} }
} }
...@@ -1862,7 +1852,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, ...@@ -1862,7 +1852,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
nd->path = nd->root; nd->path = nd->root;
nd->inode = inode; nd->inode = inode;
if (flags & LOOKUP_RCU) { if (flags & LOOKUP_RCU) {
lock_rcu_walk(); rcu_read_lock();
nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
nd->m_seq = read_seqbegin(&mount_lock); nd->m_seq = read_seqbegin(&mount_lock);
} else { } else {
...@@ -1876,7 +1866,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, ...@@ -1876,7 +1866,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
nd->m_seq = read_seqbegin(&mount_lock); nd->m_seq = read_seqbegin(&mount_lock);
if (*name=='/') { if (*name=='/') {
if (flags & LOOKUP_RCU) { if (flags & LOOKUP_RCU) {
lock_rcu_walk(); rcu_read_lock();
set_root_rcu(nd); set_root_rcu(nd);
} else { } else {
set_root(nd); set_root(nd);
...@@ -1888,7 +1878,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, ...@@ -1888,7 +1878,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
struct fs_struct *fs = current->fs; struct fs_struct *fs = current->fs;
unsigned seq; unsigned seq;
lock_rcu_walk(); rcu_read_lock();
do { do {
seq = read_seqcount_begin(&fs->seq); seq = read_seqcount_begin(&fs->seq);
...@@ -1920,7 +1910,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, ...@@ -1920,7 +1910,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
if (f.need_put) if (f.need_put)
*fp = f.file; *fp = f.file;
nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
lock_rcu_walk(); rcu_read_lock();
} else { } else {
path_get(&nd->path); path_get(&nd->path);
fdput(f); fdput(f);
......
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