diff options
author | Tim Chase <[email protected]> | 2014-12-18 10:08:47 -0600 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-01-20 14:07:59 -0800 |
commit | 3c832b8cc13bb4e570b317c30b146bb072e08f58 (patch) | |
tree | be0f5c00b2084505a7028c3474c5a845cfb92a27 /module/zfs/zfs_vfsops.c | |
parent | 6e9710f7c33a7440904b39fb4e6b68b3325cfeca (diff) |
Linux 3.12 compat: split shrinker has s_shrink
The split count/scan shrinker callbacks introduced in 3.12 broke the
test for HAVE_SHRINK, effectively disabling the per-superblock shrinkers.
This patch re-enables the per-superblock shrinkers when the split shrinker
callbacks have been detected.
Signed-off-by: Tim Chase <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2975
Diffstat (limited to 'module/zfs/zfs_vfsops.c')
-rw-r--r-- | module/zfs/zfs_vfsops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index d29fc6560..a2dea89b7 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -1068,7 +1068,7 @@ zfs_root(zfs_sb_t *zsb, struct inode **ipp) } EXPORT_SYMBOL(zfs_root); -#ifdef HAVE_SHRINK +#if defined(HAVE_SHRINK) || defined(HAVE_SPLIT_SHRINKER_CALLBACK) int zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects) { @@ -1080,13 +1080,17 @@ zfs_sb_prune(struct super_block *sb, unsigned long nr_to_scan, int *objects) }; ZFS_ENTER(zsb); +#ifdef HAVE_SPLIT_SHRINKER_CALLBACK + *objects = (*shrinker->scan_objects)(shrinker, &sc); +#else *objects = (*shrinker->shrink)(shrinker, &sc); +#endif ZFS_EXIT(zsb); return (0); } EXPORT_SYMBOL(zfs_sb_prune); -#endif /* HAVE_SHRINK */ +#endif /* defined(HAVE_SHRINK) || defined(HAVE_SPLIT_SHRINKER_CALLBACK) */ /* * Teardown the zfs_sb_t. |