Additional patch for ufs module.

Wingerde van GR (gertjan@cs.vu.nl)
Mon, 29 Apr 1996 10:00:39 +0200 (MET DST)


Hi,

The following patch should be applied to let the ufs filesystem module
work correctly.

It takes care of the module usage counts for loading and unloading the
module.

Gertjan

-- begin patch
diff -u --recursive --new-file linux-1.3.96/fs/ufs/ufs_super.c linux/fs/ufs/ufs_super.c
--- linux-1.3.96/fs/ufs/ufs_super.c Fri Apr 26 11:16:09 1996
+++ linux/fs/ufs/ufs_super.c Mon Apr 29 09:53:14 1996
@@ -104,6 +104,7 @@
* and s_type when we return.
*/

+ MOD_INC_USE_COUNT;
lock_super (sb);

/* XXX - make everything read only for testing */
@@ -119,7 +120,8 @@
}
printk ("ufs_read_super: unable to read superblock\n");

- return 0;
+ MOD_DEC_USE_COUNT;
+ return(NULL);
}
/* XXX - redo this so we can free it later... */
usb = (struct ufs_superblock *)__get_free_page(GFP_KERNEL);
@@ -147,6 +149,7 @@
printk ("ufs_read_super: bad magic number 0x%8.8x on dev %d/%d\n",
usb->fs_magic, MAJOR(sb->s_dev),
MINOR(sb->s_dev));
+ MOD_DEC_USE_COUNT;
return(NULL);
}

@@ -238,7 +241,8 @@

ufs_read_super_lose:
/* XXX - clean up */
- return(0);
+ MOD_DEC_USE_COUNT;
+ return(NULL);
}

void ufs_put_super (struct super_block * sb)
-- end patch

-- 

Gertjan van Wingerde home address: Student Computer Science Vrije Universiteit J.H. Dunantstraat 44 Amsterdam 1561 BD Krommenie The Netherlands

e-mail: gertjan@cs.vu.nl URL: http://www.cs.vu.nl/~gertjan/