patch-2.3.51 linux/fs/hfs/super.c

Next file: linux/fs/hpfs/hpfs_fn.h
Previous file: linux/fs/hfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/hfs/super.c linux/fs/hfs/super.c
@@ -36,7 +36,7 @@
 
 static void hfs_read_inode(struct inode *);
 static void hfs_put_super(struct super_block *);
-static int hfs_statfs(struct super_block *, struct statfs *, int);
+static int hfs_statfs(struct super_block *, struct statfs *);
 static void hfs_write_super(struct super_block *);
 
 /*================ Global variables ================*/
@@ -51,11 +51,7 @@
 
 /*================ File-local variables ================*/
 
-static struct file_system_type hfs_fs = {
-        "hfs",
-	FS_REQUIRES_DEV,
-	hfs_read_super, 
-	NULL};
+static DECLARE_FSTYPE_DEV(hfs_fs, "hfs", hfs_read_super);
 
 /*================ File-local functions ================*/
 
@@ -126,8 +122,6 @@
 
 	/* restore default blocksize for the device */
 	set_blocksize(sb->s_dev, BLOCK_SIZE);
-
-	MOD_DEC_USE_COUNT;
 }
 
 /*
@@ -139,21 +133,20 @@
  *
  * changed f_files/f_ffree to reflect the fs_ablock/free_ablocks.
  */
-static int hfs_statfs(struct super_block *sb, struct statfs *buf, int len)
+static int hfs_statfs(struct super_block *sb, struct statfs *buf)
 {
 	struct hfs_mdb *mdb = HFS_SB(sb)->s_mdb;
-	struct statfs tmp;
 
-	tmp.f_type = HFS_SUPER_MAGIC;
-	tmp.f_bsize = HFS_SECTOR_SIZE;
-	tmp.f_blocks = mdb->alloc_blksz * mdb->fs_ablocks;
-	tmp.f_bfree = mdb->alloc_blksz * mdb->free_ablocks;
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = mdb->fs_ablocks;  
-	tmp.f_ffree = mdb->free_ablocks;
-	tmp.f_namelen = HFS_NAMELEN;
+	buf->f_type = HFS_SUPER_MAGIC;
+	buf->f_bsize = HFS_SECTOR_SIZE;
+	buf->f_blocks = mdb->alloc_blksz * mdb->fs_ablocks;
+	buf->f_bfree = mdb->alloc_blksz * mdb->free_ablocks;
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = mdb->fs_ablocks;  
+	buf->f_ffree = mdb->free_ablocks;
+	buf->f_namelen = HFS_NAMELEN;
 
-	return copy_to_user(buf, &tmp, len) ? -EFAULT : 0;
+	return 0;
 }
 
 /*
@@ -407,11 +400,6 @@
 		goto bail3;
 	}
 
-	/* in case someone tries to unload the module while we wait on I/O */
-	MOD_INC_USE_COUNT;
-
-	lock_super(s);
-
 	/* set the device driver to 512-byte blocks */
 	set_blocksize(dev, HFS_SECTOR_SIZE);
 
@@ -471,7 +459,6 @@
 	s->s_root->d_op = &hfs_dentry_operations;
 
 	/* everything's okay */
-	unlock_super(s);
 	return s;
 
 bail_no_root: 
@@ -481,10 +468,7 @@
 	hfs_mdb_put(mdb, s->s_flags & MS_RDONLY);
 bail2:
 	set_blocksize(dev, BLOCK_SIZE);
-	unlock_super(s);
-	MOD_DEC_USE_COUNT;
 bail3:
-	s->s_dev = 0;
 	return NULL;	
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)