bcache.h (6f10f7d1b02b1bbc305f88d7696445dd38b13881) bcache.h (1fae7cf05293d3a2c9e59c1bc59372322386467c)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHE_H
3#define _BCACHE_H
4
5/*
6 * SOME HIGH LEVEL CODE DOCUMENTATION:
7 *
8 * Bcache mostly works with cache sets, cache devices, and backing devices.

--- 769 unchanged lines hidden (view full) ---

778 unsigned int ptr)
779{
780 return PTR_CACHE(c, k, ptr)->buckets + PTR_BUCKET_NR(c, k, ptr);
781}
782
783static inline uint8_t gen_after(uint8_t a, uint8_t b)
784{
785 uint8_t r = a - b;
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHE_H
3#define _BCACHE_H
4
5/*
6 * SOME HIGH LEVEL CODE DOCUMENTATION:
7 *
8 * Bcache mostly works with cache sets, cache devices, and backing devices.

--- 769 unchanged lines hidden (view full) ---

778 unsigned int ptr)
779{
780 return PTR_CACHE(c, k, ptr)->buckets + PTR_BUCKET_NR(c, k, ptr);
781}
782
783static inline uint8_t gen_after(uint8_t a, uint8_t b)
784{
785 uint8_t r = a - b;
786
786 return r > 128U ? 0 : r;
787}
788
789static inline uint8_t ptr_stale(struct cache_set *c, const struct bkey *k,
790 unsigned int i)
791{
792 return gen_after(PTR_BUCKET(c, k, i)->gen, PTR_GEN(k, i));
793}

--- 212 unchanged lines hidden ---
787 return r > 128U ? 0 : r;
788}
789
790static inline uint8_t ptr_stale(struct cache_set *c, const struct bkey *k,
791 unsigned int i)
792{
793 return gen_after(PTR_BUCKET(c, k, i)->gen, PTR_GEN(k, i));
794}

--- 212 unchanged lines hidden ---