[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: making 0.0.6b a module



Peter, you write:
> I have ext3 0.0.6b + 2.2.19 and cannot get ext3 to compile as a module.
> If I try to modularize it, or turn in off completely, the kernel build
> fails.  Is there an easy fix for this, or is there something that I am
> missing?

The following patch allows you to make ext3 a module.  It does not let
you make jfs a module, however.  The 2.4 ext3 code (under development)
lets you also make jfs (now called jbd) a module as well.

This patch is taken from a larger patch, so I'm not 100% sure it is all
there.  However, it is at least 99% of what you need (it may still be
missing a few EXPORT_SYMBOL calls in journal.c).

Cheers, Andreas
==========================================================================
diff -ru -x .[a-z]* linux/fs/Config.in /usr/src/linux/fs/Config.in
--- linux/fs/Config.in	Fri Jul 14 01:20:53 2000
+++ /usr/src/linux/fs/Config.in	Thu Jul  6 14:13:47 2000
@@ -57,6 +57,10 @@
 tristate 'ROM filesystem support' CONFIG_ROMFS_FS
 tristate 'Second extended fs support' CONFIG_EXT2_FS
 tristate 'Second extended fs development code' CONFIG_EXT3_FS
+# CONFIG_JFS should be its own option, but for now we make it depend on ext3
+if [ "$CONFIG_EXT3_FS" != "n" ]; then
+  define_bool CONFIG_JFS y
+fi
 
 tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
 tristate 'UFS filesystem support' CONFIG_UFS_FS
diff -ru -x .[a-z]* linux/fs/Makefile /usr/src/linux/fs/Makefile
--- linux/fs/Makefile	Fri Jul 14 01:20:54 2000
+++ /usr/src/linux/fs/Makefile	Thu Jul  6 14:13:47 2000
@@ -51,13 +51,17 @@
 endif
 
 ifeq ($(CONFIG_EXT3_FS),y)
-SUB_DIRS += ext3 jfs
+SUB_DIRS += ext3
 else
   ifeq ($(CONFIG_EXT3_FS),m)
-  MOD_SUB_DIRS += ext3 jfs
+  MOD_SUB_DIRS += ext3
   endif
 endif
 
+ifeq ($(CONFIG_JFS),y)
+SUB_DIRS += jfs
+endif
+
 ifeq ($(CONFIG_FAT_FS),y)
 SUB_DIRS += fat
 else
diff -ru linux-2.2.16-3.ext3/fs/buffer.c.~1~ linux-2.2.16-3.ext3/fs/buffer.c
--- linux-2.2.16-3.ext3/fs/buffer.c.~1~	Wed Jul  5 17:45:26 2000
+++ linux-2.2.16-3.ext3/fs/buffer.c	Thu Jul  6 15:53:39 2000
@@ -867,8 +867,10 @@
 	   can now unlink it from its original transaction: there's no
 	   need to keep the transaction pinned in the log once the datat
 	   is safely on disk. */
+#ifdef CONFIG_JFS
 	if (dispose == BUF_CLEAN && buf->b_cp_transaction)
 		journal_remove_checkpoint(buf);
+#endif
 }
 
 /*
diff -ru -x .[a-z]* linux/fs/jfs/journal.c /usr/src/linux/fs/jfs/journal.c
--- linux/fs/jfs/journal.c	Fri Jul 14 01:20:54 2000
+++ /usr/src/linux/fs/jfs/journal.c	Thu Jul 13 00:55:03 2000
@@ -49,6 +49,11 @@
 EXPORT_SYMBOL(journal_enable_debug);
 #endif

+/* JFS debugging only: */
+void jfs_prelock_buffer_check(struct buffer_head *bh);
+void jfs_preclean_buffer_check(struct buffer_head *bh);
+EXPORT_SYMBOL(jfs_prelock_buffer_check);
+EXPORT_SYMBOL(jfs_preclean_buffer_check);
 
 EXPORT_SYMBOL(journal_start);
 EXPORT_SYMBOL(journal_restart);
@@ -86,6 +86,12 @@
 EXPORT_SYMBOL(journal_ack_err);
 EXPORT_SYMBOL(journal_clear_err);
 
