mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: remove HAVE_GET_USER_PAGES_*
get_user_pages_unlocked() had stabilised by 4.9. Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
committed by
Brian Behlendorf
parent
696d7a71a0
commit
5df65ca9c1
@@ -48,49 +48,4 @@
|
||||
#define zfs_access_ok(type, addr, size) access_ok(addr, size)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* read returning FOLL_WRITE is due to the fact that we are stating
|
||||
* that the kernel will have write access to the user pages. So, when
|
||||
* a Direct I/O read request is issued, the kernel must write to the user
|
||||
* pages.
|
||||
*
|
||||
* get_user_pages_unlocked was not available to 4.0, so we also check
|
||||
* for get_user_pages on older kernels.
|
||||
*/
|
||||
/* 4.9 API change - for and read flag is passed as gup flags */
|
||||
#if defined(HAVE_GET_USER_PAGES_UNLOCKED_GUP_FLAGS)
|
||||
#define zfs_get_user_pages(addr, numpages, read, pages) \
|
||||
get_user_pages_unlocked(addr, numpages, pages, read ? FOLL_WRITE : 0)
|
||||
|
||||
/* 4.8 API change - no longer takes struct task_struct as arguement */
|
||||
#elif defined(HAVE_GET_USER_PAGES_UNLOCKED_WRITE_FLAG)
|
||||
#define zfs_get_user_pages(addr, numpages, read, pages) \
|
||||
get_user_pages_unlocked(addr, numpages, read, 0, pages)
|
||||
|
||||
/* 4.0-4.3, 4.5-4.7 API */
|
||||
#elif defined(HAVE_GET_USER_PAGES_UNLOCKED_TASK_STRUCT)
|
||||
#define zfs_get_user_pages(addr, numpages, read, pages) \
|
||||
get_user_pages_unlocked(current, current->mm, addr, numpages, read, 0, \
|
||||
pages)
|
||||
|
||||
/* 4.4 API */
|
||||
#elif defined(HAVE_GET_USER_PAGES_UNLOCKED_TASK_STRUCT_GUP_FLAGS)
|
||||
#define zfs_get_user_pages(addr, numpages, read, pages) \
|
||||
get_user_pages_unlocked(current, current->mm, addr, numpages, pages, \
|
||||
read ? FOLL_WRITE : 0)
|
||||
|
||||
/* Using get_user_pages if kernel is < 4.0 */
|
||||
#elif defined(HAVE_GET_USER_PAGES_TASK_STRUCT)
|
||||
#define zfs_get_user_pages(addr, numpages, read, pages) \
|
||||
get_user_pages(current, current->mm, addr, numpages, read, 0, pages, \
|
||||
NULL)
|
||||
#else
|
||||
/*
|
||||
* This case is unreachable. We must be able to use either
|
||||
* get_user_pages_unlocked() or get_user_pages() to map user pages into
|
||||
* the kernel.
|
||||
*/
|
||||
#error "Unknown Direct I/O interface"
|
||||
#endif
|
||||
|
||||
#endif /* _ZFS_KMAP_H */
|
||||
|
||||
Reference in New Issue
Block a user