[14/17] Allow bit_waitqueue to wait on a bit in a vmalloc area
If bit waitqueue is passed a virtual address then it must use vmalloc_to_page instead of virt_to_page to get to the page struct. Signed-off-by: Christoph Lameter [EMAIL PROTECTED] --- kernel/wait.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6/kernel/wait.c === --- linux-2.6.orig/kernel/wait.c2007-09-20 19:03:42.0 -0700 +++ linux-2.6/kernel/wait.c 2007-09-20 19:07:42.0 -0700 @@ -245,7 +245,7 @@ EXPORT_SYMBOL(wake_up_bit); fastcall wait_queue_head_t *bit_waitqueue(void *word, int bit) { const int shift = BITS_PER_LONG == 32 ? 5 : 6; - const struct zone *zone = page_zone(virt_to_page(word)); + const struct zone *zone = page_zone(addr_to_page(word)); unsigned long val = (unsigned long)word shift | bit; return zone-wait_table[hash_long(val, zone-wait_table_bits)]; -- - To unsubscribe from this list: send the line unsubscribe linux-fsdevel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [14/17] Allow bit_waitqueue to wait on a bit in a vmalloc area
On Wed, 19 Sep 2007, Gabriel C wrote: Christoph Lameter wrote: + if (is_vmalloc_addr(word)) + page = vmalloc_to_page(word) ^^ Missing ' ; ' Argh. Late beautification attempts are backfiring - To unsubscribe from this list: send the line unsubscribe linux-fsdevel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[14/17] Allow bit_waitqueue to wait on a bit in a vmalloc area
If bit waitqueue is passed a virtual address then it must use vmalloc_to_page instead of virt_to_page to get to the page struct. Signed-off-by: Christoph Lameter [EMAIL PROTECTED] --- kernel/wait.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) Index: linux-2.6/kernel/wait.c === --- linux-2.6.orig/kernel/wait.c2007-09-18 19:19:27.0 -0700 +++ linux-2.6/kernel/wait.c 2007-09-18 20:10:39.0 -0700 @@ -9,6 +9,7 @@ #include linux/mm.h #include linux/wait.h #include linux/hash.h +#include linux/vmalloc.h void init_waitqueue_head(wait_queue_head_t *q) { @@ -245,9 +246,16 @@ EXPORT_SYMBOL(wake_up_bit); fastcall wait_queue_head_t *bit_waitqueue(void *word, int bit) { const int shift = BITS_PER_LONG == 32 ? 5 : 6; - const struct zone *zone = page_zone(virt_to_page(word)); unsigned long val = (unsigned long)word shift | bit; + struct page *page; + struct zone *zone; + if (is_vmalloc_addr(word)) + page = vmalloc_to_page(word) + else + page = virt_to_page(word); + + zone = page_zone(page); return zone-wait_table[hash_long(val, zone-wait_table_bits)]; } EXPORT_SYMBOL(bit_waitqueue); -- - To unsubscribe from this list: send the line unsubscribe linux-fsdevel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [14/17] Allow bit_waitqueue to wait on a bit in a vmalloc area
Christoph Lameter wrote: + if (is_vmalloc_addr(word)) + page = vmalloc_to_page(word) ^^ Missing ' ; ' + else + page = virt_to_page(word); + + zone = page_zone(page); return zone-wait_table[hash_long(val, zone-wait_table_bits)]; } EXPORT_SYMBOL(bit_waitqueue); Regards, Gabriel - To unsubscribe from this list: send the line unsubscribe linux-fsdevel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html