Skip to content

Commit

Permalink
glusterd: add stripe_count in volume info (#3070) (#3133)
Browse files Browse the repository at this point in the history
* glusterd: add stripe_count in volume info

Change-Id: Ib04434b41b7c299cee0ed8d81deb5a68a17b0c0a
Fixes: #3066
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>

* Add stipe-count only if version is less than 10

Change-Id: Ibb589df2bb4c00c71850d787c998aff746321a17
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
  • Loading branch information
Sheetalpamecha committed Jan 17, 2022
1 parent a804f8e commit 047c95f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xlators/mgmt/glusterd/src/glusterd-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,16 @@ glusterd_volume_exclude_options_write(int fd, glusterd_volinfo_t *volinfo)
}
total_len += ret;

if (conf->op_version < GD_OP_VERSION_10_0) {
ret = snprintf(buf + total_len, sizeof(buf) - total_len, "%s=%d\n",
GLUSTERD_STORE_KEY_VOL_STRIPE_CNT, STRIPE_COUNT);
if (ret < 0 || ret >= sizeof(buf) - total_len) {
ret = -1;
goto out;
}
total_len += ret;
}

if ((conf->op_version >= GD_OP_VERSION_3_7_6) && volinfo->arbiter_count) {
ret = snprintf(buf + total_len, sizeof(buf) - total_len, "%s=%d\n",
GLUSTERD_STORE_KEY_VOL_ARBITER_CNT,
Expand Down
1 change: 1 addition & 0 deletions xlators/mgmt/glusterd/src/glusterd-store.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ typedef enum glusterd_store_ver_ac_ {
#define GLUSTERD_STORE_KEY_VOL_STATUS "status"
#define GLUSTERD_STORE_KEY_VOL_PORT "port"
#define GLUSTERD_STORE_KEY_VOL_SUB_COUNT "sub_count"
#define GLUSTERD_STORE_KEY_VOL_STRIPE_CNT "stripe_count"
#define GLUSTERD_STORE_KEY_VOL_REPLICA_CNT "replica_count"
#define GLUSTERD_STORE_KEY_VOL_DISPERSE_CNT "disperse_count"
#define GLUSTERD_STORE_KEY_VOL_REDUNDANCY_CNT "redundancy_count"
Expand Down

0 comments on commit 047c95f

Please sign in to comment.