From: Stephen Rothwell Date: Thu, 19 Sep 2013 01:45:36 +0000 (+1000) Subject: Merge remote-tracking branch 'block/for-next' X-Git-Tag: next-20130919~32 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cbba4b42146fa276559d72ec4f28ee7b60fad58d;p=karo-tx-linux.git Merge remote-tracking branch 'block/for-next' --- cbba4b42146fa276559d72ec4f28ee7b60fad58d diff --cc drivers/md/bcache/btree.c index f9764e61978b,117a12a1f5fd..1ccb702c84d5 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@@ -603,16 -676,22 +677,16 @@@ static unsigned long bch_mca_scan(struc struct cache_set *c = container_of(shrink, struct cache_set, shrink); struct btree *b, *t; unsigned long i, nr = sc->nr_to_scan; + unsigned long freed = 0; if (c->shrinker_disabled) - return 0; + return SHRINK_STOP; if (c->try_harder) - return 0; - - /* - * If nr == 0, we're supposed to return the number of items we have - * cached. Not allowed to return -1. - */ - if (!nr) - return mca_can_free(c) * c->btree_pages; + return SHRINK_STOP; /* Return -1 if we can't do anything right now */ - if (sc->gfp_mask & __GFP_WAIT) + if (sc->gfp_mask & __GFP_IO) mutex_lock(&c->bucket_lock); else if (!mutex_trylock(&c->bucket_lock)) return -1; @@@ -633,10 -712,10 +707,10 @@@ break; if (++i > 3 && - !mca_reap(b, NULL, 0)) { + !mca_reap(b, 0, false)) { mca_data_free(b); rw_unlock(true, b); - --nr; + freed++; } }