+EXPORT_SYMBOL(log_wait_commit);
+EXPORT_SYMBOL(log_start_commit);
+EXPORT_SYMBOL(journal_lock_updates);
+EXPORT_SYMBOL(journal_unlock_updates);
+EXPORT_SYMBOL(journal_wipe);
+
 static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
 
 /*
diff -ru -x .[a-z]* linux/fs/jfs/transaction.c /usr/src/linux/fs/jfs/transaction.c
--- linux/fs/jfs/transaction.c	Fri Jul 14 01:20:54 2000
+++ /usr/src/linux/fs/jfs/transaction.c	Thu Jul  6 14:13:41 2000
@@ -35,25 +35,6 @@
 static inline void
 blist_del_buffer(struct buffer_head **, struct buffer_head *);
 
-
-/*
- * Journal locking.
- *
- * We need to lock the journal during transaction state changes so that
- * nobody ever tries to take a handle on the running transaction while
- * we are in the middle of moving it to the commit phase.  
- *
- * Note that the locking is completely interrupt unsafe.  We never touch
- * journal structures from interrupts.
- */
-
-void __wait_on_journal (journal_t * journal)
-{
-	while (journal->j_locked)
-		sleep_on (&journal->j_wait_lock);
-}
-
-
 /*
  * get_transaction: obtain a new transaction_t object.
  *
diff -ru -x .[a-z]* linux/include/linux/fs.h /usr/src/linux/include/linux/fs.h
--- linux/include/linux/fs.h	Fri Jul 14 01:22:38 2000
+++ /usr/src/linux/include/linux/fs.h	Wed Jul 12 18:07:35 2000
@@ -852,8 +852,10 @@
 
 extern inline void mark_buffer_clean(struct buffer_head * bh)
 {
+#if defined(CONFIG_JFS)
 	extern void jfs_preclean_buffer_check(struct buffer_head *);
 	jfs_preclean_buffer_check(bh); /* @@@ Expensive debugging */
+#endif
 	if (test_and_clear_bit(BH_Dirty, &bh->b_state)) {
 		if (bh->b_list == BUF_DIRTY)
 			refile_buffer(bh);
diff -ru -x .[a-z]* linux/include/linux/jfs.h /usr/src/linux/include/linux/jfs.h
--- linux/include/linux/jfs.h	Fri Jul 14 01:22:38 2000
+++ /usr/src/linux/include/linux/jfs.h	Wed Jul 12 18:07:35 2000
@@ -421,8 +422,23 @@
 extern int		set_transaction_state (transaction_t *, int);
 
 
-/* Transaction locking */
-extern void		__wait_on_journal (journal_t *);
+/*
+ * Transaction locking
+ *
+ * We need to lock the journal during transaction state changes so that
+ * nobody ever tries to take a handle on the running transaction while
+ * we are in the middle of moving it to the commit phase.
+ *
+ * Note that the locking is completely interrupt unsafe.  We never touch
+ * journal structures from interrupts.
+ */
+
+static inline void __wait_on_journal (journal_t * journal)
+{
+	while (journal->j_locked)
+		sleep_on (&journal->j_wait_lock);
+}
+
 
 /* Journal locking.  In 2.2, we assume that the kernel lock is already
  * held. */
diff -ru linux-2.2.16-3.ext3/include/linux/locks.h.~1~ linux-2.2.16-3.ext3/include/linux/locks.h
--- linux-2.2.16-3.ext3/include/linux/locks.h.~1~	Wed Jul  5 17:57:00 2000
+++ linux-2.2.16-3.ext3/include/linux/locks.h	Thu Jul  6 15:53:39 2000
@@ -8,8 +8,6 @@
 #include <linux/pagemap.h>
 #endif
 
-extern void jfs_prelock_buffer_check(struct buffer_head *);
-
 /*
  * Buffer cache locking - note that interrupts may only unlock, not
  * lock buffers.
@@ -22,8 +22,11 @@
 
 extern inline void lock_buffer(struct buffer_head * bh)
 {
+#if defined(CONFIG_JFS)
+	extern void jfs_prelock_buffer_check(struct buffer_head *);
 	/* @@@ Debugging for the journaling code */
 	jfs_prelock_buffer_check(bh);
+#endif
 	while (test_and_set_bit(BH_Lock, &bh->b_state))
 		__wait_on_buffer(bh);
 }
--- linux-2.2.18-pre21/kernel/ksyms.c.orig	Fri Nov 17 17:03:10 2000
+++ linux-2.2.18-pre21/kernel/ksyms.c	Sat Nov 18 09:58:24 2000
@@ -70,9 +70,6 @@
 };
 #endif
 
-extern void jfs_preclean_buffer_check(struct buffer_head *);
-extern void jfs_prelock_buffer_check(struct buffer_head *);
-
 
 #ifdef CONFIG_KMOD
 EXPORT_SYMBOL(request_module);
@@ -256,10 +253,6 @@
 EXPORT_SYMBOL(max_segments);
 EXPORT_SYMBOL(max_readahead);
 EXPORT_SYMBOL(show_buffers);
-
-/* JFS debugging only: */
-EXPORT_SYMBOL(jfs_prelock_buffer_check);
-EXPORT_SYMBOL(jfs_preclean_buffer_check);
 
 /* tty routines */
 EXPORT_SYMBOL(tty_hangup);
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]