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

Next file: linux/fs/cramfs/inode.c
Previous file: linux/fs/coda/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/fs/coda/inode.c linux/fs/coda/inode.c
@@ -37,8 +37,7 @@
 static void coda_put_inode(struct inode *);
 static void coda_delete_inode(struct inode *);
 static void coda_put_super(struct super_block *);
-static int coda_statfs(struct super_block *sb, struct statfs *buf, 
-		       int bufsiz);
+static int coda_statfs(struct super_block *sb, struct statfs *buf);
 
 /* exported operations */
 struct super_operations coda_super_operations =
@@ -61,16 +60,13 @@
         int error;
 
 	ENTRY;
-        MOD_INC_USE_COUNT; 
 
         vc = &coda_upc_comm;
 	sbi = &coda_super_info;
 
         if ( sbi->sbi_sb ) {
 		printk("Already mounted\n");
-		unlock_super(sb);
 		EXIT;  
-		MOD_DEC_USE_COUNT;
 		return NULL;
 	}
 
@@ -80,7 +76,6 @@
 	INIT_LIST_HEAD(&(sbi->sbi_cchead));
 	INIT_LIST_HEAD(&(sbi->sbi_volroothead));
 
-        lock_super(sb);
         sb->u.generic_sbp = sbi;
         sb->s_blocksize = 1024;	/* XXXXX  what do we put here?? */
         sb->s_blocksize_bits = 10;
@@ -93,7 +88,6 @@
 	if ( error ) {
 	        printk("coda_read_super: coda_get_rootfid failed with %d\n",
 		       error);
-		sb->s_dev = 0;
 		goto error;
 	}	  
 	printk("coda_read_super: rootfid is %s\n", coda_f2s(&fid));
@@ -102,7 +96,6 @@
         error = coda_cnode_make(&root, &fid, sb);
         if ( error || !root ) {
 	    printk("Failure of coda_cnode_make for root: error %d\n", error);
-	    sb->s_dev = 0;
 	    goto error;
 	} 
 
@@ -110,14 +103,11 @@
 	       root->i_ino, root->i_dev);
 	sbi->sbi_root = root;
 	sb->s_root = d_alloc_root(root);
-	unlock_super(sb);
 	EXIT;  
         return sb;
 
  error:
-	unlock_super(sb);
 	EXIT;  
-	MOD_DEC_USE_COUNT;
 	if (sbi) {
 		sbi->sbi_vcomm = NULL;
 		sbi->sbi_root = NULL;
@@ -126,7 +116,6 @@
         if (root) {
                 iput(root);
         }
-        sb->s_dev = 0;
         return NULL;
 }
 
@@ -136,15 +125,12 @@
 
         ENTRY;
 
-
-        sb->s_dev = 0;
 	coda_cache_clear_all(sb);
 	sb_info = coda_sbp(sb);
 	coda_super_info.sbi_sb = NULL;
 	printk("Coda: Bye bye.\n");
 	memset(sb_info, 0, sizeof(* sb_info));
 
-        MOD_DEC_USE_COUNT;
 	EXIT;
 }
 
@@ -235,31 +221,25 @@
         return error;
 }
 
-static int coda_statfs(struct super_block *sb, struct statfs *buf, 
-		       int bufsiz)
+static int coda_statfs(struct super_block *sb, struct statfs *buf)
 {
-	struct statfs tmp;
 	int error;
 
-	memset(&tmp, 0, sizeof(struct statfs));
-
-	error = venus_statfs(sb, &tmp);
+	error = venus_statfs(sb, buf);
 
 	if (error) {
 		/* fake something like AFS does */
-		tmp.f_blocks = 9000000;
-		tmp.f_bfree  = 9000000;
-		tmp.f_bavail = 9000000;
-		tmp.f_files  = 9000000;
-		tmp.f_ffree  = 9000000;
+		buf->f_blocks = 9000000;
+		buf->f_bfree  = 9000000;
+		buf->f_bavail = 9000000;
+		buf->f_files  = 9000000;
+		buf->f_ffree  = 9000000;
 	}
 
 	/* and fill in the rest */
-	tmp.f_type = CODA_SUPER_MAGIC;
-	tmp.f_bsize = 1024;
-	tmp.f_namelen = CODA_MAXNAMLEN;
-
-	copy_to_user(buf, &tmp, bufsiz);
+	buf->f_type = CODA_SUPER_MAGIC;
+	buf->f_bsize = 1024;
+	buf->f_namelen = CODA_MAXNAMLEN;
 
 	return 0; 
 }
@@ -267,9 +247,7 @@
 
 /* init_coda: used by filesystems.c to register coda */
 
-struct file_system_type coda_fs_type = {
-   "coda", 0, coda_read_super, NULL
-};
+DECLARE_FSTYPE( coda_fs_type, "coda", coda_read_super, 0);
 
 int init_coda_fs(void)
 {

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