提交 86558182 编写于 作者: A Alex Zhuravlev 提交者: Greg Kroah-Hartman

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: NAlex Zhuravlev <alexey.zhuravlev@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7038
Reviewed-on: http://review.whamcloud.com/18505Reviewed-by: NMike Pershin <mike.pershin@intel.com>
Reviewed-by: NFaccini Bruno <bruno.faccini@intel.com>
Reviewed-by: NOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: NJames Simmons <jsimmons@infradead.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 d6426a64
...@@ -338,7 +338,7 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) ...@@ -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 cfs_hash_bd bd2;
struct list_head dispose; struct list_head dispose;
int did_sth; int did_sth;
unsigned int start; unsigned int start = 0;
int count; int count;
int bnr; int bnr;
unsigned int i; unsigned int i;
...@@ -351,7 +351,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) ...@@ -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 * Under LRU list lock, scan LRU list and move unreferenced objects to
* the dispose list, removing them from LRU and hash table. * 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; bnr = (nr == ~0) ? -1 : nr / (int)CFS_HASH_NBKT(s->ls_obj_hash) + 1;
again: again:
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册