public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* aa-040-touch_buffer
@ 2002-03-20  3:56 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2002-03-20  3:56 UTC (permalink / raw)
  To: lkml



Move the touch_buffer() from bread into getblk().

Fair enough.  The touch_buffer() call tells the VM "please don't evict
this page, I'm about to use it".  Doing it in getblk() will provide
better coverage than doing it in bread().  I would actually prefer to
do it in get_hash_table(), but that's a minor detail.



=====================================

--- 2.4.19-pre3/fs/buffer.c~aa-040-touch_buffer	Tue Mar 19 19:48:54 2002
+++ 2.4.19-pre3-akpm/fs/buffer.c	Tue Mar 19 19:49:15 2002
@@ -1032,8 +1032,10 @@ struct buffer_head * getblk(kdev_t dev, 
 		struct buffer_head * bh;
 
 		bh = get_hash_table(dev, block, size);
-		if (bh)
+		if (bh) {
+			touch_buffer(bh);
 			return bh;
+		}
 
 		if (!grow_buffers(dev, block, size))
 			free_more_memory();
@@ -1196,7 +1198,6 @@ struct buffer_head * bread(kdev_t dev, i
 	struct buffer_head * bh;
 
 	bh = getblk(dev, block, size);
-	touch_buffer(bh);
 	if (buffer_uptodate(bh))
 		return bh;
 	ll_rw_block(READ, 1, &bh);

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

only message in thread, other threads:[~2002-03-20  3:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-20  3:56 aa-040-touch_buffer Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox