buffer cache in 2.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,
now i try to update a block device driver from kernel 2.4 to 2.6.
the new kernel version is 2.6.16, the old one is 2.4.23.
as long as i know, one of the big change from 2.4 to 2.6 is
buffer cache (struct buffer_head related stuff), right?
i need some help.

how the driver works is like this:
gzip compressed image is in the ram disk.
the driver i made in 2.4 expands the gzip image on the buffer cache, then read/write it on it.

in 2.4 system's driver, it calls getblk() to retreive ram disk's
buffer_head* in make_request function, and it was ok.
in 2.6 also do the same. it calls __getblk() in make_request, but this time, it fails saying "Debug: sleeping function called from invalid context at fs/buffer.c:1464"

alright, question:
how can i get the buffer_head* of the other device like ram disks
when it is on make_request's stack?
or instead of using buffer_cache*, can i do the same thing? and how?
(i imagine that uses struct bio, but i dont know how to use bio
which is not in the parameter of the make_request function.)

any advice or comment will be greatly appreciated.

following is the message from dmesg

Debug: sleeping function called from invalid context at fs/buffer.c:1464
in_atomic():1, irqs_disabled():0
[<c01519e9>] __getblk+0x38/0x23b
[<e6a11466>] moto_request_noqueue+0xfc/0x1ce [bcl_blk]
[<e6a11491>] moto_request_noqueue+0x127/0x1ce [bcl_blk]
[<c01ae867>] generic_make_request+0x176/0x186
[<c0139b08>] mempool_alloc+0x37/0xce
[<c013b59a>] __alloc_pages+0x66/0x26c
[<c01af534>] submit_bio+0xa1/0xa6
[<c0154209>] bio_alloc_bioset+0x9b/0xf3
[<c01513de>] submit_bh+0xe1/0xff
[<c015363e>] block_read_full_page+0x260/0x271
[<c0156e23>] blkdev_get_block+0x0/0x45
[<c02d2791>] _write_unlock_irq+0x5/0x7
[<c0137734>] add_to_page_cache+0x61/0x68
[<c013ca0a>] __do_page_cache_readahead+0x173/0x1d3
[<c02d32a2>] do_page_fault+0x0/0x51d
[<c01034ff>] error_code+0x4f/0x54
[<c013cab0>] blockable_page_cache_readahead+0x46/0x9a
[<c013cc7f>] page_cache_readahead+0xf1/0x144
[<c0137b4f>] do_generic_mapping_read+0x11e/0x400
[<c013846d>] __generic_file_aio_read+0x148/0x18f
[<c0137351>] file_read_actor+0x0/0xe0
[<c013950b>] generic_file_read+0x0/0xac
[<c01395a3>] generic_file_read+0x98/0xac
[<c012953f>] autoremove_wake_function+0x0/0x2d
[<c01505bc>] vfs_read+0x9f/0x13e
[<c0150923>] sys_read+0x3c/0x63
[<c01029eb>] sysenter_past_esp+0x54/0x75


thanks.

DD



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux