X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fsuper.c;h=ceaf2e3d594cdd89afabab0253cf1ab59badceba;hb=4c79141d28bc290ae307e3f81f5bc909c26faf6e;hp=5260d620c555fbd987eed1642649c0372670ace9;hpb=ec4883b015c3212f6f6d04fb2ff45f528492f598;p=linux-2.6-omap-h63xx.git diff --git a/fs/super.c b/fs/super.c index 5260d620c55..ceaf2e3d594 100644 --- a/fs/super.c +++ b/fs/super.c @@ -15,7 +15,7 @@ * Added kerneld support: Jacques Gelinas and Bjorn Ekwall * Added change_root: Werner Almesberger & Hans Lermen, Feb '96 * Added options to /proc/mounts: - * Torbjörn Lindh (torbjorn.lindh@gopta.se), April 14, 1996. + * Torbjörn Lindh (torbjorn.lindh@gopta.se), April 14, 1996. * Added devfs support: Richard Gooch , 13-JAN-1998 * Heavily rewritten for 'one fs - one tree' dcache architecture. AV, Mar 2000 */ @@ -40,10 +40,6 @@ #include -void get_filesystem(struct file_system_type *fs); -void put_filesystem(struct file_system_type *fs); -struct file_system_type *get_fs_type(const char *name); - LIST_HEAD(super_blocks); DEFINE_SPINLOCK(sb_lock); @@ -67,6 +63,7 @@ static struct super_block *alloc_super(struct file_system_type *type) } INIT_LIST_HEAD(&s->s_dirty); INIT_LIST_HEAD(&s->s_io); + INIT_LIST_HEAD(&s->s_more_io); INIT_LIST_HEAD(&s->s_files); INIT_LIST_HEAD(&s->s_instances); INIT_HLIST_HEAD(&s->s_anon); @@ -335,21 +332,21 @@ struct super_block *sget(struct file_system_type *type, void *data) { struct super_block *s = NULL; - struct list_head *p; + struct super_block *old; int err; retry: spin_lock(&sb_lock); - if (test) list_for_each(p, &type->fs_supers) { - struct super_block *old; - old = list_entry(p, struct super_block, s_instances); - if (!test(old, data)) - continue; - if (!grab_super(old)) - goto retry; - if (s) - destroy_super(s); - return old; + if (test) { + list_for_each_entry(old, &type->fs_supers, s_instances) { + if (!test(old, data)) + continue; + if (!grab_super(old)) + goto retry; + if (s) + destroy_super(s); + return old; + } } if (!s) { spin_unlock(&sb_lock); @@ -420,7 +417,7 @@ restart: } /* - * Call the ->sync_fs super_op against all filesytems which are r/w and + * Call the ->sync_fs super_op against all filesystems which are r/w and * which implement it. * * This operation is careful to avoid the livelock which could easily happen @@ -428,7 +425,7 @@ restart: * is used only here. We set it against all filesystems and then clear it as * we sync them. So redirtied filesystems are skipped. * - * But if process A is currently running sync_filesytems and then process B + * But if process A is currently running sync_filesystems and then process B * calls sync_filesystems as well, process B will set all the s_need_sync_fs * flags again, which will cause process A to resync everything. Fix that with * a local mutex. @@ -884,6 +881,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void error = type->get_sb(type, flags, name, data, mnt); if (error < 0) goto out_free_secdata; + BUG_ON(!mnt->mnt_sb); error = security_sb_kern_mount(mnt->mnt_sb, secdata); if (error) @@ -946,9 +944,9 @@ do_kern_mount(const char *fstype, int flags, const char *name, void *data) return mnt; } -struct vfsmount *kern_mount(struct file_system_type *type) +struct vfsmount *kern_mount_data(struct file_system_type *type, void *data) { - return vfs_kern_mount(type, 0, type->name, NULL); + return vfs_kern_mount(type, MS_KERNMOUNT, type->name, data); } -EXPORT_SYMBOL(kern_mount); +EXPORT_SYMBOL_GPL(kern_mount_data);