Re: remap_page_range / zeromap_page_range

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Wed, 3 Nov 1999 15:05:59 +0100


Richard Dynes wrote:
> These functions seem to be symmetric, and so I would assume that if
> remap_page_range is called to create the mapping, that when the file
> is closed zeromap_page_range should also be called.

It should call zap_page_range not zeromap_page_range.
zap_page_range removes mappings; zeromap_page_range creates COW zero
maps (cf. MAP_ANONYMOUS, /dev/zero).

However, this is handled for you in munmap(). As long as you have any
mapping of the device, there will be a reference to its inode. The
final call to the inode's release() will happen after the last reference
is removed, at which point all the mappings have been removed anyway.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/