The original looks correct to me. If you remap the `complete' VMA,
(addr - vma->vm_start) will be zero and the offset will remain
unchanged. If however, you remap only the trailing part of a file
VMA, the new offset will have to be adjusted by a positive value. Am
I missing sth ?
> The fact that this hasn't shown up before amazes me. The only
> explanation I can think of this is both a linux specifc syscall
> (so doesn't get used much) and only really useful for anonymous
> pages (where the offset into the mapping doesn't matter anyway.
Yes, but note that mremap() is used quite extensively for anonymous
pages, because realloc() uses it for large reallocations (I've
verified that e.g. GNU Emacs does these quite often).
Regards,
Wolfram.
-- `Surf the sea, not double-u three...' wmglo@dent.med.uni-muenchen.de- 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/