Re: bforget and protected buffers

Andrea Arcangeli (andrea@e-mind.com)
Tue, 27 Apr 1999 18:39:01 +0200 (CEST)


On Tue, 27 Apr 1999, Chuck Lever wrote:

>see the buffer_busy macro defined later in fs/buffer.c for use by
>try_to_free_buffers(). this will prevent protected ramdisk buffers from
>being reclaimed, although they can still appear on the free list if
>someone decides to add bforget() calls to the ramdisk logic... presumably
>if ramdisk decides to bforget a buffer, it doesn't care about it's
>contents.
>
>now, if you add this to bforget():
>
> buf->b_state = 0;
>
>that defeats the buffer_busy check in try_to_free_buffers(), so maybe the
>check should be made explicitly in bforget() if you add this line.

Even if you don't add the buf->b_state = 0 by hand in bforgot, you'll get
b_state set to 0 by getblk a bit after.

Andrea Arcangeli

-
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/