Device driver port from 2.2 to 2.4

From: Richard A Nelson (
Date: Tue Feb 06 2001 - 19:16:39 EST

I'm porting a device driver from 2.2 to 2.4 and have run across one
spot that I'm just not sure how to handle... 'Twould help if I new
either(or both) the driver or kernel internals better ;-}

It overrides the vm_operations_struct nopage function to share a trace
buffer between user and driver.

in the nopage function, there is this:
offset = address - vma->vm_start + vma->vm_offset;
newPtr = ( (void *)devExt->Trace + offset );
atomic_inc(&mem_map[ MAP_NR(newPtr) ].count ); // increment usage count

now, it looks like this might map to:
atomic_inc(virt_to_page(newPtr).count );

But I'd like to be sure I'm not missing something... I already feel
like something is amiss in that I can't find any corresponding
decrements !!

Rick Nelson
Life'll kill ya                         -- Warren Zevon
Then you'll be dead                     -- Life'll kill ya

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:25 EST