Small fix in buffer cache

Jan Kara (jack@suse.cz)
Sun, 5 Dec 1999 15:54:07 +0100


--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii

Hello.

I've found a small bug in create_buffers(). When buffer is created it is not attached
to any list. The patch simply does refile_buffer() on every created buffer so it is placed
on proper LRU list.

Honza.

--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="buffer.c.diff"

--- linux/fs/buffer.c Tue Nov 23 22:58:40 1999
+++ linux/fs/buffer.c Fri Nov 26 23:04:40 1999
@@ -1207,6 +1207,7 @@

bh->b_list = BUF_CLEAN;
bh->b_end_io = end_buffer_io_bad;
+ refile_buffer(bh);
}
return head;
/*
@@ -1214,12 +1215,15 @@
*/
no_grow:
if (head) {
+ spin_lock(&lru_list_lock);
spin_lock(&unused_list_lock);
do {
bh = head;
head = head->b_this_page;
+ __remove_from_lru_list(bh, bh->b_list);
__put_unused_buffer_head(bh);
} while (head);
+ spin_unlock(&lru_list_lock);
spin_unlock(&unused_list_lock);

/* Wake up any waiters ... */

--OXfL5xGRrasGEqWY--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/