diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-10 12:40:01 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-03-10 12:40:01 -0900 |
commit | 3bf874183a518cc1bf785d9944de05cf51a177d3 (patch) | |
tree | 65fb33f65a65996669fb96e5c746f6dd4d22d31c /libbcache/notify.c | |
parent | c3844b0b7ff75527a87f52229f15341c24c0d356 (diff) |
update bcache sources
Diffstat (limited to 'libbcache/notify.c')
-rw-r--r-- | libbcache/notify.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/libbcache/notify.c b/libbcache/notify.c index 00b7999a..1d5f626f 100644 --- a/libbcache/notify.c +++ b/libbcache/notify.c @@ -17,7 +17,7 @@ WARN_ON_ONCE(ret); \ }) -static void notify_get(struct cache_set *c) +static void notify_get(struct bch_fs *c) { struct kobj_uevent_env *env = &c->uevent_env; @@ -28,17 +28,16 @@ static void notify_get(struct cache_set *c) notify_var(c, "SET_UUID=%pU", c->sb.user_uuid.b); } -static void notify_get_cache(struct cache *ca) +static void notify_get_cache(struct bch_dev *ca) { - struct cache_set *c = ca->set; - char buf[BDEVNAME_SIZE]; + struct bch_fs *c = ca->fs; notify_get(c); notify_var(c, "UUID=%pU", ca->uuid.b); - notify_var(c, "BLOCKDEV=%s", bdevname(ca->disk_sb.bdev, buf)); + notify_var(c, "BLOCKDEV=%s", ca->name); } -static void notify_put(struct cache_set *c) +static void notify_put(struct bch_fs *c) { struct kobj_uevent_env *env = &c->uevent_env; @@ -47,84 +46,84 @@ static void notify_put(struct cache_set *c) mutex_unlock(&c->uevent_lock); } -void bch_notify_fs_read_write(struct cache_set *c) +void bch_notify_fs_read_write(struct bch_fs *c) { notify_get(c); notify_var(c, "STATE=active"); notify_put(c); } -void bch_notify_fs_read_only(struct cache_set *c) +void bch_notify_fs_read_only(struct bch_fs *c) { notify_get(c); notify_var(c, "STATE=readonly"); notify_put(c); } -void bch_notify_fs_stopped(struct cache_set *c) +void bch_notify_fs_stopped(struct bch_fs *c) { notify_get(c); notify_var(c, "STATE=stopped"); notify_put(c); } -void bch_notify_dev_read_write(struct cache *ca) +void bch_notify_dev_read_write(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=active"); notify_put(c); } -void bch_notify_dev_read_only(struct cache *ca) +void bch_notify_dev_read_only(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=readonly"); notify_put(c); } -void bch_notify_dev_added(struct cache *ca) +void bch_notify_dev_added(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=removing"); notify_put(c); } -void bch_notify_dev_removing(struct cache *ca) +void bch_notify_dev_removing(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=removing"); notify_put(c); } -void bch_notify_dev_remove_failed(struct cache *ca) +void bch_notify_dev_remove_failed(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=remove_failed"); notify_put(c); } -void bch_notify_dev_removed(struct cache *ca) +void bch_notify_dev_removed(struct bch_dev *ca) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=removed"); notify_put(c); } -void bch_notify_dev_error(struct cache *ca, bool fatal) +void bch_notify_dev_error(struct bch_dev *ca, bool fatal) { - struct cache_set *c = ca->set; + struct bch_fs *c = ca->fs; notify_get_cache(ca); notify_var(c, "STATE=error"); |