summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.h
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2016-05-25 13:54:13 -0400
committerDan Lambright <dlambrig@redhat.com>2016-07-27 06:03:48 -0700
commit64ae3907818ad3cdaed1a1454cb44f684c9fcffd (patch)
treebd6a746f5a48c0463e981b2fd225bbc1956a5ddb /xlators/cluster/dht/src/dht-common.h
parentdbc8dac5c357a28aeba17894f8b02faa2af2a792 (diff)
cluster/tier: fix statfs for dht/tiered volumes
Return the correct size of the tiered volume in statfs. It should be the size of the cold tier, not the sum of the hot and cold tier, because the hot tier is a cache and not an extension of the volume's capacity. The number of free blocks, etc is the cold tier's capacity subtracted by the sum of utilization on the hot and cold tiers. Note if both tiers are part of the same file system this must be accounted for as well. The patch also fixes a pre-existing bug in the DHT/tier translators. If statfs was taken on a file, the code only calculated free space on the cached subvolume, not all subvolumes in the replica group. With the fix, this is corrected, except in the case where quota is used with the deem-statfs option set to "on". Change-Id: I2b8bcb4511edf83f12130960aad0a609fcf8f513 BUG: 1339689 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/14536 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r--xlators/cluster/dht/src/dht-common.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 9a71c46c8e4..080e98594ec 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -177,6 +177,19 @@ typedef
gf_boolean_t (*dht_need_heal_t)(call_frame_t *frame, dht_layout_t **inmem,
dht_layout_t **ondisk);
+typedef struct {
+ uint64_t blocks_used;
+ uint64_t pblocks_used;
+ uint64_t files_used;
+ uint64_t pfiles_used;
+ uint64_t unhashed_blocks_used;
+ uint64_t unhashed_pblocks_used;
+ uint64_t unhashed_files_used;
+ uint64_t unhashed_pfiles_used;
+ uint64_t unhashed_fsid;
+ uint64_t hashed_fsid;
+} tier_statvfs_t;
+
struct dht_local {
int call_cnt;
loc_t loc;
@@ -193,6 +206,7 @@ struct dht_local {
struct iatt preparent;
struct iatt postparent;
struct statvfs statvfs;
+ tier_statvfs_t tier_statvfs;
fd_t *fd;
inode_t *inode;
dict_t *params;
@@ -1229,4 +1243,8 @@ dht_get_lock_subvolume (xlator_t *this, struct gf_flock *lock,
int
dht_lk_inode_unref (call_frame_t *frame, int32_t op_ret);
+void
+dht_normalize_stats (struct statvfs *buf, unsigned long bsize,
+ unsigned long frsize);
+
#endif/* _DHT_H */