All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] keep lru_list_lock around osync_buffers_list
@ 2002-12-03  4:47 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2002-12-03  4:47 UTC (permalink / raw)
  To: marcelo; +Cc: linux-kernel

There's exactly one caller of osync_buffers_list (and it's static
to buffer.c), so we can keep holding lru_list_lock over the call
to it instead of releasing and reacquiring it.


--- 1.77/fs/buffer.c	Sun Aug 25 21:28:55 2002
+++ edited/fs/buffer.c	Mon Dec  2 21:48:11 2002
@@ -869,8 +869,8 @@
 		spin_lock(&lru_list_lock);
 	}
 	
-	spin_unlock(&lru_list_lock);
 	err2 = osync_buffers_list(list);
+	spin_unlock(&lru_list_lock);
 
 	if (err)
 		return err;
@@ -887,6 +887,8 @@
  * you dirty the buffers, and then use osync_buffers_list to wait for
  * completion.  Any other dirty buffers which are not yet queued for
  * write will not be flushed to disk by the osync.
+ *
+ * Expects lru_list_lock to be held at entry.
  */
 static int osync_buffers_list(struct list_head *list)
 {
@@ -894,8 +896,6 @@
 	struct list_head *p;
 	int err = 0;
 
-	spin_lock(&lru_list_lock);
-	
  repeat:
 	list_for_each_prev(p, list) {
 		bh = BH_ENTRY(p);
@@ -911,7 +911,6 @@
 		}
 	}
 
-	spin_unlock(&lru_list_lock);
 	return err;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-02 21:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-03  4:47 [PATCH] keep lru_list_lock around osync_buffers_list Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.