]> git.hungrycats.org Git - linux/commitdiff
[PATCH] (5/6) more ->get_sb()
authorAlexander Viro <viro@math.psu.edu>
Thu, 7 Feb 2002 01:57:14 +0000 (17:57 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 7 Feb 2002 01:57:14 +0000 (17:57 -0800)
sysvfs and v7 switched.
* super.c: switched to ->get_sb()
* ChangeLog: fixed dates ;-)

fs/sysv/ChangeLog
fs/sysv/super.c

index 5e13c96e27a4f8901fe64c495423b9e0da92dfb8..adda370673202693bf6c812629f0357b04a46e33 100644 (file)
@@ -1,13 +1,18 @@
+Thu Feb  7 2002  Alexander Viro  <viro@math.psu.edu>
+
+       * super.c: switched to ->get_sb()
+       * ChangeLog: fixed dates ;-)
+
 2002-01-24  David S. Miller  <davem@redhat.com>
 
        * inode.c: Include linux/init.h
 
-Mon Jan 21 2001  Alexander Viro  <viro@math.psu.edu>
+Mon Jan 21 2002  Alexander Viro  <viro@math.psu.edu>
        * ialloc.c (sysv_new_inode): zero SYSV_I(inode)->i_data out.
        * i_vnode renamed to vfs_inode.  Sorry, but let's keep that
          consistent.
 
-Sat Jan 19 2001  Christoph Hellwig  <hch@infradead.org>
+Sat Jan 19 2002  Christoph Hellwig  <hch@infradead.org>
 
        * include/linux/sysv_fs.h (SYSV_I): Get fs-private inode data using
                list_entry() instead of inode->u.
@@ -19,7 +24,7 @@ Sat Jan 19 2001  Christoph Hellwig  <hch@infradead.org>
                in the case of failed register_filesystem for V7.
        (exit_sysv_fs): Destroy inode cache.
 
-Sat Jan 19 2001  Christoph Hellwig  <hch@infradead.org>
+Sat Jan 19 2002  Christoph Hellwig  <hch@infradead.org>
 
        * include/linux/sysv_fs.h: Include <linux/sysv_fs_i.h>, declare SYSV_I().
        * dir.c (sysv_find_entry): Use SYSV_I() instead of ->u.sysv_i to
@@ -32,7 +37,7 @@ Sat Jan 19 2001  Christoph Hellwig  <hch@infradead.org>
        * symlink.c (sysv_readlink): Likewise.
        (sysv_follow_link): Likewise.
 
-Fri Jan  4 2001  Alexander Viro  <viro@math.psu.edu>
+Fri Jan  4 2002  Alexander Viro  <viro@math.psu.edu>
 
        * ialloc.c (sysv_free_inode): Use sb->s_id instead of bdevname().
        * inode.c (sysv_read_inode): Likewise.
index 1e853dd27a9aafad06b299520843a4c2c70cf75d..793578ec0b826443de9afd9cbb8ed66d2d73a2f9 100644 (file)
@@ -340,8 +340,7 @@ static int complete_read_super(struct super_block *sb, int silent, int size)
        return 1;
 }
 
-static struct super_block *sysv_read_super(struct super_block *sb,
-                                          void *data, int silent)
+static int sysv_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct buffer_head *bh1;
        struct buffer_head *bh = NULL;
@@ -397,7 +396,7 @@ static struct super_block *sysv_read_super(struct super_block *sb,
                sb->sv_bh1 = bh1;
                sb->sv_bh2 = bh;
                if (complete_read_super(sb, silent, size))
-                       return sb;
+                       return 0;
        }
 
        brelse(bh1);
@@ -405,7 +404,7 @@ static struct super_block *sysv_read_super(struct super_block *sb,
        sb_set_blocksize(sb, BLOCK_SIZE);
        printk("oldfs: cannot read superblock\n");
 failed:
-       return NULL;
+       return -EINVAL;
 
 Eunknown:
        brelse(bh);
@@ -421,8 +420,7 @@ Ebadsize:
        goto failed;
 }
 
-static struct super_block *v7_read_super(struct super_block *sb,void *data,
-                                 int silent)
+static int v7_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct buffer_head *bh, *bh2 = NULL;
        struct v7_super_block *v7sb;
@@ -466,18 +464,41 @@ static struct super_block *v7_read_super(struct super_block *sb,void *data,
        sb->sv_bh1 = bh;
        sb->sv_bh2 = bh;
        if (complete_read_super(sb, silent, 1))
-               return sb;
+               return 0;
 
 failed:
        brelse(bh2);
        brelse(bh);
-       return NULL;
+       return -EINVAL;
 }
 
 /* Every kernel module contains stuff like this. */
 
-static DECLARE_FSTYPE_DEV(sysv_fs_type, "sysv", sysv_read_super);
-static DECLARE_FSTYPE_DEV(v7_fs_type, "v7", v7_read_super);
+static struct super_block *sysv_get_sb(struct file_system_type *fs_type,
+       int flags, char *dev_name, void *data)
+{
+       return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super);
+}
+
+static struct super_block *v7_get_sb(struct file_system_type *fs_type,
+       int flags, char *dev_name, void *data)
+{
+       return get_sb_bdev(fs_type, flags, dev_name, data, v7_fill_super);
+}
+
+static struct file_system_type sysv_fs_type = {
+       owner:          THIS_MODULE,
+       name:           "sysv",
+       get_sb:         sysv_get_sb,
+       fs_flags:       FS_REQUIRES_DEV,
+};
+
+static struct file_system_type v7_fs_type = {
+       owner:          THIS_MODULE,
+       name:           "v7",
+       get_sb:         v7_get_sb,
+       fs_flags:       FS_REQUIRES_DEV,
+};
 
 extern int sysv_init_icache(void) __init;
 extern void sysv_destroy_icache(void);