summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-19 17:22:03 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-19 17:22:03 -0700
commitd614d3153f8acc606f0c0644831b7c0d359a6b2c (patch)
tree4eca55e721735885f8d0ec8bcc38944a7e6a1410 /include/linux
parente8b338d65b58d871751253d3357cda7143053040 (diff)
[PATCH] fix madvise(MADV_DONTNEED) for nonlinear vmas
From: Hugh Dickins <hugh@veritas.com> Jamie points out that madvise(MADV_DONTNEED) should unmap pages from a nonlinear area in such a way that the nonlinear offsets are preserved if the pages do turn out to be needed later after all, instead of reverting them to linearity: needs to pass down a zap_details block. (But this still leaves mincore unaware of nonlinear vmas: bigger job.)
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d664c4ffbcc7..103f14358d1f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -439,7 +439,16 @@ struct file *shmem_file_setup(char * name, loff_t size, unsigned long flags);
void shmem_lock(struct file * file, int lock);
int shmem_zero_setup(struct vm_area_struct *);
-struct zap_details;
+/*
+ * Parameter block passed down to zap_pte_range in exceptional cases.
+ */
+struct zap_details {
+ struct vm_area_struct *nonlinear_vma; /* Check page->index if set */
+ struct address_space *check_mapping; /* Check page->mapping if set */
+ pgoff_t first_index; /* Lowest page->index to unmap */
+ pgoff_t last_index; /* Highest page->index to unmap */
+};
+
void zap_page_range(struct vm_area_struct *vma, unsigned long address,
unsigned long size, struct zap_details *);
int unmap_vmas(struct mmu_gather **tlbp, struct mm_struct *mm,