summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2012-05-08 00:02:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:41 -0400
commit962830df366b66e71849040770ae6ba55a8b4aec (patch)
tree0af9487fd8d5a73fa7adbde0bed368ada4298e39 /fs/namei.c
parenteea62f831b8030b0eeea8314eed73b6132d1de26 (diff)
brlocks/lglocks: API cleanups
lglocks and brlocks are currently generated with some complicated macros in lglock.h. But there's no reason to not just use common utility functions and put all the data into a common data structure. In preparation, this patch changes the API to look more like normal function calls with pointers, not magic macros. The patch is rather large because I move over all users in one go to keep it bisectable. This impacts the VFS somewhat in terms of lines changed. But no actual behaviour change. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c651f02c9fec..93ac9323b1f7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -449,7 +449,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
449 mntget(nd->path.mnt); 449 mntget(nd->path.mnt);
450 450
451 rcu_read_unlock(); 451 rcu_read_unlock();
452 br_read_unlock(vfsmount_lock); 452 br_read_unlock(&vfsmount_lock);
453 nd->flags &= ~LOOKUP_RCU; 453 nd->flags &= ~LOOKUP_RCU;
454 return 0; 454 return 0;
455 455
@@ -507,14 +507,14 @@ static int complete_walk(struct nameidata *nd)
507 if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) { 507 if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
508 spin_unlock(&dentry->d_lock); 508 spin_unlock(&dentry->d_lock);
509 rcu_read_unlock(); 509 rcu_read_unlock();
510 br_read_unlock(vfsmount_lock); 510 br_read_unlock(&vfsmount_lock);
511 return -ECHILD; 511 return -ECHILD;
512 } 512 }
513 BUG_ON(nd->inode != dentry->d_inode); 513 BUG_ON(nd->inode != dentry->d_inode);
514 spin_unlock(&dentry->d_lock); 514 spin_unlock(&dentry->d_lock);
515 mntget(nd->path.mnt); 515 mntget(nd->path.mnt);
516 rcu_read_unlock(); 516 rcu_read_unlock();
517 br_read_unlock(vfsmount_lock); 517 br_read_unlock(&vfsmount_lock);
518 } 518 }
519 519
520 if (likely(!(nd->flags & LOOKUP_JUMPED))) 520 if (likely(!(nd->flags & LOOKUP_JUMPED)))
@@ -681,15 +681,15 @@ int follow_up(struct path *path)
681 struct mount *parent; 681 struct mount *parent;
682 struct dentry *mountpoint; 682 struct dentry *mountpoint;
683 683
684 br_read_lock(vfsmount_lock); 684 br_read_lock(&vfsmount_lock);
685 parent = mnt->mnt_parent; 685 parent = mnt->mnt_parent;
686 if (&parent->mnt == path->mnt) { 686 if (&parent->mnt == path->mnt) {
687 br_read_unlock(vfsmount_lock); 687 br_read_unlock(&vfsmount_lock);
688 return 0; 688 return 0;
689 } 689 }
690 mntget(&parent->mnt); 690 mntget(&parent->mnt);
691 mountpoint = dget(mnt->mnt_mountpoint); 691 mountpoint = dget(mnt->mnt_mountpoint);
692 br_read_unlock(vfsmount_lock); 692 br_read_unlock(&vfsmount_lock);
693 dput(path->dentry); 693 dput(path->dentry);
694 path->dentry = mountpoint; 694 path->dentry = mountpoint;
695 mntput(path->mnt); 695 mntput(path->mnt);
@@ -947,7 +947,7 @@ failed:
947 if (!(nd->flags & LOOKUP_ROOT)) 947 if (!(nd->flags & LOOKUP_ROOT))
948 nd->root.mnt = NULL; 948 nd->root.mnt = NULL;
949 rcu_read_unlock(); 949 rcu_read_unlock();
950 br_read_unlock(vfsmount_lock); 950 br_read_unlock(&vfsmount_lock);
951 return -ECHILD; 951 return -ECHILD;
952} 952}
953 953
@@ -1265,7 +1265,7 @@ static void terminate_walk(struct nameidata *nd)
1265 if (!(nd->flags & LOOKUP_ROOT)) 1265 if (!(nd->flags & LOOKUP_ROOT))
1266 nd->root.mnt = NULL; 1266 nd->root.mnt = NULL;
1267 rcu_read_unlock(); 1267 rcu_read_unlock();
1268 br_read_unlock(vfsmount_lock); 1268 br_read_unlock(&vfsmount_lock);
1269 } 1269 }
1270} 1270}
1271 1271
@@ -1620,7 +1620,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1620 nd->path = nd->root; 1620 nd->path = nd->root;
1621 nd->inode = inode; 1621 nd->inode = inode;
1622 if (flags & LOOKUP_RCU) { 1622 if (flags & LOOKUP_RCU) {
1623 br_read_lock(vfsmount_lock); 1623 br_read_lock(&vfsmount_lock);
1624 rcu_read_lock(); 1624 rcu_read_lock();
1625 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); 1625 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
1626 } else { 1626 } else {
@@ -1633,7 +1633,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1633 1633
1634 if (*name=='/') { 1634 if (*name=='/') {
1635 if (flags & LOOKUP_RCU) { 1635 if (flags & LOOKUP_RCU) {
1636 br_read_lock(vfsmount_lock); 1636 br_read_lock(&vfsmount_lock);
1637 rcu_read_lock(); 1637 rcu_read_lock();
1638 set_root_rcu(nd); 1638 set_root_rcu(nd);
1639 } else { 1639 } else {
@@ -1646,7 +1646,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1646 struct fs_struct *fs = current->fs; 1646 struct fs_struct *fs = current->fs;
1647 unsigned seq; 1647 unsigned seq;
1648 1648
1649 br_read_lock(vfsmount_lock); 1649 br_read_lock(&vfsmount_lock);
1650 rcu_read_lock(); 1650 rcu_read_lock();
1651 1651
1652 do { 1652 do {
@@ -1682,7 +1682,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1682 if (fput_needed) 1682 if (fput_needed)
1683 *fp = file; 1683 *fp = file;
1684 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq); 1684 nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
1685 br_read_lock(vfsmount_lock); 1685 br_read_lock(&vfsmount_lock);
1686 rcu_read_lock(); 1686 rcu_read_lock();
1687 } else { 1687 } else {
1688 path_get(&file->f_path); 1688 path_get(&file->f_path);