Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312939
b: refs/heads/master
c: f015f12
h: refs/heads/master
i:
  312937: 3154bc2
  312935: 399df60
v: v3
  • Loading branch information
David Howells authored and Al Viro committed Jul 14, 2012
1 parent 6957852 commit 59617f6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 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: be34d1a3bc4b6f357a49acb55ae870c81337e4f0
refs/heads/master: f015f1267b23d3530d3f874243fb83cb5f443005
10 changes: 10 additions & 0 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,16 @@ static int follow_up_rcu(struct path *path)
return 1;
}

/*
* follow_up - Find the mountpoint of path's vfsmount
*
* Given a path, find the mountpoint of its source file system.
* Replace @path with the path of the mountpoint in the parent mount.
* Up is towards /.
*
* Return 1 if we went up a level and 0 if we were already at the
* root.
*/
int follow_up(struct path *path)
{
struct mount *mnt = real_mount(path->mnt);
Expand Down
16 changes: 14 additions & 2 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,20 @@ struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry,
}

/*
* lookup_mnt increments the ref count before returning
* the vfsmount struct.
* lookup_mnt - Return the first child mount mounted at path
*
* "First" means first mounted chronologically. If you create the
* following mounts:
*
* mount /dev/sda1 /mnt
* mount /dev/sda2 /mnt
* mount /dev/sda3 /mnt
*
* Then lookup_mnt() on the base /mnt dentry in the root mount will
* return successively the root dentry and vfsmount of /dev/sda1, then
* /dev/sda2, then /dev/sda3, then NULL.
*
* lookup_mnt takes a reference to the found vfsmount.
*/
struct vfsmount *lookup_mnt(struct path *path)
{
Expand Down

0 comments on commit 59617f6

Please sign in to comment.