[PATCH] lindent fs/namespace.c

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Ram Pai
2005-11-07 17:16:09 -05:00
committed by Linus Torvalds
parent 5addc5dd88
commit b58fed8b19

View File

@@ -165,8 +165,7 @@ static struct vfsmount *next_mnt(struct vfsmount *p, struct vfsmount *root)
return list_entry(next, struct vfsmount, mnt_child); return list_entry(next, struct vfsmount, mnt_child);
} }
static struct vfsmount * static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root)
clone_mnt(struct vfsmount *old, struct dentry *root)
{ {
struct super_block *sb = old->mnt_sb; struct super_block *sb = old->mnt_sb;
struct vfsmount *mnt = alloc_vfsmnt(old->mnt_devname); struct vfsmount *mnt = alloc_vfsmnt(old->mnt_devname);
@@ -344,7 +343,8 @@ repeat:
next = this_parent->mnt_mounts.next; next = this_parent->mnt_mounts.next;
resume: resume:
while (next != &this_parent->mnt_mounts) { while (next != &this_parent->mnt_mounts) {
struct vfsmount *p = list_entry(next, struct vfsmount, mnt_child); struct vfsmount *p =
list_entry(next, struct vfsmount, mnt_child);
next = next->next; next = next->next;
@@ -545,7 +545,6 @@ out:
/* /*
* The 2.0 compatible umount. No flags. * The 2.0 compatible umount. No flags.
*/ */
asmlinkage long sys_oldumount(char __user * name) asmlinkage long sys_oldumount(char __user * name)
{ {
return sys_umount(name, 0); return sys_umount(name, 0);
@@ -571,8 +570,7 @@ static int mount_is_safe(struct nameidata *nd)
#endif #endif
} }
static int static int lives_below_in_same_fs(struct dentry *d, struct dentry *dentry)
lives_below_in_same_fs(struct dentry *d, struct dentry *dentry)
{ {
while (1) { while (1) {
if (d == dentry) if (d == dentry)
@@ -718,7 +716,6 @@ out:
* If you've mounted a non-root directory somewhere and want to do remount * If you've mounted a non-root directory somewhere and want to do remount
* on it - tough luck. * on it - tough luck.
*/ */
static int do_remount(struct nameidata *nd, int flags, int mnt_flags, static int do_remount(struct nameidata *nd, int flags, int mnt_flags,
void *data) void *data)
{ {
@@ -986,8 +983,8 @@ EXPORT_SYMBOL_GPL(mark_mounts_for_expiry);
* Note that this function differs from copy_from_user() in that it will oops * Note that this function differs from copy_from_user() in that it will oops
* on bad values of `to', rather than returning a short copy. * on bad values of `to', rather than returning a short copy.
*/ */
static long static long exact_copy_from_user(void *to, const void __user * from,
exact_copy_from_user(void *to, const void __user *from, unsigned long n) unsigned long n)
{ {
char *t = to; char *t = to;
const char __user *f = from; const char __user *f = from;
@@ -1295,9 +1292,11 @@ static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
if (fs) { if (fs) {
atomic_inc(&fs->count); atomic_inc(&fs->count);
task_unlock(p); task_unlock(p);
if (fs->root==old_nd->dentry&&fs->rootmnt==old_nd->mnt) if (fs->root == old_nd->dentry
&& fs->rootmnt == old_nd->mnt)
set_fs_root(fs, new_nd->mnt, new_nd->dentry); set_fs_root(fs, new_nd->mnt, new_nd->dentry);
if (fs->pwd==old_nd->dentry&&fs->pwdmnt==old_nd->mnt) if (fs->pwd == old_nd->dentry
&& fs->pwdmnt == old_nd->mnt)
set_fs_pwd(fs, new_nd->mnt, new_nd->dentry); set_fs_pwd(fs, new_nd->mnt, new_nd->dentry);
put_fs_struct(fs); put_fs_struct(fs);
} else } else
@@ -1327,8 +1326,8 @@ static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
* though, so you may need to say mount --bind /nfs/my_root /nfs/my_root * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
* first. * first.
*/ */
asmlinkage long sys_pivot_root(const char __user * new_root,
asmlinkage long sys_pivot_root(const char __user *new_root, const char __user *put_old) const char __user * put_old)
{ {
struct vfsmount *tmp; struct vfsmount *tmp;
struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd; struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
@@ -1339,7 +1338,8 @@ asmlinkage long sys_pivot_root(const char __user *new_root, const char __user *p
lock_kernel(); lock_kernel();
error = __user_walk(new_root, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &new_nd); error = __user_walk(new_root, LOOKUP_FOLLOW | LOOKUP_DIRECTORY,
&new_nd);
if (error) if (error)
goto out0; goto out0;
error = -EINVAL; error = -EINVAL;
@@ -1466,8 +1466,7 @@ void __init mnt_init(unsigned long mempages)
mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount), mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount),
0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL, NULL); 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL, NULL);
mount_hashtable = (struct list_head *) mount_hashtable = (struct list_head *)__get_free_page(GFP_ATOMIC);
__get_free_page(GFP_ATOMIC);
if (!mount_hashtable) if (!mount_hashtable)
panic("Failed to allocate mount hash table\n"); panic("Failed to allocate mount hash table\n");