patch-2.3.51 linux/fs/devfs/base.c

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

diff -u --recursive --new-file v2.3.50/linux/fs/devfs/base.c linux/fs/devfs/base.c
@@ -2305,27 +2305,21 @@
     if (devfs_debug & DEBUG_S_PUT)
 	printk ("%s: put_super(): devfs ptr: %p\n", DEVFS_NAME, fs_info);
 #endif
-    sb->s_dev = 0;
 #ifdef CONFIG_DEVFS_TUNNEL
     dput (fs_info->table[0]->covered);
 #endif
     delete_fs (fs_info);
-    MOD_DEC_USE_COUNT;
 }   /*  End Function devfs_put_super  */
 
-static int devfs_statfs (struct super_block *sb, struct statfs *buf,int bufsiz)
+static int devfs_statfs (struct super_block *sb, struct statfs *buf)
 {
-    struct statfs tmp;
-
-    tmp.f_type = DEVFS_SUPER_MAGIC;
-    tmp.f_bsize = PAGE_SIZE / sizeof (long);
-    tmp.f_blocks = 0;
-    tmp.f_bfree = 0;
-    tmp.f_bavail = 0;
-    tmp.f_files = 0;
-    tmp.f_ffree = 0;
-    tmp.f_namelen = NAME_MAX;
-    return copy_to_user (buf, &tmp, bufsiz) ? -EFAULT : 0;
+    buf->f_type = DEVFS_SUPER_MAGIC;
+    buf->f_bsize = PAGE_SIZE / sizeof (long);
+    buf->f_bfree = 0;
+    buf->f_bavail = 0;
+    buf->f_ffree = 0;
+    buf->f_namelen = NAME_MAX;
+    return 0;
 }   /*  End Function devfs_statfs  */
 
 static struct super_operations devfs_sops =
@@ -3152,7 +3146,6 @@
     {
 	if (strcmp (aopt, "explicit") == 0) fs_info->require_explicit = TRUE;
     }
-    lock_super (sb);
     sb->u.generic_sbp = fs_info;
     sb->s_blocksize = 1024;
     sb->s_blocksize_bits = 10;
@@ -3173,32 +3166,22 @@
 #ifdef CONFIG_DEVFS_TUNNEL
     di->covered = dget (sb->s_root->d_covered);
 #endif
-    unlock_super (sb);
 #ifdef CONFIG_DEVFS_DEBUG
     if (devfs_debug & DEBUG_DISABLED)
 	printk ("%s: read super, made devfs ptr: %p\n",
 		DEVFS_NAME, sb->u.generic_sbp);
 #endif
-    MOD_INC_USE_COUNT;
     return sb;
 
 out_no_root:
     printk ("devfs_read_super: get root inode failed\n");
     delete_fs (fs_info);
     if (root_inode) iput (root_inode);
-    sb->s_dev = 0;
-    unlock_super (sb);
     return NULL;
 }   /*  End Function devfs_read_super  */
 
 
-static struct file_system_type devfs_fs_type =
-{
-    DEVFS_NAME, 
-    0,
-    devfs_read_super, 
-    NULL,
-};
+static DECLARE_FSTYPE(devfs_fs_type, DEVFS_NAME, devfs_read_super, 0);
 
 
 /*  File operations for devfsd follow  */

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