diff options
author | Alex Zhuravlev <alexey.zhuravlev@intel.com> | 2016-12-03 01:53:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-12-06 10:47:55 +0100 |
commit | 8655818239762eddcbf99885224b1e3a10a68639 (patch) | |
tree | 0c110db97f93febdb9412cfb43954c99b37867b3 /drivers/staging | |
parent | staging: lustre: llite: ll_dir_ioctl cleanup of redundant comparisons (diff) | |
download | linux-8655818239762eddcbf99885224b1e3a10a68639.tar.xz linux-8655818239762eddcbf99885224b1e3a10a68639.zip |
staging: lustre: obdclass: lu_site_purge() to handle purge-all
if the callers wants to purge all objects, then scanning
should start from the first bucket.
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7038
Reviewed-on: http://review.whamcloud.com/18505
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/lu_object.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 43868ed5cc3d..a02aaa3a3b37 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -338,7 +338,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) struct cfs_hash_bd bd2; struct list_head dispose; int did_sth; - unsigned int start; + unsigned int start = 0; int count; int bnr; unsigned int i; @@ -351,7 +351,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) * Under LRU list lock, scan LRU list and move unreferenced objects to * the dispose list, removing them from LRU and hash table. */ - start = s->ls_purge_start; + if (nr != ~0) + start = s->ls_purge_start; bnr = (nr == ~0) ? -1 : nr / (int)CFS_HASH_NBKT(s->ls_obj_hash) + 1; again: /* |