3 files changed, 241 insertions(+)
--- linux-2.4.18-18.8.0-l15/fs/ext3/super.c~ext3-delete_thread-2.4.18 Tue Jun 3 17:26:21 2003
-+++ linux-2.4.18-18.8.0-l15-adilger/fs/ext3/super.c Tue Jun 17 17:13:04 2003
++++ linux-2.4.18-18.8.0-l15-adilger/fs/ext3/super.c Wed Jun 18 11:59:14 2003
@@ -396,6 +396,218 @@ static void dump_orphan_list(struct supe
}
}
+
+ /* main loop */
+ for (;;) {
-+ wait_event_interruptible(&sbi->s_delete_thread_queue,
++ wait_event_interruptible(sbi->s_delete_thread_queue,
+ !list_empty(&sbi->s_delete_list) ||
+ !test_opt(sb, ASYNCDEL));
+ ext3_debug("%s woken up: %lu inodes, %lu blocks\n",
+ if (sbi->s_delete_list.next == 0) /* thread never started */
+ return;
+
-+ clear_opt(sbi->s_mount_flags, ASYNCDEL);
++ clear_opt(sbi->s_mount_opt, ASYNCDEL);
+ wake_up(&sbi->s_delete_thread_queue);
+ wait_event(sbi->s_delete_waiter_queue, list_empty(&sbi->s_delete_list));
+}
put_super: ext3_put_super, /* BKL held */
write_super: ext3_write_super, /* BKL held */
write_super_lockfs: ext3_write_super_lockfs, /* BKL not held. Take it */
-@@ -511,6 +728,17 @@ static int parse_options (char * options
+@@ -511,6 +728,14 @@ static int parse_options (char * options
this_char = strtok (NULL, ",")) {
if ((value = strchr (this_char, '=')) != NULL)
*value++ = 0;
+ if (!strcmp(this_char, "asyncdel"))
+ set_opt(*mount_options, ASYNCDEL);
+ else if (!strcmp(this_char, "noasyncdel"))
-+ if (is_remount)
-+ ext3_stop_delete_thread(sbi);
-+ else
-+ clear_opt(*mount_options, ASYNCDEL);
++ clear_opt(*mount_options, ASYNCDEL);
+ else
+#endif
+
if (!strcmp (this_char, "bsddf"))
clear_opt (*mount_options, MINIX_DF);
else if (!strcmp (this_char, "nouid32")) {
-@@ -1206,6 +1434,7 @@ struct super_block * ext3_read_super (st
+@@ -1206,6 +1431,7 @@ struct super_block * ext3_read_super (st
}
ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
/*
* akpm: core read_super() calls in here with the superblock locked.
* That deadlocks, because orphan cleanup needs to lock the superblock
+@@ -1648,6 +1874,9 @@ int ext3_remount (struct super_block * s
+ if (!parse_options(data, &tmp, sbi, &tmp, 1))
+ return -EINVAL;
+
++ if (!test_opt(sb, ASYNCDEL) || (*flags & MS_RDONLY))
++ ext3_stop_delete_thread(sbi);
++
+ if (sbi->s_mount_opt & EXT3_MOUNT_ABORT)
+ ext3_abort(sb, __FUNCTION__, "Abort forced by user");
+
--- linux-2.4.18-18.8.0-l15/include/linux/ext3_fs.h~ext3-delete_thread-2.4.18 Tue Jun 3 17:26:20 2003
+++ linux-2.4.18-18.8.0-l15-adilger/include/linux/ext3_fs.h Tue Jun 17 12:36:56 2003
@@ -190,6 +190,7 @@ struct ext3_group_desc