Free pages after brw_page() in buffer.c

Wong Tsang (kernel@kingdom-lan.net)
Mon, 29 Apr 2002 16:06:54 +0800


Dear all,

I dun know whether it is appropriate to ask question here. But
I have seeked for help in many places and got no replies. :(
Pls forgive me if I have done something wrong.

I have written a driver to do some I/O using brw_page(). I first
use __get_free_pages() to get some free pages and then pass them to brw_page()
to issue the I/O requests. Afterwards, I find that I have difficulties to free the
allocated pages by simply using free_pages().Because the page->count
becomes 2 (increment once in __get_free_pages() and increment once
in brw_page() ) and page->buffers is not NULL.

So what is the appropriate way to decrement the page count made
by brw_page and free those buffers in page->buffers? or more specifically,
how can I free the pages which have been used in brw_page()?

After reading buffer.c, I guess try_to_free_buffers() may work but
I fear it is not the appropriate and may leave some hidden problems afterwards.

Thx in advance!

Wong Tsang

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