Skip to content

Commit

Permalink
Implement featureflags for the object storage agent (fix style errors) (
Browse files Browse the repository at this point in the history
openzfs#466)

Signed-off-by: Paul Dagnelie <pcd@delphix.com>
  • Loading branch information
pcd1193182 authored Sep 28, 2021
1 parent 6fe14f2 commit 9b9471f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions module/os/linux/zfs/vdev_object_store.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ static void
update_features(spa_t *spa, nvlist_t *nv)
{
for (nvpair_t *elem = nvlist_next_nvpair(nv, NULL);
elem != NULL; elem = nvlist_next_nvpair(nv, elem) ) {
elem != NULL; elem = nvlist_next_nvpair(nv, elem)) {
spa_feature_t feat;
if (zfeature_lookup_guid(nvpair_name(elem), &feat))
continue;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ agent_reader(void *arg)
VERIFY0(nvlist_lookup_uint8_array(nv,
AGENT_CONFIG, &arr, &len));
vos->vos_config = fnvlist_unpack((char *)arr, len);

update_features(vos->vos_vdev->vdev_spa,
fnvlist_lookup_nvlist(nv, AGENT_FEATURES));
}
Expand Down
4 changes: 3 additions & 1 deletion module/zfs/vdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,10 @@ vdev_enable_feature(vdev_t *vd, zfeature_info_t *zfeature)
for (int c = 0; c < vd->vdev_children; c++)
vdev_enable_feature(vd->vdev_child[c], zfeature);

if (vd->vdev_ops->vdev_op_leaf && vd->vdev_ops->vdev_op_enable_feature != NULL)
if (vd->vdev_ops->vdev_op_leaf &&
vd->vdev_ops->vdev_op_enable_feature != NULL) {
vd->vdev_ops->vdev_op_enable_feature(vd, zfeature);
}
}

/*
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/zfeature.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ feature_sync(spa_t *spa, zfeature_info_t *feature, uint64_t refcount,
(feature->fi_flags & ZFEATURE_FLAG_READONLY_COMPAT) ?
spa->spa_feat_for_write_obj : spa->spa_feat_for_read_obj;
VERIFY0(zap_update(spa->spa_meta_objset, zapobj,
feature->fi_guid, sizeof (uint64_t), 1, &refcount, tx));
feature->fi_guid, sizeof (uint64_t), 1, &refcount, tx));

/*
* feature_sync is called directly from zhack, allowing the
Expand Down Expand Up @@ -356,7 +356,7 @@ feature_enable_sync(spa_t *spa, zfeature_info_t *feature, dmu_tx_t *tx)

for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++)
spa_feature_enable(spa, feature->fi_depends[i], tx);

if (feature->fi_flags & ZFEATURE_FLAG_AGENT) {
vdev_enable_feature(spa->spa_root_vdev, feature);
return;
Expand Down

0 comments on commit 9b9471f

Please sign in to comment.