public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kirill Korotaev <dev@sw.ru>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, mason@suse.com
Subject: [PATCH] Rearrange of inode_lock in writeback_inodes()
Date: Tue, 14 Sep 2004 14:01:03 +0400	[thread overview]
Message-ID: <4146C15F.1040605@sw.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

This patch reaaranges inode_lock taking in writeback_inodes().
It narrows down use of inode_lock and removes unneccassary nesting of 
sb_lock and inode_lock.
Instead of holding inode_lock for all the time I moved it around
sync_sb_inodes() as it is in all other places.

Signed-Off-By: Kirill Korotaev <dev@sw.ru>

Kirill

[-- Attachment #2: diff-sb-lock --]
[-- Type: text/plain, Size: 754 bytes --]

--- ./fs/fs-writeback.c.sblock	2004-09-14 11:07:36.000000000 +0400
+++ ./fs/fs-writeback.c	2004-09-14 11:13:23.931085680 +0400
@@ -392,7 +392,6 @@ writeback_inodes(struct writeback_contro
 {
 	struct super_block *sb;
 
-	spin_lock(&inode_lock);
 	spin_lock(&sb_lock);
 restart:
 	sb = sb_entry(super_blocks.prev);
@@ -407,8 +406,11 @@ restart:
 			 * be unmounted by the time it is released.
 			 */
 			if (down_read_trylock(&sb->s_umount)) {
-				if (sb->s_root)
+				if (sb->s_root) {
+					spin_lock(&inode_lock);
 					sync_sb_inodes(sb, wbc);
+					spin_unlock(&inode_lock);
+				}
 				up_read(&sb->s_umount);
 			}
 			spin_lock(&sb_lock);
@@ -425,7 +427,6 @@ restart:
 			break;
 	}
 	spin_unlock(&sb_lock);
-	spin_unlock(&inode_lock);
 }
 
 /*

                 reply	other threads:[~2004-09-14  9:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4146C15F.1040605@sw.ru \
    --to=dev@sw.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@suse.com \
    --cc=torvalds@osdl.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