The patch titled nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy has been removed from the -mm tree. Its filename is nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy.patch This patch was dropped because it was folded into nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem.patch ------------------------------------------------------ Subject: nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy From: Andrew Morton <akpm@xxxxxxxx> ifdef reduction. Cc: David Howells <dhowells@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/char/mem.c | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff -puN fs/char_dev.c~nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy fs/char_dev.c diff -puN drivers/char/mem.c~nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy drivers/char/mem.c --- a/drivers/char/mem.c~nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy +++ a/drivers/char/mem.c @@ -249,6 +249,19 @@ static unsigned long get_unmapped_area_m return (unsigned long) -EINVAL; return pgoff; } + +/* can't do an in-place private mapping if there's no MMU */ +static inline int private_mapping_ok(struct vm_area_struct *vma) +{ + return vma->vm_flags & VM_MAYSHARE; +} +#else +#define get_unmapped_area_mem NULL + +static inline int private_mapping_ok(struct vm_area_struct *vma) +{ + return 1; +} #endif static int mmap_mem(struct file * file, struct vm_area_struct * vma) @@ -258,11 +271,8 @@ static int mmap_mem(struct file * file, if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size)) return -EINVAL; -#ifndef CONFIG_MMU - /* can't do an in-place private mapping if there's no MMU */ - if (!(vma->vm_flags & VM_MAYSHARE)) + if (!private_mapping_ok(vma)) return -ENOSYS; -#endif vma->vm_page_prot = phys_mem_access_prot(file, vma->vm_pgoff, size, @@ -801,9 +811,7 @@ static const struct file_operations mem_ .write = write_mem, .mmap = mmap_mem, .open = open_mem, -#ifndef CONFIG_MMU .get_unmapped_area = get_unmapped_area_mem, -#endif }; static const struct file_operations kmem_fops = { @@ -812,9 +820,7 @@ static const struct file_operations kmem .write = write_kmem, .mmap = mmap_kmem, .open = open_kmem, -#ifndef CONFIG_MMU .get_unmapped_area = get_unmapped_area_mem, -#endif }; static const struct file_operations null_fops = { _ Patches currently in -mm which might be from akpm@xxxxxxxx are origin.patch revert-x86_64-mm-i386-remove-lock-section.patch fix-x86_64-mm-spinlock-cleanup.patch have-x86-use-add_active_range-and-free_area_init_nodes.patch vm-add-per-zone-writeout-counter.patch slab-fix-kmalloc_node-applying-memory-policies-if-nodeid-==-numa_node_id.patch gfp_thisnode-for-the-slab-allocator-v2.patch do_no_pfn.patch nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem.patch nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy.patch nommu-move-the-fallback-arch_vma_name-to-a-sensible-place-fix.patch inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-fix-fix.patch x86-microcode-microcode-driver-cleanup-tidy.patch x86-microcode-add-sysfs-and-hotplug-support-fix.patch eisa-bus-modalias-attributes-support-1-fix-git-kbuild-fix.patch add-address_space_operationsbatch_write-fix.patch alloc_fdtable-cleanup.patch sysctl-allow-proc-sys-without-sys_sysctl-fix.patch add-probe_kernel_address.patch x86-use-probe_kernel_address-in-handle_bug.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html