Commit 710ec38b authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

mm: add dummy can_do_mlock() helper

On kernels without CONFIG_MMU, we get a link error for the siw driver:

drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get':
siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock'

This is probably not the only driver that needs the function and could
otherwise build correctly without CONFIG_MMU, so add a dummy variant that
always returns false.

Link: http://lkml.kernel.org/r/20190909204201.931830-1-arnd@arndb.de
Fixes: 2251334d ("rdma/siw: application buffer management")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Suggested-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Cc: Bernard Metzler <bmt@zurich.ibm.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6e73fd25
...@@ -1405,7 +1405,11 @@ extern void pagefault_out_of_memory(void); ...@@ -1405,7 +1405,11 @@ extern void pagefault_out_of_memory(void);
extern void show_free_areas(unsigned int flags, nodemask_t *nodemask); extern void show_free_areas(unsigned int flags, nodemask_t *nodemask);
#ifdef CONFIG_MMU
extern bool can_do_mlock(void); extern bool can_do_mlock(void);
#else
static inline bool can_do_mlock(void) { return false; }
#endif
extern int user_shm_lock(size_t, struct user_struct *); extern int user_shm_lock(size_t, struct user_struct *);
extern void user_shm_unlock(size_t, struct user_struct *); extern void user_shm_unlock(size_t, struct user_struct *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment