summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-06-23 13:10:56 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-07-31 15:34:58 +0000
commit61ea2a44b509cebc566fc18b2c356d88a3f1fdc8 (patch)
tree21d43ed73f6a5c3057be59306649ac5fe2ffa268 /xlators/mgmt/glusterd/src/glusterd-store.c
parentd446c0defab52977cfc6460c0bde0fde0f61e314 (diff)
posix: option to handle the shared bricks for statvfs()
Currently 'storage/posix' xlator has an option called option `export-statfs-size no`, which exports zero as values for few fields in `struct statvfs`. In a case of backend brick shared between multiple brick processes, the values of these variables should be `field_value / number-of-bricks-at-node`. This way, even the issue of 'min-free-disk' etc at different layers would also be handled properly when the statfs() sys call is made. Fixes #241 > Reviewed-on: https://review.gluster.org/17618 > Reviewed-by: Jeff Darcy <jeff@pl.atyp.us> > Reviewed-by: Atin Mukherjee <amukherj@redhat.com> > (cherry picked from commit febf5ed4848ad705a34413353559482417c61467) Change-Id: I2e320e1fdcc819ab9173277ef3498201432c275f Signed-off-by: Amar Tumballi <amarts@redhat.com> Reviewed-on: https://review.gluster.org/17903 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 72b70f916c6..8eb301f040f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -352,6 +352,12 @@ gd_store_brick_snap_details_write (int fd, glusterd_brickinfo_t *brickinfo)
snprintf (value, sizeof(value), "%d", brickinfo->snap_status);
ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS,
value);
+ if (ret)
+ goto out;
+
+ memset (value, 0, sizeof (value));
+ snprintf (value, sizeof (value), "%lu", brickinfo->statfs_fsid);
+ ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_FSID, value);
out:
return ret;
@@ -2508,6 +2514,10 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo)
} else if (!strcmp(key, GLUSTERD_STORE_KEY_BRICK_ID)) {
strncpy (brickinfo->brick_id, value,
sizeof (brickinfo->brick_id));
+ } else if (!strncmp (key,
+ GLUSTERD_STORE_KEY_BRICK_FSID,
+ strlen (GLUSTERD_STORE_KEY_BRICK_FSID))) {
+ gf_string2uint64 (value, &brickinfo->statfs_fsid);
} else {
gf_msg (this->name, GF_LOG_ERROR, 0,
GD_MSG_UNKNOWN_KEY, "Unknown key: %s",