summaryrefslogtreecommitdiff
path: root/include/linux/mbcache.h
diff options
context:
space:
mode:
authorTahsin Erdogan <tahsin@google.com>2017-06-22 10:29:53 -0400
committerTheodore Ts'o <tytso@mit.edu>2017-06-22 10:29:53 -0400
commitc07dfcb45877fbc6798fa042bab3c4b85378efd4 (patch)
treea626ee2c0841dd7370097b8a1e874941f34de4eb /include/linux/mbcache.h
parentb6d9029df083c0a9ce1d4eda1480105e635e0d61 (diff)
mbcache: make mbcache naming more generic
Make names more generic so that mbcache usage is not limited to block sharing. In a subsequent patch in the series ("ext4: xattr inode deduplication"), we start using the mbcache code for sharing xattr inodes. With that patch, old mb_cache_entry.e_block field could be holding either a block number or an inode number. Signed-off-by: Tahsin Erdogan <tahsin@google.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/mbcache.h')
-rw-r--r--include/linux/mbcache.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 86c9a8b480c5..e1bc73414983 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -19,15 +19,15 @@ struct mb_cache_entry {
u32 e_key;
u32 e_referenced:1;
u32 e_reusable:1;
- /* Block number of hashed block - stable during lifetime of the entry */
- sector_t e_block;
+ /* User provided value - stable during lifetime of the entry */
+ u64 e_value;
};
struct mb_cache *mb_cache_create(int bucket_bits);
void mb_cache_destroy(struct mb_cache *cache);
int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key,
- sector_t block, bool reusable);
+ u64 value, bool reusable);
void __mb_cache_entry_free(struct mb_cache_entry *entry);
static inline int mb_cache_entry_put(struct mb_cache *cache,
struct mb_cache_entry *entry)
@@ -38,10 +38,9 @@ static inline int mb_cache_entry_put(struct mb_cache *cache,
return 1;
}
-void mb_cache_entry_delete_block(struct mb_cache *cache, u32 key,
- sector_t block);
+void mb_cache_entry_delete(struct mb_cache *cache, u32 key, u64 value);
struct mb_cache_entry *mb_cache_entry_get(struct mb_cache *cache, u32 key,
- sector_t block);
+ u64 value);
struct mb_cache_entry *mb_cache_entry_find_first(struct mb_cache *cache,
u32 key);
struct mb_cache_entry *mb_cache_entry_find_next(struct mb_cache *cache,