mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Craig Christophel <merlin@transgeek.com>
To: linux-kernel@vger.kernel.org
Subject: buffer.c lock_kernel() -- removal
Date: Thu, 10 Jan 2002 09:31:24 -0500	[thread overview]
Message-ID: <20020110102805.536F8C738A@smtp.transgeek.com> (raw)

Included is a patch against buffer.c that removes the 
lock_kernel()/unlock_kernel() pairs in the few functions that they exist.  

This is for 2.5>2.5.2-pre10.

I beleive that I checked all of the member functions for locking schematics 
but if you can prove me wrong -- go for it.   The only issue I can see would 
be if DQUOT_SYNC() didn't do a lock_kernel() inside itself; but it does so 
that is taken care of (utilizing BKL only if dquot is compiled in).  Well 
after all of that, here is the patch for review.  


Craig. 

Index: linux/fs/buffer.c
diff -u linux/fs/buffer.c:1.3 linux/fs/buffer.c:1.4
--- linux/fs/buffer.c:1.3	Wed Jan  9 02:18:26 2002
+++ linux/fs/buffer.c	Thu Jan 10 09:14:10 2002
@@ -322,14 +322,12 @@
 	kdev_t dev = sb->s_dev;
 	sync_buffers(dev, 0);
 
-	lock_kernel();
 	sync_inodes_sb(sb);
 	DQUOT_SYNC(sb);
 	lock_super(sb);
 	if (sb->s_dirt && sb->s_op && sb->s_op->write_super)
 		sb->s_op->write_super(sb);
 	unlock_super(sb);
-	unlock_kernel();
 
 	return sync_buffers(dev, 1);
 }
@@ -345,7 +343,6 @@
 {
 	sync_buffers(dev, 0);
 
-	lock_kernel();
 	sync_inodes(dev);
 	if (!kdev_none(dev)) {
 		struct super_block *sb = get_super(dev);
@@ -356,7 +353,6 @@
 	} else
 			DQUOT_SYNC(NULL);
 	sync_supers(dev);
-	unlock_kernel();
 
 	return sync_buffers(dev, 1);
 }
@@ -387,7 +383,6 @@
 	kdev_t dev;
 	int ret;
 
-	lock_kernel();
 	/* sync the inode to buffers */
 	write_inode_now(inode, 0);
 
@@ -401,7 +396,6 @@
 	/* .. finally sync the buffers to disk */
 	dev = inode->i_dev;
 	ret = sync_buffers(dev, 1);
-	unlock_kernel();
 	return ret;
 }
 
@@ -2559,10 +2553,8 @@
 
 static int sync_old_buffers(void)
 {
-	lock_kernel();
 	sync_unlocked_inodes();
 	sync_supers(NODEV);
-	unlock_kernel();
 
 	for (;;) {
 		struct buffer_head *bh;

             reply	other threads:[~2002-01-10 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-10 14:31 Craig Christophel [this message]
2002-01-13  3:45 ` Alexander Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020110102805.536F8C738A@smtp.transgeek.com \
    --to=merlin@transgeek.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®