From bcbcd5873589c71a5d1028c14e74f8897fc3ffc0 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Thu, 18 Feb 2016 23:14:09 +0300 Subject: [PATCH] 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 --- lustre/obdclass/lu_object.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: /* -- 1.8.3.1