summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-04-03 08:27:44 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-03 22:02:25 +0530
commit8a5005ecf06f23f1607c0ff4111a21c00bd74205 (patch)
treed918103b0efafab231c2f8cff65e38e29c9e9c40 /xlators/cluster/dht/src/dht-common.h
parentf235826215205ac626abb0ad475e7a89f7003da5 (diff)
distribute to take care of available disk space while creating new dirs, and files.
distribute gets awareness about disk-space while creating the files Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r--xlators/cluster/dht/src/dht-common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h
index 0eb57a196c3..b6959d86d14 100644
--- a/xlators/cluster/dht/src/dht-common.h
+++ b/xlators/cluster/dht/src/dht-common.h
@@ -97,6 +97,13 @@ struct dht_local {
};
typedef struct dht_local dht_local_t;
+/* du - disk-usage */
+struct dht_du {
+ double avail_percent;
+ uint64_t avail_space;
+ uint32_t log;
+};
+typedef struct dht_du dht_du_t;
struct dht_conf {
gf_lock_t subvolume_lock;
@@ -109,6 +116,10 @@ struct dht_conf {
dht_layout_t *default_dir_layout;
gf_boolean_t search_unhashed;
int gen;
+ dht_du_t *du_stats;
+ uint32_t min_free_disk;
+ int32_t refresh_interval;
+ struct timeval last_stat_fetch;
};
typedef struct dht_conf dht_conf_t;
@@ -218,4 +229,10 @@ dht_layout_sort_volname (dht_layout_t *layout);
int dht_rename (call_frame_t *frame, xlator_t *this,
loc_t *oldloc, loc_t *newloc);
+
+int dht_get_du_info (call_frame_t *frame, xlator_t *this, loc_t *loc);
+
+int dht_is_subvol_filled (xlator_t *this, xlator_t *subvol);
+xlator_t *dht_free_disk_available_subvol (xlator_t *this, xlator_t *subvol);
+
#endif /* _DHT_H */