• Lars Ellenberg's avatar
    lru_cache: introduce lc_get_cumulative() · cbe5e610
    Lars Ellenberg authored
    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: 's avatarPhilipp Reisner <philipp.reisner@linbit.com>
    Signed-off-by: 's avatarLars Ellenberg <lars.ellenberg@linbit.com>
    
    Fixed up by Jens to export lc_get_cumulative().
    Signed-off-by: 's avatarJens Axboe <axboe@kernel.dk>
    cbe5e610
lru_cache.c 19.2 KB