mirror of https://github.com/torvalds/linux.git
d_path: prepend_path(): get rid of vfsmnt
it's kept equal to &mnt->mnt all along. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
ad08ae5865
commit
7c0d552fd5
11
fs/d_path.c
11
fs/d_path.c
|
|
@ -90,7 +90,6 @@ static int prepend_path(const struct path *path,
|
||||||
struct prepend_buffer *p)
|
struct prepend_buffer *p)
|
||||||
{
|
{
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
struct vfsmount *vfsmnt;
|
|
||||||
struct mount *mnt;
|
struct mount *mnt;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
unsigned seq, m_seq = 0;
|
unsigned seq, m_seq = 0;
|
||||||
|
|
@ -105,18 +104,17 @@ static int prepend_path(const struct path *path,
|
||||||
b = *p;
|
b = *p;
|
||||||
error = 0;
|
error = 0;
|
||||||
dentry = path->dentry;
|
dentry = path->dentry;
|
||||||
vfsmnt = path->mnt;
|
mnt = real_mount(path->mnt);
|
||||||
mnt = real_mount(vfsmnt);
|
|
||||||
read_seqbegin_or_lock(&rename_lock, &seq);
|
read_seqbegin_or_lock(&rename_lock, &seq);
|
||||||
while (dentry != root->dentry || vfsmnt != root->mnt) {
|
while (dentry != root->dentry || &mnt->mnt != root->mnt) {
|
||||||
struct dentry * parent;
|
struct dentry * parent;
|
||||||
|
|
||||||
if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
|
if (dentry == mnt->mnt.mnt_root || IS_ROOT(dentry)) {
|
||||||
struct mount *parent = READ_ONCE(mnt->mnt_parent);
|
struct mount *parent = READ_ONCE(mnt->mnt_parent);
|
||||||
struct mnt_namespace *mnt_ns;
|
struct mnt_namespace *mnt_ns;
|
||||||
|
|
||||||
/* Escaped? */
|
/* Escaped? */
|
||||||
if (dentry != vfsmnt->mnt_root) {
|
if (dentry != mnt->mnt.mnt_root) {
|
||||||
b = *p;
|
b = *p;
|
||||||
error = 3;
|
error = 3;
|
||||||
break;
|
break;
|
||||||
|
|
@ -125,7 +123,6 @@ static int prepend_path(const struct path *path,
|
||||||
if (mnt != parent) {
|
if (mnt != parent) {
|
||||||
dentry = READ_ONCE(mnt->mnt_mountpoint);
|
dentry = READ_ONCE(mnt->mnt_mountpoint);
|
||||||
mnt = parent;
|
mnt = parent;
|
||||||
vfsmnt = &mnt->mnt;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
mnt_ns = READ_ONCE(mnt->mnt_ns);
|
mnt_ns = READ_ONCE(mnt->mnt_ns);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue