diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-09 08:27:30 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-09 09:14:11 -0900 |
commit | ac1b32acb4ca8c59c0e4911a8d3b27fd72dc54af (patch) | |
tree | e73a6ea5ddb6f3ece6a3e6c069ffa9ecc5e1ee44 /libbcache/super.h | |
parent | a17f7bcec7ed810a247c24e56229af8f43a9a6ae (diff) |
cmd_device_fail
Add a comamnd for setting a device as failed, update bcache sources
Diffstat (limited to 'libbcache/super.h')
-rw-r--r-- | libbcache/super.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/libbcache/super.h b/libbcache/super.h index bafd88e0..5626727d 100644 --- a/libbcache/super.h +++ b/libbcache/super.h @@ -3,6 +3,8 @@ #include "extents.h" +#include <linux/bcache-ioctl.h> + static inline size_t sector_to_bucket(const struct cache *ca, sector_t s) { return s >> ca->bucket_bits; @@ -54,21 +56,17 @@ 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)++) -static inline bool bch_dev_may_remove(struct cache *ca) -{ - struct cache_set *c = ca->set; - struct cache_group *grp = &c->cache_all; - - /* Can't remove the last RW device: */ - return grp->nr != 1 || - rcu_access_pointer(grp->d[0].dev) != ca; -} - void bch_dev_release(struct kobject *); -bool bch_dev_read_only(struct cache *); -const char *bch_dev_read_write(struct cache *); -bool bch_dev_remove(struct cache *, bool force); +bool bch_dev_state_allowed(struct cache_set *, struct cache *, + enum bch_member_state, int); +int __bch_dev_set_state(struct cache_set *, struct cache *, + enum bch_member_state, int); +int bch_dev_set_state(struct cache_set *, struct cache *, + enum bch_member_state, int); + +int bch_dev_fail(struct cache *, int); +int bch_dev_remove(struct cache_set *, struct cache *, int); int bch_dev_add(struct cache_set *, const char *); void bch_fs_detach(struct cache_set *); |