[11/29] lustre: osc_cache: simplify osc_wake_cache_waiters()
diff mbox series

Message ID 154701504164.26726.1429367185304894591.stgit@noble
State New
Headers show
Series
  • assorted osc cleanups.
Related show

Commit Message

NeilBrown Jan. 9, 2019, 6:24 a.m. UTC
osc_wake_cache_waiters() performs a test, then possibly
calls osc_enter_cache_try() which performs the same test.
We don't benefit from this duplication except that it allows
an extra debug message.  I'm not certain that message
is worth the complexity.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/osc/osc_cache.c |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

Patch
diff mbox series

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index 5cd3732101e7..0c78b95e45a3 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1694,20 +1694,11 @@  void osc_wake_cache_waiters(struct client_obd *cli)
 					       ocw_entry))) {
 		list_del_init(&ocw->ocw_entry);
 
-		ocw->ocw_rc = -EDQUOT;
-		/* we can't dirty more */
-		if ((cli->cl_dirty_pages > cli->cl_dirty_max_pages) ||
-		    (atomic_long_read(&obd_dirty_pages) + 1 >
-		     obd_max_dirty_pages)) {
-			CDEBUG(D_CACHE, "no dirty room: dirty: %ld osc max %ld, sys max %ld\n",
-			       cli->cl_dirty_pages, cli->cl_dirty_max_pages,
-			       obd_max_dirty_pages);
-			goto wakeup;
-		}
-
 		if (osc_enter_cache_try(cli, ocw->ocw_oap, ocw->ocw_grant, 0))
 			ocw->ocw_rc = 0;
-wakeup:
+		else
+			ocw->ocw_rc = -EDQUOT;
+
 		CDEBUG(D_CACHE, "wake up %p for oap %p, avail grant %ld, %d\n",
 		       ocw, ocw->ocw_oap, cli->cl_avail_grant, ocw->ocw_rc);