summaryrefslogtreecommitdiff
path: root/libbcache/super.h
diff options
context:
space:
mode:
Diffstat (limited to 'libbcache/super.h')
-rw-r--r--libbcache/super.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/libbcache/super.h b/libbcache/super.h
index bcf7d98..bafd88e 100644
--- a/libbcache/super.h
+++ b/libbcache/super.h
@@ -57,27 +57,11 @@ static inline struct cache *bch_get_next_cache(struct cache_set *c,
static inline bool bch_dev_may_remove(struct cache *ca)
{
struct cache_set *c = ca->set;
- struct cache_group *tier = &c->cache_tiers[ca->mi.tier];
-
- /*
- * Right now, we can't remove the last device from a tier,
- * - For tier 0, because all metadata lives in tier 0 and because
- * there is no way to have foreground writes go directly to tier 1.
- * - For tier 1, because the code doesn't completely support an
- * empty tier 1.
- */
-
- /*
- * Turning a device read-only removes it from the cache group,
- * so there may only be one read-write device in a tier, and yet
- * the device we are removing is in the same tier, so we have
- * to check for identity.
- * Removing the last RW device from a tier requires turning the
- * whole cache set RO.
- */
-
- return tier->nr_devices != 1 ||
- rcu_access_pointer(tier->d[0].dev) != ca;
+ 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 *);
@@ -89,15 +73,15 @@ int bch_dev_add(struct cache_set *, const char *);
void bch_fs_detach(struct cache_set *);
-bool bch_fs_read_only(struct cache_set *);
bool bch_fs_emergency_read_only(struct cache_set *);
-void bch_fs_read_only_sync(struct cache_set *);
+void bch_fs_read_only(struct cache_set *);
const char *bch_fs_read_write(struct cache_set *);
void bch_fs_release(struct kobject *);
+void bch_fs_stop_async(struct cache_set *);
void bch_fs_stop(struct cache_set *);
-void bch_fs_stop_sync(struct cache_set *);
+const char *bch_fs_start(struct cache_set *);
const char *bch_fs_open(char * const *, unsigned, struct bch_opts,
struct cache_set **);
const char *bch_fs_open_incremental(const char *path);