patch: kernel changes from reiserfs

From: Chris Mason (mason@suse.com)
Date: Fri Apr 28 2000 - 13:57:23 EST


Hello again,

Here are the 3 new changes outside the reiserfs source included in the
lastest reiserfs patch. I thought it would be easier for people to make
comments if I posted them outside the reiserfs patch...

The fs/buffer.c change locks the super before calling write_super.
super.c does this already, and since I need to unlock the super while
closing a transaction, I need everyone to lock the super before
writing.

The fs/inode.c and fs.h changes allow the FS to provide a dirty_inode
call. I'm using this to log the inodes instead of allowing them to hit
the dirty list, which saves me from deadlocks when try_to_free_pages
forces a flush of the dirty inode list.

--- diff/linux-2.3.99-pre6/fs/buffer.c Fri Apr 28 12:09:15 2000
+++ linux/fs/buffer.c Thu Apr 27 20:52:49 2000
@@ -336,10 +336,11 @@
 
         /* sync the superblock to buffers */
         sb = inode->i_sb;
- wait_on_super(sb);
+ lock_super(sb) ;
         if (sb->s_op && sb->s_op->write_super)
                 sb->s_op->write_super(sb);
 
+ unlock_super(sb) ;
         /* .. finally sync the buffers to disk */
         dev = inode->i_dev;
         ret = sync_buffers(dev, 1);
--- diff/linux-2.3.99-pre6/fs/inode.c Fri Apr 28 12:09:16 2000
+++ linux/fs/inode.c Thu Apr 27 20:52:50 2000
@@ -126,6 +126,11 @@
 {
         struct super_block * sb = inode->i_sb;
 
+ if (inode->i_sb && inode->i_sb->s_op && inode->i_sb->s_op->dirty_inode){
+ inode->i_sb->s_op->dirty_inode(inode) ;
+ return ;
+ }
+
         if (sb) {
                 spin_lock(&inode_lock);
                 if (!(inode->i_state & I_DIRTY)) {
--- linux/include/linux/fs.h.1 Fri Apr 28 14:46:25 2000
+++ linux/include/linux/fs.h Fri Apr 28 14:46:28 2000
@@ -744,6 +744,7 @@
 struct super_operations {
         void (*read_inode) (struct inode *);
         void (*write_inode) (struct inode *);
+ void (*dirty_inode) (struct inode *);
         void (*put_inode) (struct inode *);
         void (*delete_inode) (struct inode *);
         void (*put_super) (struct super_block *);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 30 2000 - 21:00:15 EST