include/asm-alpha/mman.h | 1 + include/asm-generic/mman.h | 1 + include/asm-mips/mman.h | 1 + include/asm-parisc/mman.h | 1 + include/asm-sparc/mman.h | 2 -- include/asm-sparc64/mman.h | 2 -- include/asm-xtensa/mman.h | 1 + mm/madvise.c | 2 ++ 8 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/asm-alpha/mman.h b/include/asm-alpha/mman.h index 90d7c35..d47b5a3 100644 --- a/include/asm-alpha/mman.h +++ b/include/asm-alpha/mman.h @@ -42,6 +42,7 @@ #define MADV_SEQUENTIAL 2 /* expect seq #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_SPACEAVAIL 5 /* ensure resources are available */ #define MADV_DONTNEED 6 /* don't need these pages */ +#define MADV_FREE 7 /* don't need the pages or the data */ /* common/generic parameters */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/include/asm-generic/mman.h b/include/asm-generic/mman.h index 5e3dde2..34a9ff1 100644 --- a/include/asm-generic/mman.h +++ b/include/asm-generic/mman.h @@ -29,6 +29,7 @@ #define MADV_RANDOM 1 /* expect random #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ +#define MADV_FREE 5 /* don't need the pages or the data */ /* common parameters: try to keep these consistent across architectures */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/include/asm-mips/mman.h b/include/asm-mips/mman.h index e4d6f1f..68067ff 100644 --- a/include/asm-mips/mman.h +++ b/include/asm-mips/mman.h @@ -65,6 +65,7 @@ #define MADV_RANDOM 1 /* expect random #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ +#define MADV_FREE 5 /* don't need the pages or the data */ /* common parameters: try to keep these consistent across architectures */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/include/asm-parisc/mman.h b/include/asm-parisc/mman.h index defe752..347fbca 100644 --- a/include/asm-parisc/mman.h +++ b/include/asm-parisc/mman.h @@ -38,6 +38,7 @@ #define MADV_DONTNEED 4 #define MADV_SPACEAVAIL 5 /* insure that resources are reserved */ #define MADV_VPS_PURGE 6 /* Purge pages from VM page cache */ #define MADV_VPS_INHERIT 7 /* Inherit parents page size */ +#define MADV_FREE 8 /* don't need the pages or the data */ /* common/generic parameters */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/include/asm-sparc/mman.h b/include/asm-sparc/mman.h index b7dc40b..5ec7106 100644 --- a/include/asm-sparc/mman.h +++ b/include/asm-sparc/mman.h @@ -33,8 +33,6 @@ #define MC_UNLOCK 3 /* Unlock pag #define MC_LOCKAS 5 /* Lock an entire address space of the calling process */ #define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */ -#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ - #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #define arch_mmap_check sparc_mmap_check diff --git a/include/asm-sparc64/mman.h b/include/asm-sparc64/mman.h index 8cc1860..03b05d5 100644 --- a/include/asm-sparc64/mman.h +++ b/include/asm-sparc64/mman.h @@ -33,8 +33,6 @@ #define MC_UNLOCK 3 /* Unlock pag #define MC_LOCKAS 5 /* Lock an entire address space of the calling process */ #define MC_UNLOCKAS 6 /* Unlock entire address space of calling process */ -#define MADV_FREE 0x5 /* (Solaris) contents can be freed */ - #ifdef __KERNEL__ #ifndef __ASSEMBLY__ #define arch_mmap_check sparc64_mmap_check diff --git a/include/asm-xtensa/mman.h b/include/asm-xtensa/mman.h index 9b92620..1345703 100644 --- a/include/asm-xtensa/mman.h +++ b/include/asm-xtensa/mman.h @@ -72,6 +72,7 @@ #define MADV_RANDOM 1 /* expect random #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* don't need these pages */ +#define MADV_FREE 5 /* don't need the pages or the data */ /* common parameters: try to keep these consistent across architectures */ #define MADV_REMOVE 9 /* remove these pages & resources */ diff --git a/mm/madvise.c b/mm/madvise.c index e75096b..ad067f2 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -22,6 +22,7 @@ static int madvise_need_mmap_write(int b case MADV_REMOVE: case MADV_WILLNEED: case MADV_DONTNEED: + case MADV_FREE: return 0; default: /* be safe, default to 1. list exceptions explicitly */ @@ -234,6 +235,7 @@ madvise_vma(struct vm_area_struct *vma, break; case MADV_DONTNEED: + case MADV_FREE: error = madvise_dontneed(vma, prev, start, end); break;