I need help on vm_operations_struct

Stephen Williams (steve@icarus.icarus.com)
Thu, 25 Sep 1997 09:00:20 +0800

I'm trying to figure out, and document, what it takes to manage a
vm_area_struct in loadable modules (including device drivers.) I'm
sorta getting it but I am not at all clear on what I should do with
a page I plan to return in the nopage function.

If I have this stretch of code (page is an index into a table of
page pointers):

xsp->pages[page] = get_free_page(GFP_KERNEL);
map = &mem_map[MAP_NR(xsp->pages[page])];

the page lasts for a few accesses, but run my little test program that
mmaps the soft device that creates this segment and I eventually get a
kernel oops.

What would these lines do:

add_page_to_inode_queue(inode, map);
add_page_to_hash_queue(map, inode, page*PAGE_SIZE);

and should I add them?

I hope to collect all the results of my research in this subject and make
a Documentation file.