path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
authorAmar Tumballi <>2017-06-23 13:10:56 +0530
committerAtin Mukherjee <>2017-07-24 15:34:34 +0000
commitfebf5ed4848ad705a34413353559482417c61467 (patch)
tree081447d6844b0bb16622c6bfce9fbb680ad42549 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent0b3fec6924cad5c9f38941550ab4106972efa5cc (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 Change-Id: I2e320e1fdcc819ab9173277ef3498201432c275f Signed-off-by: Amar Tumballi <> Reviewed-on: CentOS-regression: Gluster Build System <> Smoke: Gluster Build System <> Reviewed-by: Jeff Darcy <> Reviewed-by: Atin Mukherjee <>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 0a0668e..1ada723 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1440,6 +1440,7 @@ static int
brick_graph_add_posix (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
+ char tmpstr[10] = {0,};
int ret = -1;
gf_boolean_t quota_enabled = _gf_true;
gf_boolean_t trash_enabled = _gf_false;
@@ -1491,6 +1492,9 @@ brick_graph_add_posix (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
if (quota_enabled || pgfid_feat || trash_enabled)
xlator_set_option (xl, "update-link-count-parent",
+ snprintf (tmpstr, sizeof (tmpstr), "%d", brickinfo->fs_share_count);
+ ret = xlator_set_option (xl, "shared-brick-count", tmpstr);
return ret;