diff options
author | Brian Behlendorf <[email protected]> | 2011-04-18 13:47:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-04-19 09:08:08 -0700 |
commit | 9b0f9079d22f5a13903d3da4d94e8e306cfa40dd (patch) | |
tree | 644fcd04b61c6e9cfc195ebc5df59a663fbf5c8b /include/linux | |
parent | 96cdefab84061e807f54ed17b93e0586393f9448 (diff) |
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.
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mm_compat.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/mm_compat.h b/include/linux/mm_compat.h index 522db827f..07231c9a4 100644 --- a/include/linux/mm_compat.h +++ b/include/linux/mm_compat.h @@ -49,11 +49,27 @@ * The function invalidate_inodes() is no longer exported by the kernel. * The prototype however is still available which means it is safe * to acquire the symbol's address using spl_kallsyms_lookup_name(). + * + * 2.6.39 API compat, + * As for 2.6.39 invalidate_inodes() was updated to take a second + * argument which controls how dirty inodes should be handled. */ -#ifndef HAVE_INVALIDATE_INODES +#ifdef HAVE_INVALIDATE_INODES +# ifdef HAVE_2ARGS_INVALIDATE_INODES +# define spl_invalidate_inodes(sb, kd) invalidate_inodes(sb, kd) +# else +# define spl_invalidate_inodes(sb, kd) invalidate_inodes(sb) +# endif /* HAVE_2ARGS_INVALIDATE_INODES */ +#else +# ifdef HAVE_2ARGS_INVALIDATE_INODES +typedef int (*invalidate_inodes_t)(struct super_block *sb, bool kd); +extern invalidate_inodes_t invalidate_inodes_fn; +# define spl_invalidate_inodes(sb, kd) invalidate_inodes_fn(sb, kd) +# else typedef int (*invalidate_inodes_t)(struct super_block *sb); extern invalidate_inodes_t invalidate_inodes_fn; -#define invalidate_inodes(sb) invalidate_inodes_fn(sb) +# define spl_invalidate_inodes(sb, kd) invalidate_inodes_fn(sb) +# endif /* HAVE_2ARGS_INVALIDATE_INODES */ #endif /* HAVE_INVALIDATE_INODES */ /* |