diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 0804b6abe20337..ad176441be558b 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 5be2e987b8435b..4de432ec903aec 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 9746e5293249b2..eafbb2b05eb8a2 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/frv/kernel/sys_frv.c b/arch/frv/kernel/sys_frv.c index 26b3df32b9a747..6fbe2665c5776d 100644 --- a/arch/frv/kernel/sys_frv.c +++ b/arch/frv/kernel/sys_frv.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index d865d041bea1dc..09cf78110358fa 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/i386/kernel/sys_i386.c b/arch/i386/kernel/sys_i386.c index e5dcb9379018b6..42147304de8855 100644 --- a/arch/i386/kernel/sys_i386.c +++ b/arch/i386/kernel/sys_i386.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index 6deb159d08e0cf..4eb2e408764f7b 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/arch/ia64/kernel/init_task.c b/arch/ia64/kernel/init_task.c index b69c397ed1bf1e..bc8efcad28b877 100644 --- a/arch/ia64/kernel/init_task.c +++ b/arch/ia64/kernel/init_task.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 99fc1226f7f804..3ee91869521579 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 90238a8c9e1499..36d78cf1a7bc14 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index be7362bc2c9a6e..04bbbd8d91abd1 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index b53f7edbc159df..541b5005957e86 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index f2042e6466a408..1263f00dc35d56 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/arch/parisc/kernel/init_task.c b/arch/parisc/kernel/init_task.c index 8384bf9cecd240..446f98d3fd7bd0 100644 --- a/arch/parisc/kernel/init_task.c +++ b/arch/parisc/kernel/init_task.c @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 355664812b8319..b80e02a4d81de3 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 04c7e1d36cea78..d7bc7bb42c94e1 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index fc6647d332cbf1..f85f402ceaefea 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/powerpc/lib/rheap.c b/arch/powerpc/lib/rheap.c index 2f24ea0d723afd..ada5b42dd23163 100644 --- a/arch/powerpc/lib/rheap.c +++ b/arch/powerpc/lib/rheap.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/arch/powerpc/oprofile/cell/spu_task_sync.c b/arch/powerpc/oprofile/cell/spu_task_sync.c index 133665754a75cc..4a890cb42b98e7 100644 --- a/arch/powerpc/oprofile/cell/spu_task_sync.c +++ b/arch/powerpc/oprofile/cell/spu_task_sync.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/s390/kernel/init_task.c b/arch/s390/kernel/init_task.c index d73a74013e73e0..d494161b05b401 100644 --- a/arch/s390/kernel/init_task.c +++ b/arch/s390/kernel/init_task.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 441975b796fb03..abb447a3e47244 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 03674fbe598f30..35edbef1d2228b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index 13e27bdb96e20e..1eaff84a1eb652 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/sparc/kernel/init_task.c b/arch/sparc/kernel/init_task.c index fc31de66b1c227..d9d4f96360c7bf 100644 --- a/arch/sparc/kernel/init_task.c +++ b/arch/sparc/kernel/init_task.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/arch/sparc64/kernel/init_task.c b/arch/sparc64/kernel/init_task.c index 329b38fa5c89e8..90007cf88bac65 100644 --- a/arch/sparc64/kernel/init_task.c +++ b/arch/sparc64/kernel/init_task.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index fd7899ba1d70bd..ca7cdfd55f7208 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index e41a08f04694ab..867666a0233971 100644 --- a/arch/um/drivers/mmapper_kern.c +++ b/arch/um/drivers/mmapper_kern.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "mem_user.h" diff --git a/arch/um/kernel/exec.c b/arch/um/kernel/exec.c index 356e50f5aaed4c..ce6828fd396f3d 100644 --- a/arch/um/kernel/exec.c +++ b/arch/um/kernel/exec.c @@ -6,6 +6,7 @@ #include "linux/slab.h" #include "linux/smp_lock.h" #include "linux/ptrace.h" +#include "linux/fs.h" #include "asm/ptrace.h" #include "asm/pgtable.h" #include "asm/tlbflush.h" diff --git a/arch/um/kernel/init_task.c b/arch/um/kernel/init_task.c index d4f1d1ab252ba0..cba516e6c99a27 100644 --- a/arch/um/kernel/init_task.c +++ b/arch/um/kernel/init_task.c @@ -4,6 +4,7 @@ */ #include "linux/mm.h" +#include "linux/fs.h" #include "linux/module.h" #include "linux/sched.h" #include "linux/init_task.h" diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index 237c4eab7cfd6c..7b3b67333ff31c 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c @@ -7,6 +7,7 @@ #include "linux/file.h" #include "linux/smp_lock.h" #include "linux/mm.h" +#include "linux/fs.h" #include "linux/utsname.h" #include "linux/msg.h" #include "linux/shm.h" diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index 4de3a54318f4d6..4a233ad6269cce 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index e7ac629d4c4654..2842f50cbe3fde 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86_64/kernel/sys_x86_64.c index d067d9a2ad27bd..4770b7a2052cf2 100644 --- a/arch/x86_64/kernel/sys_x86_64.c +++ b/arch/x86_64/kernel/sys_x86_64.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/x86_64/vdso/vma.c b/arch/x86_64/vdso/vma.c index d4cb83a6c0662f..ff9333e5fb083a 100644 --- a/arch/x86_64/vdso/vma.c +++ b/arch/x86_64/vdso/vma.c @@ -4,6 +4,7 @@ * Subject to the GPL, v.2 */ #include +#include #include #include #include diff --git a/drivers/char/agp/compat_ioctl.c b/drivers/char/agp/compat_ioctl.c index fcb4b1bf0d4e66..ecd4248861b9df 100644 --- a/drivers/char/agp/compat_ioctl.c +++ b/drivers/char/agp/compat_ioctl.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include "agp.h" diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index c7ed617aa7ff43..7791e98de51c81 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index 6e55cfb9c65a3f..e60a74c66e3dfa 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index c716ef0dd370af..c08a4152ee8fc2 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c index a698f1949d1040..cf25cdab02f9dd 100644 --- a/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/drivers/infiniband/hw/ipath/ipath_diag.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include "ipath_kernel.h" diff --git a/fs/dcookies.c b/fs/dcookies.c index c1208f53bd7459..792cbf55fa9592 100644 --- a/fs/dcookies.c +++ b/fs/dcookies.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 49b7053043adde..e6a71c82d20469 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -1,6 +1,8 @@ #ifndef _LINUX_HUGETLB_H #define _LINUX_HUGETLB_H +#include + #ifdef CONFIG_HUGETLB_PAGE #include diff --git a/include/linux/mm.h b/include/linux/mm.h index 3e9e8fec5a419b..655094dc9440fd 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -18,7 +17,9 @@ struct mempolicy; struct anon_vma; +struct file_ra_state; struct user_struct; +struct writeback_control; #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; @@ -861,38 +862,7 @@ struct shrinker { extern void register_shrinker(struct shrinker *); extern void unregister_shrinker(struct shrinker *); -/* - * Some shared mappigns will want the pages marked read-only - * to track write events. If so, we'll downgrade vm_page_prot - * to the private version (using protection_map[] without the - * VM_SHARED bit). - */ -static inline int vma_wants_writenotify(struct vm_area_struct *vma) -{ - unsigned int vm_flags = vma->vm_flags; - - /* If it was private or non-writable, the write bit is already clear */ - if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) - return 0; - - /* The backer wishes to know when pages are first written to? */ - if (vma->vm_ops && vma->vm_ops->page_mkwrite) - return 1; - - /* The open routine did something to the protections already? */ - if (pgprot_val(vma->vm_page_prot) != - pgprot_val(protection_map[vm_flags & - (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)])) - return 0; - - /* Specialty mapping? */ - if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE)) - return 0; - - /* Can the mapping track the dirty pages? */ - return vma->vm_file && vma->vm_file->f_mapping && - mapping_cap_account_dirty(vma->vm_file->f_mapping); -} +int vma_wants_writenotify(struct vm_area_struct *vma); extern pte_t *FASTCALL(get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl)); diff --git a/mm/mmap.c b/mm/mmap.c index 7afc7a7cec6f68..b6537211b9ccfd 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1029,6 +1029,40 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr, } EXPORT_SYMBOL(do_mmap_pgoff); +/* + * Some shared mappigns will want the pages marked read-only + * to track write events. If so, we'll downgrade vm_page_prot + * to the private version (using protection_map[] without the + * VM_SHARED bit). + */ +int vma_wants_writenotify(struct vm_area_struct *vma) +{ + unsigned int vm_flags = vma->vm_flags; + + /* If it was private or non-writable, the write bit is already clear */ + if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) + return 0; + + /* The backer wishes to know when pages are first written to? */ + if (vma->vm_ops && vma->vm_ops->page_mkwrite) + return 1; + + /* The open routine did something to the protections already? */ + if (pgprot_val(vma->vm_page_prot) != + pgprot_val(protection_map[vm_flags & + (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)])) + return 0; + + /* Specialty mapping? */ + if (vm_flags & (VM_PFNMAP|VM_INSERTPAGE)) + return 0; + + /* Can the mapping track the dirty pages? */ + return vma->vm_file && vma->vm_file->f_mapping && + mapping_cap_account_dirty(vma->vm_file->f_mapping); +} + + unsigned long mmap_region(struct file *file, unsigned long addr, unsigned long len, unsigned long flags, unsigned int vm_flags, unsigned long pgoff, diff --git a/mm/oom_kill.c b/mm/oom_kill.c index a7001410ab1596..10367654ae774f 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include diff --git a/mm/vmstat.c b/mm/vmstat.c index fadf791cd7e682..c64d169537bfcf 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include