summaryrefslogtreecommitdiffstats
path: root/include/linux/mbcache.h
diff options
context:
space:
mode:
authorT Makphaibulchoke <tmac@hp.com>2014-03-18 19:19:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-03-18 19:19:41 -0400
commit3e037e5211252902a188a6a11aecd247409d0229 (patch)
tree55bddffd164cc22ceba4020d9a0e9d2f666d40d4 /include/linux/mbcache.h
parentb8a8684502a0fc852afa0056c6bb2a9273f6fcc0 (diff)
downloadop-kernel-dev-3e037e5211252902a188a6a11aecd247409d0229.zip
op-kernel-dev-3e037e5211252902a188a6a11aecd247409d0229.tar.gz
fs/mbcache.c: change block and index hash chain to hlist_bl_node
This patch changes each mb_cache's both block and index hash chains to use a hlist_bl_node, which contains a built-in lock. This is the first step in decoupling of locks serializing accesses to mb_cache global data and each mb_cache_entry local data. Signed-off-by: T. Makphaibulchoke <tmac@hp.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'include/linux/mbcache.h')
-rw-r--r--include/linux/mbcache.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 5525d37..6a392e7 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -3,19 +3,21 @@
(C) 2001 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
*/
-
struct mb_cache_entry {
struct list_head e_lru_list;
struct mb_cache *e_cache;
unsigned short e_used;
unsigned short e_queued;
+ atomic_t e_refcnt;
struct block_device *e_bdev;
sector_t e_block;
- struct list_head e_block_list;
+ struct hlist_bl_node e_block_list;
struct {
- struct list_head o_list;
+ struct hlist_bl_node o_list;
unsigned int o_key;
} e_index;
+ struct hlist_bl_head *e_block_hash_p;
+ struct hlist_bl_head *e_index_hash_p;
};
struct mb_cache {
@@ -25,8 +27,8 @@ struct mb_cache {
int c_max_entries;
int c_bucket_bits;
struct kmem_cache *c_entry_cache;
- struct list_head *c_block_hash;
- struct list_head *c_index_hash;
+ struct hlist_bl_head *c_block_hash;
+ struct hlist_bl_head *c_index_hash;
};
/* Functions on caches */
OpenPOWER on IntegriCloud