aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-11-08 12:45:01 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-09 00:16:20 -0500
commit8b61e74ffc6310e1d35a9b51c8463093851f8bcf (patch)
tree89fb408267eddaba4031118995375e5fdf988cf7 /fs
parent48a066e72d970a3e225a9c18690d570c736fc455 (diff)
get rid of {lock,unlock}_rcu_walk()
those have become aliases for rcu_read_{lock,unlock}() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/fs/namei.c b/fs/namei.c
index cb0ebae07e52..e5c0118ba9f8 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -482,16 +482,6 @@ EXPORT_SYMBOL(path_put);
482 * to restart the path walk from the beginning in ref-walk mode. 482 * to restart the path walk from the beginning in ref-walk mode.
483 */ 483 */
484 484
485static inline void lock_rcu_walk(void)
486{
487 rcu_read_lock();
488}
489
490static inline void unlock_rcu_walk(void)
491{
492 rcu_read_unlock();
493}
494
495/** 485/**
496 * unlazy_walk - try to switch to ref-walk mode. 486 * unlazy_walk - try to switch to ref-walk mode.
497 * @nd: nameidata pathwalk data 487 * @nd: nameidata pathwalk data
@@ -523,7 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
523 513
524 if (!lockref_get_not_dead(&parent->d_lockref)) { 514 if (!lockref_get_not_dead(&parent->d_lockref)) {
525 nd->path.dentry = NULL; 515 nd->path.dentry = NULL;
526 unlock_rcu_walk(); 516 rcu_read_unlock();
527 return -ECHILD; 517 return -ECHILD;
528 } 518 }
529 519
@@ -561,17 +551,17 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
561 spin_unlock(&fs->lock); 551 spin_unlock(&fs->lock);
562 } 552 }
563 553
564 unlock_rcu_walk(); 554 rcu_read_unlock();
565 return 0; 555 return 0;
566 556
567unlock_and_drop_dentry: 557unlock_and_drop_dentry:
568 spin_unlock(&fs->lock); 558 spin_unlock(&fs->lock);
569drop_dentry: 559drop_dentry:
570 unlock_rcu_walk(); 560 rcu_read_unlock();
571 dput(dentry); 561 dput(dentry);
572 goto drop_root_mnt; 562 goto drop_root_mnt;
573out: 563out:
574 unlock_rcu_walk(); 564 rcu_read_unlock();
575drop_root_mnt: 565drop_root_mnt:
576 if (!(nd->flags & LOOKUP_ROOT)) 566 if (!(nd->flags & LOOKUP_ROOT))
577 nd->root.mnt = NULL; 567 nd->root.mnt = NULL;
@@ -604,21 +594,21 @@ static int complete_walk(struct nameidata *nd)
604 nd->root.mnt = NULL; 594 nd->root.mnt = NULL;
605 595
606 if (!legitimize_mnt(nd->path.mnt, nd->m_seq)) { 596 if (!legitimize_mnt(nd->path.mnt, nd->m_seq)) {
607 unlock_rcu_walk(); 597 rcu_read_unlock();
608 return -ECHILD; 598 return -ECHILD;
609 } 599 }
610 if (unlikely(!lockref_get_not_dead(&dentry->d_lockref))) { 600 if (unlikely(!lockref_get_not_dead(&dentry->d_lockref))) {
611 unlock_rcu_walk(); 601 rcu_read_unlock();
612 mntput(nd->path.mnt); 602 mntput(nd->path.mnt);
613 return -ECHILD; 603 return -ECHILD;
614 } 604 }
615 if (read_seqcount_retry(&dentry->d_seq, nd->seq)) { 605 if (read_seqcount_retry(&dentry->d_seq, nd->seq)) {
616 unlock_rcu_walk(); 606 rcu_read_unlock();
617 dput(dentry); 607 dput(dentry);
618 mntput(nd->path.mnt); 608 mntput(nd->path.mnt);
619 return -ECHILD; 609 return -ECHILD;
620 } 610 }
621 unlock_rcu_walk(); 611 rcu_read_unlock();
622 } 612 }
623 613
624 if (likely(!(nd->flags & LOOKUP_JUMPED))) 614 if (likely(!(nd->flags & LOOKUP_JUMPED)))
@@ -1174,7 +1164,7 @@ failed:
1174 nd->flags &= ~LOOKUP_RCU; 1164 nd->flags &= ~LOOKUP_RCU;
1175 if (!(nd->flags & LOOKUP_ROOT)) 1165 if (!(nd->flags & LOOKUP_ROOT))
1176 nd->root.mnt = NULL; 1166 nd->root.mnt = NULL;
1177 unlock_rcu_walk(); 1167 rcu_read_unlock();
1178 return -ECHILD; 1168 return -ECHILD;
1179} 1169}
1180 1170
@@ -1501,7 +1491,7 @@ static void terminate_walk(struct nameidata *nd)
1501 nd->flags &= ~LOOKUP_RCU; 1491 nd->flags &= ~LOOKUP_RCU;
1502 if (!(nd->flags & LOOKUP_ROOT)) 1492 if (!(nd->flags & LOOKUP_ROOT))
1503 nd->root.mnt = NULL; 1493 nd->root.mnt = NULL;
1504 unlock_rcu_walk(); 1494 rcu_read_unlock();
1505 } 1495 }
1506} 1496}
1507 1497
@@ -1862,7 +1852,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1862 nd->path = nd->root; 1852 nd->path = nd->root;
1863 nd->inode = inode; 1853 nd->inode = inode;
1864 if (flags & LOOKUP_RCU) { 1854 if (flags & LOOKUP_RCU) {
1865 lock_rcu_walk(); 1855 rcu_read_lock();
1866 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); 1856 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
1867 nd->m_seq = read_seqbegin(&mount_lock); 1857 nd->m_seq = read_seqbegin(&mount_lock);
1868 } else { 1858 } else {
@@ -1876,7 +1866,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1876 nd->m_seq = read_seqbegin(&mount_lock); 1866 nd->m_seq = read_seqbegin(&mount_lock);
1877 if (*name=='/') { 1867 if (*name=='/') {
1878 if (flags & LOOKUP_RCU) { 1868 if (flags & LOOKUP_RCU) {
1879 lock_rcu_walk(); 1869 rcu_read_lock();
1880 set_root_rcu(nd); 1870 set_root_rcu(nd);
1881 } else { 1871 } else {
1882 set_root(nd); 1872 set_root(nd);
@@ -1888,7 +1878,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1888 struct fs_struct *fs = current->fs; 1878 struct fs_struct *fs = current->fs;
1889 unsigned seq; 1879 unsigned seq;
1890 1880
1891 lock_rcu_walk(); 1881 rcu_read_lock();
1892 1882
1893 do { 1883 do {
1894 seq = read_seqcount_begin(&fs->seq); 1884 seq = read_seqcount_begin(&fs->seq);
@@ -1920,7 +1910,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1920 if (f.need_put) 1910 if (f.need_put)
1921 *fp = f.file; 1911 *fp = f.file;
1922 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); 1912 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
1923 lock_rcu_walk(); 1913 rcu_read_lock();
1924 } else { 1914 } else {
1925 path_get(&nd->path); 1915 path_get(&nd->path);
1926 fdput(f); 1916 fdput(f);