diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 11:10:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-14 11:10:21 -0400 |
commit | d429a3639ca967ce2f35e3e8d4e70caec7149ded (patch) | |
tree | cad1e5602551b6a744f63ef062de2c2e21cfe39a /lib | |
parent | 4a319a490ca59a746b3d36768c0e29ee19832366 (diff) | |
parent | 99d540018caa920b7a54e2d3048f1dff530b294b (diff) |
Merge branch 'for-3.17/drivers' of git://git.kernel.dk/linux-block
Pull block driver changes from Jens Axboe:
"Nothing out of the ordinary here, this pull request contains:
- A big round of fixes for bcache from Kent Overstreet, Slava Pestov,
and Surbhi Palande. No new features, just a lot of fixes.
- The usual round of drbd updates from Andreas Gruenbacher, Lars
Ellenberg, and Philipp Reisner.
- virtio_blk was converted to blk-mq back in 3.13, but now Ming Lei
has taken it one step further and added support for actually using
more than one queue.
- Addition of an explicit SG_FLAG_Q_AT_HEAD for block/bsg, to
compliment the the default behavior of adding to the tail of the
queue. From Douglas Gilbert"
* 'for-3.17/drivers' of git://git.kernel.dk/linux-block: (86 commits)
bcache: Drop unneeded blk_sync_queue() calls
bcache: add mutex lock for bch_is_open
bcache: Correct printing of btree_gc_max_duration_ms
bcache: try to set b->parent properly
bcache: fix memory corruption in init error path
bcache: fix crash with incomplete cache set
bcache: Fix more early shutdown bugs
bcache: fix use-after-free in btree_gc_coalesce()
bcache: Fix an infinite loop in journal replay
bcache: fix crash in bcache_btree_node_alloc_fail tracepoint
bcache: bcache_write tracepoint was crashing
bcache: fix typo in bch_bkey_equal_header
bcache: Allocate bounce buffers with GFP_NOWAIT
bcache: Make sure to pass GFP_WAIT to mempool_alloc()
bcache: fix uninterruptible sleep in writeback thread
bcache: wait for buckets when allocating new btree root
bcache: fix crash on shutdown in passthrough mode
bcache: fix lockdep warnings on shutdown
bcache allocator: send discards with correct size
bcache: Fix to remove the rcu_sched stalls.
...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lru_cache.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/lru_cache.c b/lib/lru_cache.c index 4a83ecd03650..852c81e3ba9a 100644 --- a/lib/lru_cache.c +++ b/lib/lru_cache.c | |||
@@ -169,7 +169,7 @@ out_fail: | |||
169 | return NULL; | 169 | return NULL; |
170 | } | 170 | } |
171 | 171 | ||
172 | void lc_free_by_index(struct lru_cache *lc, unsigned i) | 172 | static void lc_free_by_index(struct lru_cache *lc, unsigned i) |
173 | { | 173 | { |
174 | void *p = lc->lc_element[i]; | 174 | void *p = lc->lc_element[i]; |
175 | WARN_ON(!p); | 175 | WARN_ON(!p); |
@@ -643,9 +643,10 @@ void lc_set(struct lru_cache *lc, unsigned int enr, int index) | |||
643 | * lc_dump - Dump a complete LRU cache to seq in textual form. | 643 | * lc_dump - Dump a complete LRU cache to seq in textual form. |
644 | * @lc: the lru cache to operate on | 644 | * @lc: the lru cache to operate on |
645 | * @seq: the &struct seq_file pointer to seq_printf into | 645 | * @seq: the &struct seq_file pointer to seq_printf into |
646 | * @utext: user supplied "heading" or other info | 646 | * @utext: user supplied additional "heading" or other info |
647 | * @detail: function pointer the user may provide to dump further details | 647 | * @detail: function pointer the user may provide to dump further details |
648 | * of the object the lc_element is embedded in. | 648 | * of the object the lc_element is embedded in. May be NULL. |
649 | * Note: a leading space ' ' and trailing newline '\n' is implied. | ||
649 | */ | 650 | */ |
650 | void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext, | 651 | void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext, |
651 | void (*detail) (struct seq_file *, struct lc_element *)) | 652 | void (*detail) (struct seq_file *, struct lc_element *)) |
@@ -654,16 +655,18 @@ void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext | |||
654 | struct lc_element *e; | 655 | struct lc_element *e; |
655 | int i; | 656 | int i; |
656 | 657 | ||
657 | seq_printf(seq, "\tnn: lc_number refcnt %s\n ", utext); | 658 | seq_printf(seq, "\tnn: lc_number (new nr) refcnt %s\n ", utext); |
658 | for (i = 0; i < nr_elements; i++) { | 659 | for (i = 0; i < nr_elements; i++) { |
659 | e = lc_element_by_index(lc, i); | 660 | e = lc_element_by_index(lc, i); |
660 | if (e->lc_number == LC_FREE) { | 661 | if (e->lc_number != e->lc_new_number) |
661 | seq_printf(seq, "\t%2d: FREE\n", i); | 662 | seq_printf(seq, "\t%5d: %6d %8d %6d ", |
662 | } else { | 663 | i, e->lc_number, e->lc_new_number, e->refcnt); |
663 | seq_printf(seq, "\t%2d: %4u %4u ", i, | 664 | else |
664 | e->lc_number, e->refcnt); | 665 | seq_printf(seq, "\t%5d: %6d %-8s %6d ", |
666 | i, e->lc_number, "-\"-", e->refcnt); | ||
667 | if (detail) | ||
665 | detail(seq, e); | 668 | detail(seq, e); |
666 | } | 669 | seq_putc(seq, '\n'); |
667 | } | 670 | } |
668 | } | 671 | } |
669 | 672 | ||