Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535314

[PATCH 07/22] staging: lustre: obdclass: lu_site_purge() to handle purge-all

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 07/22] staging: lustre: obdclass: lu_site_purge() to handle purge-all
Date 2016-12-03 02:20 +0100
Message-ID <sK79D-2WV-5@gated-at.bofh.it> (permalink)
References <sK6Qi-2BA-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Alex Zhuravlev <alexey.zhuravlev@intel.com>

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>
---
 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 43868ed..a02aaa3 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:
 	/*
-- 
1.7.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/22] Next batch of missing work for upstream client James Simmons <jsimmons@infradead.org> - 2016-12-03 02:00 +0100
  [PATCH 06/22] staging: lustre: llog: reset llog bitmap James Simmons <jsimmons@infradead.org> - 2016-12-03 02:00 +0100
  [PATCH 13/22] staging: lustre: statahead: set sai_index_wait with lli_sa_lock held James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 19/22] staging: lustre: llite: ll_dir_ioctl cleanup of redundant comparisons James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 17/22] staging: lustre: clio: remove mtime check in vvp_io_fault_start() James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 12/22] staging: lustre: libcfs: report hnode value for cfs_hash_putref James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 15/22] staging: lustre: rpc: increase bulk size James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 18/22] staging: lustre: import: don't reconnect during connect interpret James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 16/22] staging: lustre: llite: Invoke file_update_time in page_mkwrite James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 09/22] staging: lustre: llite: Add client mount opt to ignore suppress_pings James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 22/22] staging: lustre: libcfs: remove lnet upcall code James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 21/22] staging: lustre: remove set but unused variables James Simmons <jsimmons@infradead.org> - 2016-12-03 02:10 +0100
  [PATCH 14/22] staging: lustre: obd: add callback for llog_cat_process_or_fork James Simmons <jsimmons@infradead.org> - 2016-12-03 02:20 +0100
    Re: [PATCH 14/22] staging: lustre: obd: add callback for  llog_cat_process_or_fork Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-12-06 11:10 +0100
  [PATCH 07/22] staging: lustre: obdclass: lu_site_purge() to handle purge-all James Simmons <jsimmons@infradead.org> - 2016-12-03 02:20 +0100
  [PATCH 20/22] staging: lustre: osc: set lock data for readahead lock James Simmons <jsimmons@infradead.org> - 2016-12-03 02:30 +0100
  Re: [PATCH 00/22] Next batch of missing work for upstream client Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-12-06 11:20 +0100

csiph-web