UPSTREAM: f2fs: fix to return SHRINK_EMPTY if no objects to free
Quoted from include/linux/shrinker.h "count_objects should return the number of freeable items in the cache. If there are no objects to free, it should return SHRINK_EMPTY, while 0 is returned in cases of the number of freeable items cannot be determined or shrinker should skip this cache for this time (e.g., their number is below shrinkable limit)." Change-Id: I2b864f85d56c781508fb24ac0b5bf259360aadb9 Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> (cherry picked from commit bd409934c0619a6c3507891844aeb0c0dca69e18)
This commit is contained in:
committed by
Carlos Llamas
parent
85e0019c03
commit
5f937a44f2
+1
-1
@@ -73,7 +73,7 @@ unsigned long f2fs_shrink_count(struct shrinker *shrink,
|
||||
mutex_unlock(&sbi->umount_mutex);
|
||||
}
|
||||
spin_unlock(&f2fs_list_lock);
|
||||
return count;
|
||||
return count ?: SHRINK_EMPTY;
|
||||
}
|
||||
|
||||
unsigned long f2fs_shrink_scan(struct shrinker *shrink,
|
||||
|
||||
Reference in New Issue
Block a user