lkml.org 
[lkml]   [1997]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectI need help on vm_operations_struct
Date
From

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])];
atomic_inc(&map->count);

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.


\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.031 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site