Additional affs filesystem module patch.

Wingerde van GR (gertjan@cs.vu.nl)
Tue, 30 Apr 1996 20:07:53 +0200 (MET DST)


Hi,

Here is a patch to the affs filesystem. This patch takes care of module
usage counts for loading and unloading of the module.

Gertjan.

--- Begin Patch
diff -u --recursive --new-file linux-1.3.97/fs/affs/inode.c linux/fs/affs/inode.c
--- linux-1.3.97/fs/affs/inode.c Tue Apr 30 17:19:16 1996
+++ linux/fs/affs/inode.c Tue Apr 30 17:26:18 1996
@@ -1,6 +1,8 @@
/*
* linux/fs/affs/inode.c
*
+ * (C) 1996 Gertjan van Wingerde - Modified for module usage counts.
+ *
* (C) 1994 Geert Uytterhoeven - Modified for MultiUserFileSystem
*
* (C) 1993 Ray Burr - Modified for Amiga FFS filesystem.
@@ -10,6 +12,8 @@
* (C) 1991 Linus Torvalds - minix filesystem
*/

+#include <linux/module.h>
+
#include <linux/stat.h>
#include <linux/sched.h>
#include <linux/affs_fs.h>
@@ -43,6 +47,7 @@
#endif
sb->s_dev = 0;
unlock_super(sb);
+ MOD_DEC_USE_COUNT;
return;
}

@@ -138,11 +143,13 @@
void *root_data;
struct affs_options *optp;

+ MOD_INC_USE_COUNT;
optp = &s->u.affs_sb.s_options;

if (!parse_options((char *) data, optp)) {
s->s_dev = 0;
printk ("AFFS: bad mount options\n");
+ MOD_DEC_USE_COUNT;
return NULL;
}

@@ -189,6 +196,7 @@
s->s_dev = 0;
unlock_super(s);
printk ("AFFS: unable to read superblock\n");
+ MOD_DEC_USE_COUNT;
return NULL;
}

@@ -230,6 +238,7 @@
if (!(s->s_mounted)) {
s->s_dev = 0;
printk("AFFS: get root inode failed\n");
+ MOD_DEC_USE_COUNT;
return NULL;
}

@@ -239,6 +248,7 @@
brelse (bh);
s->s_dev = 0;
unlock_super(s);
+ MOD_DEC_USE_COUNT;
return NULL;
}

diff -u --recursive --new-file linux-1.3.97/fs/ufs/ufs_super.c linux/fs/ufs/ufs_super.c
--- linux-1.3.97/fs/ufs/ufs_super.c Tue Apr 30 17:19:17 1996
+++ linux/fs/ufs/ufs_super.c Tue Apr 30 17:23:38 1996
@@ -13,6 +13,9 @@
/*
* Kernel module support added on 96/04/26 by
* Stefan Reinauer <stepan@home.culture.mipt.ru>
+ *
+ * Module usage counts added on 96/04/29 by
+ * Gertjan van Wingerde <gertjan@cs.vu.nl>
*/

#include <linux/module.h>
--- 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/