Skip to content

Commit

Permalink
Fixup 'Avoid BUG in migrate_folio_extra'
Browse files Browse the repository at this point in the history
Fix typos:
zpd_invalidate_page -> zpl_invalidate_page
.invalidate_page -> .invalidatepage
  • Loading branch information
tstabrawa committed Aug 17, 2024
1 parent 778fe79 commit 59c2ab1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions config/kernel-vfs-invalidate_page_has_len.m4
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
dnl #
dnl # Linux 3.11 has three parameters for invalidate_page
dnl # Linux 3.11 has three parameters for invalidatepage
dnl #
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_INVALIDATE_PAGE_WITH_LEN], [
ZFS_LINUX_TEST_SRC([vfs_has_invalidate_page_with_len], [
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_INVALIDATEPAGE_WITH_LEN], [
ZFS_LINUX_TEST_SRC([vfs_has_invalidatepage_with_len], [
#include <linux/fs.h>
static void
test_invalidate_page(struct page *page, unsigned int offset,
test_invalidatepage(struct page *page, unsigned int offset,
unsigned int len) {
(void) page; (void) offset; (void) len;
return;
}
static const struct address_space_operations
aops __attribute__ ((unused)) = {
.invalidate_page = test_invalidate_page,
.invalidatepage = test_invalidatepage,
};
],[])
])

AC_DEFUN([ZFS_AC_KERNEL_VFS_INVALIDATE_PAGE_WITH_LEN], [
AC_DEFUN([ZFS_AC_KERNEL_VFS_INVALIDATEPAGE_WITH_LEN], [
dnl #
dnl # Linux 3.11 has three parameters for invalidate_page
dnl # Linux 3.11 has three parameters for invalidatepage
dnl #
AC_MSG_CHECKING([whether invalidate_page has len])
ZFS_LINUX_TEST_RESULT([vfs_has_invalidate_page_with_len], [
AC_MSG_CHECKING([whether invalidatepage has len])
ZFS_LINUX_TEST_RESULT([vfs_has_invalidatepage_with_len], [
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_VFS_INVALIDATE_PAGE_WITH_LEN, 1, [invalidate_page has len])
AC_DEFINE(HAVE_VFS_INVALIDATEPAGE_WITH_LEN, 1, [invalidatepage has len])
],[
AC_MSG_RESULT([no])
])
Expand Down
4 changes: 2 additions & 2 deletions config/kernel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_VFS_READ_FOLIO
ZFS_AC_KERNEL_SRC_VFS_RELEASE_FOLIO
ZFS_AC_KERNEL_SRC_VFS_INVALIDATE_FOLIO
ZFS_AC_KERNEL_SRC_VFS_INVALIDATE_PAGE_WITH_LEN
ZFS_AC_KERNEL_SRC_VFS_INVALIDATEPAGE_WITH_LEN
ZFS_AC_KERNEL_SRC_VFS_GETATTR
ZFS_AC_KERNEL_SRC_VFS_FSYNC_2ARGS
ZFS_AC_KERNEL_SRC_VFS_ITERATE
Expand Down Expand Up @@ -264,7 +264,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_VFS_READ_FOLIO
ZFS_AC_KERNEL_VFS_RELEASE_FOLIO
ZFS_AC_KERNEL_VFS_INVALIDATE_FOLIO
ZFS_AC_KERNEL_VFS_INVALIDATE_PAGE_WITH_LEN
ZFS_AC_KERNEL_VFS_INVALIDATEPAGE_WITH_LEN
ZFS_AC_KERNEL_VFS_GETATTR
ZFS_AC_KERNEL_VFS_FSYNC_2ARGS
ZFS_AC_KERNEL_VFS_ITERATE
Expand Down
8 changes: 4 additions & 4 deletions module/os/linux/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,9 @@ zpl_invalidate_folio(struct folio *folio, size_t offset, size_t len)
zpl_releasepage(&folio->page, 0);
}
}
#elif defined(HAVE_VFS_INVALIDATE_PAGE_WITH_LEN)
#elif defined(HAVE_VFS_INVALIDATEPAGE_WITH_LEN)
static void
zpd_invalidate_page(struct page *pp, unsigned int offset, unsigned int len)
zpl_invalidatepage(struct page *pp, unsigned int offset, unsigned int len)
{
if ((offset == 0) && (len == PAGE_SIZE))
{
Expand All @@ -855,7 +855,7 @@ zpd_invalidate_page(struct page *pp, unsigned int offset, unsigned int len)
}
#else
static void
zpd_invalidate_page(struct page *pp, unsigned int offset)
zpl_invalidatepage(struct page *pp, unsigned int offset)
{
if (offset == 0)
{
Expand Down Expand Up @@ -1360,7 +1360,7 @@ const struct address_space_operations zpl_address_space_operations = {
#ifdef HAVE_VFS_INVALIDATE_FOLIO
.invalidate_folio = zpl_invalidate_folio,
#else
.invalidate_page = zpl_invalidate_page,
.invalidatepage = zpl_invalidatepage,
#endif
};

Expand Down

0 comments on commit 59c2ab1

Please sign in to comment.