summaryrefslogtreecommitdiff
path: root/libbcache/super.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcache/super.h')
-rw-r--r--libbcache/super.h48
1 files changed, 2 insertions, 46 deletions
diff --git a/libbcache/super.h b/libbcache/super.h
index 635e1a6f..014d7aed 100644
--- a/libbcache/super.h
+++ b/libbcache/super.h
@@ -18,17 +18,12 @@ static inline sector_t bucket_remainder(const struct cache *ca, sector_t s)
return s & (ca->mi.bucket_size - 1);
}
-#define cache_member_info_get(_c) \
- (rcu_read_lock(), rcu_dereference((_c)->members))
-
-#define cache_member_info_put() rcu_read_unlock()
-
static inline struct cache *bch_next_cache_rcu(struct cache_set *c,
unsigned *iter)
{
struct cache *ret = NULL;
- while (*iter < c->sb.nr_in_set &&
+ while (*iter < c->sb.nr_devices &&
!(ret = rcu_dereference(c->cache[*iter])))
(*iter)++;
@@ -59,40 +54,6 @@ static inline struct cache *bch_get_next_cache(struct cache_set *c,
(ca = bch_get_next_cache(c, &(iter))); \
percpu_ref_put(&ca->ref), (iter)++)
-void bch_check_mark_super_slowpath(struct cache_set *,
- const struct bkey_i *, bool);
-
-static inline bool bch_check_super_marked(struct cache_set *c,
- const struct bkey_i *k, bool meta)
-{
- struct bkey_s_c_extent e = bkey_i_to_s_c_extent(k);
- const struct bch_extent_ptr *ptr;
- struct cache_member_cpu *mi = cache_member_info_get(c)->m;
- bool ret = true;
-
- extent_for_each_ptr(e, ptr)
- if (!(meta
- ? mi[ptr->dev].has_metadata
- : mi[ptr->dev].has_data) &&
- bch_extent_ptr_is_dirty(c, e, ptr)) {
- ret = false;
- break;
- }
-
- cache_member_info_put();
-
- return ret;
-}
-
-static inline void bch_check_mark_super(struct cache_set *c,
- const struct bkey_i *k, bool meta)
-{
- if (bch_check_super_marked(c, k, meta))
- return;
-
- bch_check_mark_super_slowpath(c, k, meta);
-}
-
static inline bool bch_cache_may_remove(struct cache *ca)
{
struct cache_set *c = ca->set;
@@ -119,11 +80,6 @@ static inline bool bch_cache_may_remove(struct cache *ca)
rcu_access_pointer(tier->d[0].dev) != ca;
}
-void free_super(struct bcache_superblock *);
-int bch_super_realloc(struct bcache_superblock *, unsigned);
-void bcache_write_super(struct cache_set *);
-void __write_super(struct cache_set *, struct bcache_superblock *);
-
void bch_cache_set_release(struct kobject *);
void bch_cache_release(struct kobject *);
@@ -149,7 +105,7 @@ extern struct mutex bch_register_lock;
extern struct list_head bch_cache_sets;
extern struct idr bch_cache_set_minor;
extern struct workqueue_struct *bcache_io_wq;
-extern struct crypto_shash *bch_sha1;
+extern struct crypto_shash *bch_sha256;
extern struct kobj_type bch_cache_set_ktype;
extern struct kobj_type bch_cache_set_internal_ktype;