Skip to contentSkip to conversation

write_super is not for syncing (take 3)

PATCH In review Chris Mason 4 participants 5 messages Aug 5, 2002 – Aug 9, 2002 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 write_super is not for syncing (take 3)

Hello everyone,

This patch has been floating around for some time, and I've been building other reiserfs speedups on top of it. It does two things:

1) allows the FS write_super function to leave the super dirty without looping endlessly in sync_supers(). This is based on code sent to me by Hugh Dickins, and it helps all the filesystems avoid looping in sync_supers() under load.

2) adds a commit_super() call to struct super_operations(). This allows the journaled filesystems to differentiate between calls from sync() and calls from kupdated.

Below are just the hunks that change VFS code, against 2.4.19-final. The reiserfs bits will come once this gets accepted. Please review and throw something blunt at me if you don't want this in the kernel.

-chris

fs/buffer.c +3 -1
diff -urN --exclude *.orig --exclude *.rej parent/fs/buffer.c comp/fs/buffer.c
@@ -328,6 +328,8 @@
 	lock_super(sb);
 	if (sb->s_dirt && sb->s_op && sb->s_op->write_super)
 		sb->s_op->write_super(sb);
+	if (sb->s_op && sb->s_op->commit_super)
+		sb->s_op->commit_super(sb);
 	unlock_super(sb);
 	unlock_kernel();
 
@@ -347,7 +349,7 @@
 	lock_kernel();
 	sync_inodes(dev);
 	DQUOT_SYNC(dev);
-	sync_supers(dev);
+	commit_supers(dev);
 	unlock_kernel();
 
 	return sync_buffers(dev, 1);
fs/super.c +37 -9

80 lines not on this page · raw message

include/linux/fs.h +2 -0
diff -urN --exclude *.orig --exclude *.rej parent/include/linux/fs.h comp/include/linux/fs.h
@@ -920,6 +920,7 @@
 	struct dentry * (*fh_to_dentry)(struct super_block *sb, __u32 *fh, int len, int fhtype, int parent);
 	int (*dentry_to_fh)(struct dentry *, __u32 *fh, int *lenp, int need_parent);
 	int (*show_options)(struct seq_file *, struct vfsmount *);
+	void (*commit_super) (struct super_block *);
 };
 
 /* Inode state bits.. */
@@ -1236,6 +1237,7 @@
 extern int filemap_fdatasync(struct address_space *);
 extern int filemap_fdatawait(struct address_space *);
 extern void sync_supers(kdev_t);
+extern void commit_supers(kdev_t);
 extern int bmap(struct inode *, int);
 extern int notify_change(struct dentry *, struct iattr *);
 extern int permission(struct inode *, int);
#1 lore raw
Quoted 3 lines · Chris Mason

Below are just the hunks that change VFS code, against 2.4.19-final. The reiserfs bits will come once this gets accepted. Please review and throw something blunt at me if you don't want this in the kernel.

Could you please get that tested in 2.5 or -ac first?

#2 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Chris Mason

Below are just the hunks that change VFS code, against 2.4.19-final. The reiserfs bits will come once this gets accepted. Please review and throw something blunt at me if you don't want this in the kernel.

Could you please get that tested in 2.5 or -ac first?

It is being tested in the suse kernel now. Alan, if you want it, I'll rediff against 2.4.19-ac.

-chris

#3 lore raw
Quoted 10 lines · Chris Mason
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Chris Mason

Below are just the hunks that change VFS code, against 2.4.19-final. The reiserfs bits will come once this gets accepted. Please review and throw something blunt at me if you don't want this in the kernel.

Could you please get that tested in 2.5 or -ac first?

It is being tested in the suse kernel now. Alan, if you want it, I'll rediff against 2.4.19-ac.

I'm chasing IDE stuff, now is the wrong moment for file system stuff

#4 lore raw
In reply to Chris Mason
Quoted 3 lines · Chris Mason

2) adds a commit_super() call to struct super_operations(). This allows the journaled filesystems to differentiate between calls from sync() and calls from kupdated.

Thankyou.

Signature · 1 line
Daniel