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

Next file: linux/fs/ufs/super.c
Previous file: linux/fs/udf/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/udf/super.c linux/fs/udf/super.c
@@ -93,25 +93,21 @@
 static void udf_open_lvid(struct super_block *);
 static void udf_close_lvid(struct super_block *);
 static unsigned int udf_count_free(struct super_block *);
-static int udf_statfs(struct super_block *, struct statfs *, int);
+static int udf_statfs(struct super_block *, struct statfs *);
 
 /* UDF filesystem type */
-static struct file_system_type udf_fstype = {
-	name:				"udf",
-	fs_flags:			FS_REQUIRES_DEV,
-	read_super:			udf_read_super,
-};
+static DECLARE_FSTYPE_DEV(udf_fstype, "udf", udf_read_super);
 
 /* Superblock operations */
 static struct super_operations udf_sb_ops = {
-	read_inode:			udf_read_inode,
+	read_inode:		udf_read_inode,
 	write_inode:		udf_write_inode,
-	put_inode:			udf_put_inode,
+	put_inode:		udf_put_inode,
 	delete_inode:		udf_delete_inode,
-	put_super:			udf_put_super,
+	put_super:		udf_put_super,
 	write_super:		udf_write_super,
-	statfs:				udf_statfs,
-	remount_fs:			udf_remount_fs,
+	statfs:			udf_statfs,
+	remount_fs:		udf_remount_fs,
 };
 
 struct udf_options
@@ -1326,10 +1322,6 @@
 	uopt.gid = -1;
 	uopt.umask = 0;
 
-	/* Lock the module in memory (if applicable) */
-	MOD_INC_USE_COUNT;
-
-	lock_super(sb);
 	memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info));
 
 #if CONFIG_UDF_RW != 1
@@ -1438,7 +1430,6 @@
 	}
 	if (!(sb->s_flags & MS_RDONLY))
 		udf_open_lvid(sb);
-	unlock_super(sb);
 
 	/* Assign the root inode */
 	/* assign inodes by physical block number */
@@ -1470,8 +1461,6 @@
 		udf_close_lvid(sb);
 	udf_release_data(UDF_SB_LVIDBH(sb));
 	UDF_SB_FREE(sb);
-	unlock_super(sb);
-	MOD_DEC_USE_COUNT;
 	return NULL;
 }
 
@@ -1530,8 +1519,6 @@
 	for (i=0; i<UDF_MAX_BLOCK_LOADED; i++)
 		udf_release_data(UDF_SB_BLOCK_BITMAP(sb, i));
 	UDF_SB_FREE(sb);
-
-	MOD_DEC_USE_COUNT;
 }
 
 /*
@@ -1548,29 +1535,21 @@
  *	Written, tested, and released.
  */
 static int
-udf_statfs(struct super_block *sb, struct statfs *buf, int bufsize)
+udf_statfs(struct super_block *sb, struct statfs *buf)
 {
-	int size;
-	struct statfs tmp;
-	int rc;
-
-	size = (bufsize < sizeof(tmp)) ? bufsize: sizeof(tmp);
-
-	memset(&tmp, 0, sizeof(tmp));
-	tmp.f_type = UDF_SUPER_MAGIC;
-	tmp.f_bsize = sb->s_blocksize;
-	tmp.f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb));
-	tmp.f_bfree = udf_count_free(sb);
-	tmp.f_bavail = tmp.f_bfree;
-	tmp.f_files = (UDF_SB_LVIDBH(sb) ?
+	buf->f_type = UDF_SUPER_MAGIC;
+	buf->f_bsize = sb->s_blocksize;
+	buf->f_blocks = UDF_SB_PARTLEN(sb, UDF_SB_PARTITION(sb));
+	buf->f_bfree = udf_count_free(sb);
+	buf->f_bavail = buf->f_bfree;
+	buf->f_files = (UDF_SB_LVIDBH(sb) ?
 		(le32_to_cpu(UDF_SB_LVIDIU(sb)->numFiles) +
-		le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + tmp.f_bfree;
-	tmp.f_ffree = tmp.f_bfree;
+		le32_to_cpu(UDF_SB_LVIDIU(sb)->numDirs)) : 0) + buf->f_bfree;
+	buf->f_ffree = buf->f_bfree;
 	/* __kernel_fsid_t f_fsid */
-	tmp.f_namelen = UDF_NAME_LEN;
+	buf->f_namelen = UDF_NAME_LEN;
 
-	rc= copy_to_user(buf, &tmp, size) ? -EFAULT: 0;
-	return rc;
+	return 0;
 }
 
 static unsigned char udf_bitmap_lookup[16] = {

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