forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
292 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_SIZE], [ | ||
ZFS_LINUX_TEST_SRC([page_size], [ | ||
#include <linux/mm.h> | ||
],[ | ||
unsigned long s; | ||
s = page_size(NULL); | ||
]) | ||
]) | ||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_SIZE], [ | ||
AC_MSG_CHECKING([whether page_size() is available]) | ||
ZFS_LINUX_TEST_RESULT([page_size], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_MM_PAGE_SIZE, 1, [page_size() is available]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) | ||
|
||
|
||
AC_DEFUN([ZFS_AC_KERNEL_SRC_MM_PAGE_MAPPING], [ | ||
ZFS_LINUX_TEST_SRC([page_mapping], [ | ||
#include <linux/pagemap.h> | ||
],[ | ||
struct page *p = NULL; | ||
struct address_space *m = page_mapping(NULL); | ||
]) | ||
]) | ||
AC_DEFUN([ZFS_AC_KERNEL_MM_PAGE_MAPPING], [ | ||
AC_MSG_CHECKING([whether page_mapping() is available]) | ||
ZFS_LINUX_TEST_RESULT([page_mapping], [ | ||
AC_MSG_RESULT(yes) | ||
AC_DEFINE(HAVE_MM_PAGE_MAPPING, 1, [page_mapping() is available]) | ||
],[ | ||
AC_MSG_RESULT(no) | ||
]) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,16 +21,23 @@ | |
|
||
/* | ||
* Copyright (c) 2023, 2024, Klara Inc. | ||
* Copyright (c) 2024, Rob Norris <[email protected]> | ||
*/ | ||
|
||
#ifndef _ZFS_MM_COMPAT_H | ||
#define _ZFS_MM_COMPAT_H | ||
|
||
#include <linux/mm.h> | ||
#include <linux/pagemap.h> | ||
|
||
/* 5.4 introduced page_size(). Older kernels can use a trivial macro instead */ | ||
#ifndef HAVE_MM_PAGE_SIZE | ||
#define page_size(p) ((unsigned long)(PAGE_SIZE << compound_order(p))) | ||
#endif | ||
|
||
/* 6.11 removed page_mapping(). A simple wrapper around folio_mapping() works */ | ||
#ifndef HAVE_MM_PAGE_MAPPING | ||
#define page_mapping(p) folio_mapping(page_folio(p)) | ||
#endif | ||
|
||
#endif /* _ZFS_MM_COMPAT_H */ |
Oops, something went wrong.