Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280211
b: refs/heads/master
c: 8208a22
h: refs/heads/master
i:
  280209: bb37077
  280207: 3e32037
v: v3
  • Loading branch information
Al Viro committed Jan 4, 2012
1 parent fe8319b commit 312a2bd
Show file tree
Hide file tree
Showing 20 changed files with 727 additions and 787 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: d10577a8d86a0c735488d66d32289a6d66bcfa20
refs/heads/master: 8208a22bb8bd3c52ef634b4ff194f14892ab1713
2 changes: 0 additions & 2 deletions trunk/fs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ else
obj-y += no-block.o
endif

obj-$(CONFIG_PROC_FS) += proc_namespace.o

obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o
obj-y += notify/
obj-$(CONFIG_EPOLL) += eventpoll.o
Expand Down
10 changes: 4 additions & 6 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,6 @@ static int prepend_path(const struct path *path,
{
struct dentry *dentry = path->dentry;
struct vfsmount *vfsmnt = path->mnt;
struct mount *mnt = real_mount(vfsmnt);
bool slash = false;
int error = 0;

Expand All @@ -2462,11 +2461,10 @@ static int prepend_path(const struct path *path,

if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
/* Global root? */
if (!mnt_has_parent(mnt))
if (!mnt_has_parent(vfsmnt))
goto global_root;
dentry = mnt->mnt_mountpoint;
mnt = mnt->mnt_parent;
vfsmnt = &mnt->mnt;
dentry = vfsmnt->mnt_mountpoint;
vfsmnt = vfsmnt->mnt_parent;
continue;
}
parent = dentry->d_parent;
Expand Down Expand Up @@ -2503,7 +2501,7 @@ static int prepend_path(const struct path *path,
if (!slash)
error = prepend(buffer, buflen, "/", 1);
if (!error)
error = real_mount(vfsmnt)->mnt_ns ? 1 : 2;
error = vfsmnt->mnt_ns ? 1 : 2;
goto out;
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/fs/fhandle.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <linux/personality.h>
#include <asm/uaccess.h>
#include "internal.h"
#include "mount.h"

static long do_sys_name_to_handle(struct path *path,
struct file_handle __user *ufh,
Expand Down Expand Up @@ -67,8 +66,7 @@ static long do_sys_name_to_handle(struct path *path,
} else
retval = 0;
/* copy the mount id */
if (copy_to_user(mnt_id, &real_mount(path->mnt)->mnt_id,
sizeof(*mnt_id)) ||
if (copy_to_user(mnt_id, &path->mnt->mnt_id, sizeof(*mnt_id)) ||
copy_to_user(ufh, handle,
sizeof(struct file_handle) + handle_bytes))
retval = -EFAULT;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ struct super_block;
struct file_system_type;
struct linux_binprm;
struct path;
struct mount;

/*
* block_dev.c
Expand Down Expand Up @@ -47,6 +46,7 @@ extern void __init chrdev_init(void);
extern int copy_mount_options(const void __user *, unsigned long *);
extern int copy_mount_string(const void __user *, char **);

extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
extern struct vfsmount *lookup_mnt(struct path *);
extern int finish_automount(struct vfsmount *, struct path *);

Expand Down
71 changes: 1 addition & 70 deletions trunk/fs/mount.h
Original file line number Diff line number Diff line change
@@ -1,75 +1,6 @@
#include <linux/mount.h>
#include <linux/seq_file.h>
#include <linux/poll.h>

struct mnt_namespace {
atomic_t count;
struct mount * root;
struct list_head list;
wait_queue_head_t poll;
int event;
};

struct mnt_pcp {
int mnt_count;
int mnt_writers;
};

struct mount {
struct list_head mnt_hash;
struct mount *mnt_parent;
struct dentry *mnt_mountpoint;
struct vfsmount mnt;
#ifdef CONFIG_SMP
struct mnt_pcp __percpu *mnt_pcp;
atomic_t mnt_longterm; /* how many of the refs are longterm */
#else
int mnt_count;
int mnt_writers;
#endif
struct list_head mnt_mounts; /* list of children, anchored here */
struct list_head mnt_child; /* and going through their mnt_child */
const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
struct list_head mnt_list;
struct list_head mnt_expire; /* link in fs-specific expiry list */
struct list_head mnt_share; /* circular list of shared mounts */
struct list_head mnt_slave_list;/* list of slave mounts */
struct list_head mnt_slave; /* slave list entry */
struct mount *mnt_master; /* slave is on master->mnt_slave_list */
struct mnt_namespace *mnt_ns; /* containing namespace */
#ifdef CONFIG_FSNOTIFY
struct hlist_head mnt_fsnotify_marks;
__u32 mnt_fsnotify_mask;
#endif
int mnt_id; /* mount identifier */
int mnt_group_id; /* peer group identifier */
int mnt_expiry_mark; /* true if marked for expiry */
int mnt_pinned;
int mnt_ghosts;
};

static inline struct mount *real_mount(struct vfsmount *mnt)
{
return container_of(mnt, struct mount, mnt);
}

static inline int mnt_has_parent(struct mount *mnt)
static inline int mnt_has_parent(struct vfsmount *mnt)
{
return mnt != mnt->mnt_parent;
}

extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);

static inline void get_mnt_ns(struct mnt_namespace *ns)
{
atomic_inc(&ns->count);
}

struct proc_mounts {
struct seq_file m; /* must be the first element */
struct mnt_namespace *ns;
struct path root;
int (*show)(struct seq_file *, struct vfsmount *);
};

extern const struct seq_operations mounts_op;
41 changes: 19 additions & 22 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <asm/uaccess.h>

#include "internal.h"
#include "mount.h"

/* [Feb-1997 T. Schoebel-Theuer]
* Fundamental changes in the pathname lookup mechanisms (namei)
Expand Down Expand Up @@ -677,38 +676,36 @@ follow_link(struct path *link, struct nameidata *nd, void **p)

static int follow_up_rcu(struct path *path)
{
struct mount *mnt = real_mount(path->mnt);
struct mount *parent;
struct vfsmount *parent;
struct dentry *mountpoint;

parent = mnt->mnt_parent;
if (&parent->mnt == path->mnt)
parent = path->mnt->mnt_parent;
if (parent == path->mnt)
return 0;
mountpoint = mnt->mnt_mountpoint;
mountpoint = path->mnt->mnt_mountpoint;
path->dentry = mountpoint;
path->mnt = &parent->mnt;
path->mnt = parent;
return 1;
}

int follow_up(struct path *path)
{
struct mount *mnt = real_mount(path->mnt);
struct mount *parent;
struct vfsmount *parent;
struct dentry *mountpoint;

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

Expand Down Expand Up @@ -887,7 +884,7 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
struct inode **inode)
{
for (;;) {
struct mount *mounted;
struct vfsmount *mounted;
/*
* Don't forget we might have a non-mountpoint managed dentry
* that wants to block transit.
Expand All @@ -901,8 +898,8 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
mounted = __lookup_mnt(path->mnt, path->dentry, 1);
if (!mounted)
break;
path->mnt = &mounted->mnt;
path->dentry = mounted->mnt.mnt_root;
path->mnt = mounted;
path->dentry = mounted->mnt_root;
nd->flags |= LOOKUP_JUMPED;
nd->seq = read_seqcount_begin(&path->dentry->d_seq);
/*
Expand All @@ -918,12 +915,12 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
static void follow_mount_rcu(struct nameidata *nd)
{
while (d_mountpoint(nd->path.dentry)) {
struct mount *mounted;
struct vfsmount *mounted;
mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1);
if (!mounted)
break;
nd->path.mnt = &mounted->mnt;
nd->path.dentry = mounted->mnt.mnt_root;
nd->path.mnt = mounted;
nd->path.dentry = mounted->mnt_root;
nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
}
}
Expand Down Expand Up @@ -2492,7 +2489,7 @@ static int may_mknod(mode_t mode)
}
}

SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
unsigned, dev)
{
struct dentry *dentry;
Expand Down Expand Up @@ -2539,7 +2536,7 @@ SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode,
return error;
}

SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev)
SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
{
return sys_mknodat(AT_FDCWD, filename, mode, dev);
}
Expand Down
Loading

0 comments on commit 312a2bd

Please sign in to comment.