Skip to contentSkip to conversation

Possible patch for reiserfs-3.6.22 against 2.4.0-test12 w/ new_writepage

PATCH Carlos E. Gorges 1 participant 1 message Dec 19, 2000 VFS

lore
Share & tools
lore
#0 lore raw

Testers are welcome :-)

fs/buffer.c +4 -0
diff -Nur --exclude=Documentation linux-vanila/fs/buffer.c linux-reiser/fs/buffer.c
@@ -827,6 +827,10 @@
 	return;
 }
 
+void set_buffer_async_io(struct buffer_head *bh) {
+	bh->b_end_io = end_buffer_io_async ;
+}
+
 /*
  * Synchronise all the inode's dirty buffers to the disk.
  *
fs/reiserfs/inode.c +66 -20

180 lines not on this page · raw message

fs/reiserfs/journal.c +12 -8
diff -Nur --exclude=Documentation linux-vanila/fs/reiserfs/journal.c linux-reiser/fs/reiserfs/journal.c
@@ -1762,7 +1762,7 @@
   ct->p_s_sb = p_s_sb ;
   ct->jindex = jindex ;
   ct->task_done = NULL ;
-  ct->task.next = NULL ;
+  INIT_LIST_HEAD(&ct->task.list);
   ct->task.sync = 0 ;
   ct->task.routine = (void *)(void *)reiserfs_journal_commit_task_func ; 
   ct->self = ct ;
@@ -1802,6 +1802,7 @@
   exit_files(current);
   exit_mm(current);
 
+  printk("reiserfs_journal_commit_thread\n");
   spin_lock_irq(&current->sigmask_lock);
   sigfillset(&current->blocked);
   recalc_sigpending(current);
@@ -1812,17 +1813,23 @@
   sprintf(current->comm, "kreiserfsd") ;
   lock_kernel() ;
   while(1) {
-
-    while(reiserfs_commit_thread_tq) {
-      run_task_queue(&reiserfs_commit_thread_tq) ;
+    while(!list_empty(&reiserfs_commit_thread_tq)) {
+      printk("while\n");
+      my_run_task_queue(&reiserfs_commit_thread_tq) ;
     }
 
     /* if there aren't any more filesystems left, break */
     if (reiserfs_mounted_fs_count <= 0) {
-      run_task_queue(&reiserfs_commit_thread_tq) ;
+      printk("reiserfs_mounted_fs_count >=0\n");
+      my_run_task_queue(&reiserfs_commit_thread_tq) ;
       break ;
+    } else {
+    	printk("reiserfs_mounted_fs_count < 0 :-)\n");
     }
+        
+    printk("wake_up\n");
     wake_up(&reiserfs_commit_thread_done) ;
+    printk("interruptible_sleep_on_timeout\n");
     interruptible_sleep_on_timeout(&reiserfs_commit_thread_wait, 5) ;
   }
   unlock_kernel() ;
@@ -3202,6 +3209,3 @@
   wake_up(&(SB_JOURNAL(p_s_sb)->j_join_wait)) ;
   return 0 ;
 }
-
-
-
fs/reiserfs/namei.c +1 -1
diff -Nur --exclude=Documentation linux-vanila/fs/reiserfs/namei.c linux-reiser/fs/reiserfs/namei.c
@@ -1136,7 +1136,7 @@
 		reiserfs_restore_prepared_buffer (old_inode->i_sb, dot_dot_de.de_bh);
 #if 0
 	    // FIXME: do we need this? shouldn't we simply continue?
-	    run_task_queue(&tq_disk);
+	    my_run_task_queue(&tq_disk);
 	    current->policy |= SCHED_YIELD;
 	    /*current->counter = 0;*/
 	    schedule();
fs/reiserfs/stree.c +1 -1
diff -Nur --exclude=Documentation linux-vanila/fs/reiserfs/stree.c linux-reiser/fs/reiserfs/stree.c
@@ -1295,7 +1295,7 @@
 #endif
 
 #ifdef __KERNEL__
-		run_task_queue(&tq_disk);
+		my_run_task_queue(&tq_disk);
 		current->policy |= SCHED_YIELD;
 		schedule();
 #endif
include/linux/fs.h +3 -0
diff -Nur --exclude=Documentation linux-vanila/include/linux/fs.h linux-reiser/include/linux/fs.h
@@ -991,6 +991,9 @@
 extern int try_to_free_buffers(struct page *, int);
 extern void refile_buffer(struct buffer_head * buf);
 
+/* reiserfs_writepage needs this */
+extern void set_buffer_async_io(struct buffer_head *bh) ;
+
 #define BUF_CLEAN	0
 #define BUF_LOCKED	1	/* Buffers scheduled for write */
 #define BUF_DIRTY	2	/* Dirty buffers, not yet scheduled for write */
include/linux/reiserfs_fs.h +26 -0
diff -Nur --exclude=Documentation linux-vanila/include/linux/reiserfs_fs.h linux-reiser/include/linux/reiserfs_fs.h
@@ -2076,4 +2076,30 @@
  			         
 #endif /* _LINUX_REISER_FS_H */
 
+extern inline void my_run_task_queue(task_queue *list)
+{
+		unsigned long flags;
+		struct list_head *next;
+
+		spin_lock_irqsave(&tqueue_lock, flags);
+		next = list->next;
+		if (next != list) {
+			void *arg;
+			void (*f) (void *);
+			struct tq_struct *p;
+
+			list_del(next);
+			p = list_entry(next, struct tq_struct, list);
+			arg = p->data;
+			f = p->routine;
+			p->sync = 0;
+			spin_unlock_irqrestore(&tqueue_lock, flags);
+
+			if (f)
+				f(arg);
+			return;
+		}
+		spin_unlock_irqrestore(&tqueue_lock, flags);
+}
+
 
kernel/ksyms.c +1 -0
diff -Nur --exclude=Documentation linux-vanila/kernel/ksyms.c linux-reiser/kernel/ksyms.c
@@ -159,6 +159,7 @@
 EXPORT_SYMBOL(d_lookup);
 EXPORT_SYMBOL(__d_path);
 EXPORT_SYMBOL(mark_buffer_dirty);
+EXPORT_SYMBOL(set_buffer_async_io); /* for reiserfs_writepage */
 EXPORT_SYMBOL(__mark_buffer_dirty);
 EXPORT_SYMBOL(__mark_inode_dirty);
 EXPORT_SYMBOL(get_empty_filp);
Signature · 11 lines
	 _________________________
	 Carlos E Gorges          
	 ([email protected])
	 Tech inform�tica LTDA
	 Brazil                   
	 _________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/