patch-2.3.51 linux/fs/fat/inode.c

Next file: linux/fs/filesystems.c
Previous file: linux/fs/ext2/super.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/fat/inode.c linux/fs/fat/inode.c
@@ -194,11 +194,6 @@
 		kfree(MSDOS_SB(sb)->options.iocharset);
 		MSDOS_SB(sb)->options.iocharset = NULL;
 	}
-
-	if (MSDOS_SB(sb)->put_super_callback)
-		MSDOS_SB(sb)->put_super_callback(sb);
-	MOD_DEC_USE_COUNT;
-	return;
 }
 
 
@@ -444,9 +439,7 @@
 	sbi->cvf_format = NULL;
 	sbi->private_data = NULL;
 
-	MOD_INC_USE_COUNT;
 	sbi->dir_ops = fs_dir_inode_ops;
-	sbi->put_super_callback = NULL;
 	sb->s_op = &fat_sops;
 	if (hardsect_size[MAJOR(sb->s_dev)] != NULL){
 		blksize = hardsect_size[MAJOR(sb->s_dev)][MINOR(sb->s_dev)];
@@ -465,7 +458,6 @@
 	memcpy(&(sbi->options), &opts, sizeof(struct fat_mount_options));
 
 	fat_cache_init();
-	lock_super(sb);
 	if( blksize > 1024 )
 	  {
 	    /* Force the superblock to a larger size here. */
@@ -479,7 +471,6 @@
 	    set_blocksize(sb->s_dev, 1024);
 	  }
 	bh = bread(sb->s_dev, 0, sb->s_blocksize);
-	unlock_super(sb);
 	if (bh == NULL || !buffer_uptodate(bh)) {
 		brelse (bh);
 		goto out_no_bread;
@@ -693,23 +684,21 @@
 		printk("VFS: freeing iocharset=%s\n", opts.iocharset);
 		kfree(opts.iocharset);
 	}
-	sb->s_dev = 0;
 	if(sbi->private_data)
 		kfree(sbi->private_data);
 	sbi->private_data=NULL;
  
-	MOD_DEC_USE_COUNT;
 	return NULL;
 }
 
-int fat_statfs(struct super_block *sb,struct statfs *buf, int bufsiz)
+int fat_statfs(struct super_block *sb,struct statfs *buf)
 {
 	int free,nr;
-	struct statfs tmp;
        
 	if (MSDOS_SB(sb)->cvf_format &&
 	    MSDOS_SB(sb)->cvf_format->cvf_statfs)
-		return MSDOS_SB(sb)->cvf_format->cvf_statfs(sb,buf,bufsiz);
+		return MSDOS_SB(sb)->cvf_format->cvf_statfs(sb,buf,
+						sizeof(struct statfs));
 	  
 	lock_fat(sb);
 	if (MSDOS_SB(sb)->free_clusters != -1)
@@ -721,15 +710,13 @@
 		MSDOS_SB(sb)->free_clusters = free;
 	}
 	unlock_fat(sb);
-	tmp.f_type = sb->s_magic;
-	tmp.f_bsize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
-	tmp.f_blocks = MSDOS_SB(sb)->clusters;
-	tmp.f_bfree = free;
-	tmp.f_bavail = free;
-	tmp.f_files = 0;
-	tmp.f_ffree = 0;
-	tmp.f_namelen = MSDOS_SB(sb)->options.isvfat ? 260 : 12;
-	return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+	buf->f_type = sb->s_magic;
+	buf->f_bsize = MSDOS_SB(sb)->cluster_size*SECTOR_SIZE;
+	buf->f_blocks = MSDOS_SB(sb)->clusters;
+	buf->f_bfree = free;
+	buf->f_bavail = free;
+	buf->f_namelen = MSDOS_SB(sb)->options.isvfat ? 260 : 12;
+	return 0;
 }
 
 static int is_exec(char *extension)

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