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

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

diff -u --recursive --new-file v2.3.50/linux/fs/smbfs/inode.c linux/fs/smbfs/inode.c
@@ -32,7 +32,7 @@
 static void smb_put_inode(struct inode *);
 static void smb_delete_inode(struct inode *);
 static void smb_put_super(struct super_block *);
-static int  smb_statfs(struct super_block *, struct statfs *, int);
+static int  smb_statfs(struct super_block *, struct statfs *);
 static void smb_set_inode_attr(struct inode *, struct smb_fattr *);
 
 static struct super_operations smb_sops =
@@ -315,8 +315,6 @@
 	kfree(sb->u.smbfs_sb.temp_buf);
 	if (server->packet)
 		smb_vfree(server->packet);
-
-	MOD_DEC_USE_COUNT;
 }
 
 struct super_block *
@@ -326,15 +324,11 @@
 	struct inode *root_inode;
 	struct smb_fattr root;
 
-	MOD_INC_USE_COUNT;
-
 	if (!raw_data)
 		goto out_no_data;
 	if (((struct smb_mount_data *) raw_data)->version != SMB_MOUNT_VERSION)
 		goto out_wrong_data;
 
-	lock_super(sb);
-
 	sb->s_blocksize = 1024;	/* Eh...  Is this correct? */
 	sb->s_blocksize_bits = 10;
 	sb->s_magic = SMB_SUPER_MAGIC;
@@ -389,7 +383,6 @@
 	if (!sb->s_root)
 		goto out_no_root;
 
-	unlock_super(sb);
 	return sb;
 
 out_no_root:
@@ -401,7 +394,6 @@
 	smb_vfree(sb->u.smbfs_sb.packet);
 out_no_mem:
 	printk(KERN_ERR "smb_read_super: allocation failure\n");
-	unlock_super(sb);
 	goto out_fail;
 out_wrong_data:
 	printk(KERN_ERR "SMBFS: need mount version %d\n", SMB_MOUNT_VERSION);
@@ -409,25 +401,17 @@
 out_no_data:
 	printk("smb_read_super: missing data argument\n");
 out_fail:
-	sb->s_dev = 0;
-	MOD_DEC_USE_COUNT;
 	return NULL;
 }
 
 static int
-smb_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+smb_statfs(struct super_block *sb, struct statfs *buf)
 {
-	struct statfs attr;
+	smb_proc_dskattr(sb, buf);
 
-	memset(&attr, 0, sizeof(attr));
-
-	smb_proc_dskattr(sb, &attr);
-
-	attr.f_type = SMB_SUPER_MAGIC;
-	attr.f_files = -1;
-	attr.f_ffree = -1;
-	attr.f_namelen = SMB_MAXPATHLEN;
-	return copy_to_user(buf, &attr, bufsiz) ? -EFAULT : 0;
+	buf->f_type = SMB_SUPER_MAGIC;
+	buf->f_namelen = SMB_MAXPATHLEN;
+	return 0;
 }
 
 int
@@ -550,12 +534,7 @@
 int smb_current_vmalloced;
 #endif
 
-static struct file_system_type smb_fs_type = {
-	"smbfs",
-	0 /* FS_NO_DCACHE doesn't work correctly */,
-	smb_read_super,
-	NULL
-};
+static DECLARE_FSTYPE( smb_fs_type, "smbfs", smb_read_super, 0);
 
 int __init init_smb_fs(void)
 {

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