mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Linux 2.6.39 compat, invalidate_inodes()
To resolve a potiential filesystem corruption issue a second argument was added to invalidate_inodes(). This argument controls whether dirty inodes are dropped or treated as busy when invalidating a super block. When only the legacy API is available the second argument will be dropped for compatibility.
This commit is contained in:
@@ -76,6 +76,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
|
||||
SPL_AC_3ARGS_FILE_FSYNC
|
||||
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
|
||||
SPL_AC_KERNEL_INVALIDATE_INODES
|
||||
SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES
|
||||
SPL_AC_SHRINK_DCACHE_MEMORY
|
||||
SPL_AC_SHRINK_ICACHE_MEMORY
|
||||
])
|
||||
@@ -1720,6 +1721,36 @@ AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
|
||||
[])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.39 API compat,
|
||||
dnl # The function invalidate_inodes() now take 2 arguments. The second
|
||||
dnl # 'kill_dirty' argument describes how invalidate_inodes() should
|
||||
dnl # handle dirty inodes. Only when set will dirty inodes be discarded,
|
||||
dnl # otherwise they will be handled as busy.
|
||||
dnl #
|
||||
dnl # Unfortunately, we don't have access to the invalidate_inodes()
|
||||
dnl # prototype so it's not easy to check how many arguments it takes.
|
||||
dnl # However, this change was done for the benefit of invalidate_device()
|
||||
dnl # which also added an argument. The invalidate_device() symbol does
|
||||
dnl # exist in the development headers so if it takes two arguments we
|
||||
dnl # can fairly safely infer that invalidate_inodes() takes two arguments
|
||||
dnl # as well. See commit 93b270f76e7ef3b81001576860c2701931cdc78b.
|
||||
dnl #
|
||||
AC_DEFUN([SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES],
|
||||
[AC_MSG_CHECKING([whether invalidate_inodes() wants 2 args])
|
||||
SPL_LINUX_TRY_COMPILE([
|
||||
#include <linux/fs.h>
|
||||
],[
|
||||
return __invalidate_device(NULL, 0);
|
||||
],[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_2ARGS_INVALIDATE_INODES, 1,
|
||||
[invalidate_inodes() wants 2 args])
|
||||
],[
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.xx API compat,
|
||||
dnl # There currently exists no exposed API to partially shrink the dcache.
|
||||
|
||||
Reference in New Issue
Block a user