From: Alex Zhuravlev Date: Thu, 18 Feb 2016 20:14:09 +0000 (+0300) Subject: LU-7038 obdclass: lu_site_purge() to handle purge-all X-Git-Tag: 2.8.51~56 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bcbcd5873589c71a5d1028c14e74f8897fc3ffc0 LU-7038 obdclass: lu_site_purge() to handle purge-all if the callers wants to purge all objects, then scanning should start from the first bucket. Change-Id: I9f75ff0bd10e1d501e7c790b03ef6a73819a96d1 Signed-off-by: Alex Zhuravlev Reviewed-on: http://review.whamcloud.com/18505 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index c478d51..6c82855 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -357,7 +357,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; @@ -370,7 +370,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: /*