Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209642
b: refs/heads/master
c: 99b7db7
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Al Viro committed Aug 18, 2010
1 parent e32bb75 commit b6e3b31
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 78 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6416ccb7899960868f5016751fb81bf25213d24f
refs/heads/master: 99b7db7b8ffd6bb755eb0a175596421a0b581cb2
11 changes: 6 additions & 5 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,7 @@ static int prepend_path(const struct path *path, struct path *root,
bool slash = false;
int error = 0;

spin_lock(&vfsmount_lock);
br_read_lock(vfsmount_lock);
while (dentry != root->dentry || vfsmnt != root->mnt) {
struct dentry * parent;

Expand Down Expand Up @@ -1964,7 +1964,7 @@ static int prepend_path(const struct path *path, struct path *root,
if (!error && !slash)
error = prepend(buffer, buflen, "/", 1);

spin_unlock(&vfsmount_lock);
br_read_unlock(vfsmount_lock);
return error;

global_root:
Expand Down Expand Up @@ -2302,11 +2302,12 @@ int path_is_under(struct path *path1, struct path *path2)
struct vfsmount *mnt = path1->mnt;
struct dentry *dentry = path1->dentry;
int res;
spin_lock(&vfsmount_lock);

br_read_lock(vfsmount_lock);
if (mnt != path2->mnt) {
for (;;) {
if (mnt->mnt_parent == mnt) {
spin_unlock(&vfsmount_lock);
br_read_unlock(vfsmount_lock);
return 0;
}
if (mnt->mnt_parent == path2->mnt)
Expand All @@ -2316,7 +2317,7 @@ int path_is_under(struct path *path1, struct path *path2)
dentry = mnt->mnt_mountpoint;
}
res = is_subdir(dentry, path2->dentry);
spin_unlock(&vfsmount_lock);
br_read_unlock(vfsmount_lock);
return res;
}
EXPORT_SYMBOL(path_is_under);
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* 2 of the License, or (at your option) any later version.
*/

#include <linux/lglock.h>

struct super_block;
struct linux_binprm;
struct path;
Expand Down Expand Up @@ -70,7 +72,8 @@ extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int);

extern void __init mnt_init(void);

extern spinlock_t vfsmount_lock;
DECLARE_BRLOCK(vfsmount_lock);


/*
* fs_struct.c
Expand Down
7 changes: 4 additions & 3 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,16 @@ int follow_up(struct path *path)
{
struct vfsmount *parent;
struct dentry *mountpoint;
spin_lock(&vfsmount_lock);

br_read_lock(vfsmount_lock);
parent = path->mnt->mnt_parent;
if (parent == path->mnt) {
spin_unlock(&vfsmount_lock);
br_read_unlock(vfsmount_lock);
return 0;
}
mntget(parent);
mountpoint = dget(path->mnt->mnt_mountpoint);
spin_unlock(&vfsmount_lock);
br_read_unlock(vfsmount_lock);
dput(path->dentry);
path->dentry = mountpoint;
mntput(path->mnt);
Expand Down
Loading

0 comments on commit b6e3b31

Please sign in to comment.