Lars Ellenberg cbe5e61095 lru_cache: introduce lc_get_cumulative()
New helper to be able to consolidate more updates
into a single transaction.
Without this, we can only grab a single refcount
on an updated element while preparing a transaction.

lc_get_cumulative - like lc_get; also finds to-be-changed elements
  @lc: the lru cache to operate on
  @enr: the label to look up

  Unlike lc_get this also returns the element for @enr, if it is belonging to
  a pending transaction, so the return values are like for lc_get(),
  plus:

  pointer to an element already on the "to_be_changed" list.
	  In this case, the cache was already marked %LC_DIRTY.

  Caller needs to make sure that the pending transaction is completed,
  before proceeding to actually use this element.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>

Fixed up by Jens to export lc_get_cumulative().

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2013-03-22 22:17:36 -06:00
..
2013-03-13 15:21:48 -07:00
2013-02-27 19:10:09 -08:00
2012-09-30 18:02:20 -07:00
2012-10-06 03:04:57 +09:00
2013-01-17 12:19:09 -08:00
2012-10-09 16:22:40 +09:00
2013-03-02 08:31:39 -08:00
2012-12-17 17:15:22 -08:00
2012-07-30 17:25:16 -07:00