Skip to content

Commit 22fcea6

Browse files
kvaneeshtorvalds
authored andcommitted
mm: move MAP_SYNC to asm-generic/mman-common.h
This enables support for synchronous DAX fault on powerpc The generic changes are added as part of b6fb293 ("mm: Define MAP_SYNC and VM_SYNC flags") Without this, mmap returns EOPNOTSUPP for MAP_SYNC with MAP_SHARED_VALIDATE Instead of adding MAP_SYNC with same value to arch/powerpc/include/uapi/asm/mman.h, I am moving the #define to asm-generic/mman-common.h. Two architectures using mman-common.h directly are sparc and powerpc. We should be able to consloidate more #defines to mman-common.h. That can be done as a separate patch. Link: http://lkml.kernel.org/r/20190528091120.13322-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> Reviewed-by: Jan Kara <jack@suse.cz> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9f960da commit 22fcea6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎include/uapi/asm-generic/mman-common.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#define MAP_FIXED 0x10 /* Interpret addr exactly */
2121
#define MAP_ANONYMOUS 0x20 /* don't use a file */
2222

23-
/* 0x0100 - 0x80000 flags are defined in asm-generic/mman.h */
23+
/* 0x0100 - 0x40000 flags are defined in asm-generic/mman.h */
24+
#define MAP_SYNC 0x080000 /* perform synchronous page faults for the mapping */
2425
#define MAP_FIXED_NOREPLACE 0x100000 /* MAP_FIXED which doesn't unmap underlying mapping */
2526

2627
#define MAP_UNINITIALIZED 0x4000000 /* For anonymous mmap, memory could be

‎include/uapi/asm-generic/mman.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#define MAP_NONBLOCK 0x10000 /* do not block on IO */
1414
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
1515
#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
16-
#define MAP_SYNC 0x80000 /* perform synchronous page faults for the mapping */
1716

1817
/* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */
1918

0 commit comments

Comments
 (0)