@@ -317,6 +317,19 @@ BIN_ATTR_MAP_CALLBACK( map_sg );
317317#include <linux/pfn_t.h>
318318#endif
319319
320+ /**
321+ RH 9.6 includes a kernel with interface changes.
322+ It is still named 5.14.0 (release 570.16.1) but includes backports, and needs the updates desribed below
323+ as for get_user_pages() 6.5.0 and MAX_PAGE_ORDER 6.8.0
324+ RH 9.5 still has the previous interface.
325+ **/
326+ #ifdef RHEL_RELEASE_CODE
327+ #if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION (9 , 6 )
328+ #define RHEL_FIX_KERNEL_202505
329+ #endif
330+ #endif
331+
332+
320333/**
321334 * Kernel 4.6 introduced six-argument get_user_pages()
322335 * https://github.com/torvalds/linux/commit/c12d2da56d0e07d230968ee2305aaa86b93a6832
@@ -328,7 +341,7 @@ BIN_ATTR_MAP_CALLBACK( map_sg );
328341 * Kernel 6.5 removes unused vmas parameter from get_user_pages()
329342 * https://github.com/torvalds/linux/commit/54d020692b342f7bd02d7f5795fb5c401caecfcc
330343 **/
331- #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 5 , 0 )
344+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 5 , 0 ) || defined( RHEL_FIX_KERNEL_202505 )
332345#define PDA_FOURARG_GUP
333346#elif LINUX_VERSION_CODE >= KERNEL_VERSION (4 , 9 , 0 )
334347#define PDA_FIVEARG_GUP
@@ -343,7 +356,7 @@ BIN_ATTR_MAP_CALLBACK( map_sg );
343356 * Kernel 6.8 renames MAX_ORDER to MAX_PAGE_ORDER
344357 * https://github.com/torvalds/linux/commit/5e0a760b44417f7cadd79de2204d6247109558a0
345358 **/
346- #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 8 , 0 )
359+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 8 , 0 ) || defined( RHEL_FIX_KERNEL_202505 )
347360#define PDA_MAX_PAGE_ORDER_RENAMED
348361#elif LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 4 , 0 )
349362#define PDA_MAX_PAGE_ORDER_INCLUSIVE
0 commit comments