summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-09-17 16:45:03 -0700
committerAnand Avati <avati@redhat.com>2013-09-17 17:45:25 -0700
commitde2a8d303311bd600cb93a775bc79a0edea1ee1a (patch)
tree4ab50c4c877819c8ac46a637f6842faa73ff5c50 /xlators/cluster/dht/src
parent215fea41a96479312a5ab8783c13b30ab9fe00fa (diff)
Revert "cluster/distribute: Rebalance should also verify free inodes"
This reverts commit 215fea41a96479312a5ab8783c13b30ab9fe00fa Realized soon after merging, that this patch is actually useless. Checking for inode utilization on dst relative to src is of no use because dst is already storing linkfile and inode is already consumed no matter what. We might as well perform the rebalance and save on an inode on the src node. Change-Id: I7b8b8d35d9063a710e1bee1c7c6c7739fcc45ad4 Reviewed-on: http://review.gluster.org/5960 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index c6a8e417721..5300ff2fe7a 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -332,8 +332,8 @@ out:
}
static inline int
-__dht_check_free_space_and_inodes (xlator_t *to, xlator_t *from, loc_t *loc,
- struct iatt *stbuf, int flag)
+__dht_check_free_space (xlator_t *to, xlator_t *from, loc_t *loc,
+ struct iatt *stbuf, int flag)
{
struct statvfs src_statfs = {0,};
struct statvfs dst_statfs = {0,};
@@ -379,27 +379,9 @@ __dht_check_free_space_and_inodes (xlator_t *to, xlator_t *from, loc_t *loc,
goto out;
}
- /* NOTE:
- For dynamically allocated inode filesystems since we have no
- awareness on inodes, this logic fits well so that distribute
- rebalance has nothing to worry about total inodes rather let the
- files be `rebalanced` on the basis of hashing.
- */
- if (dst_statfs.f_files && src_statfs.f_files) {
- if (dst_statfs.f_ffree < src_statfs.f_ffree) {
- gf_log (this->name, GF_LOG_WARNING,
- "data movement attempted from node (%s) with"
- " plenty free inodes to a node (%s) with "
- "scanty free inodes (%s)",
- from->name, to->name, loc->path);
- ret = 1;
- goto out;
- }
- }
-
check_avail_space:
if (((dst_statfs.f_bavail * dst_statfs.f_bsize) /
- GF_DISK_SECTOR_SIZE) < stbuf->ia_blocks) {
+ GF_DISK_SECTOR_SIZE) < stbuf->ia_blocks) {
gf_log (this->name, GF_LOG_ERROR,
"data movement attempted from node (%s) with "
"to node (%s) which does not have required free space"
@@ -407,6 +389,7 @@ check_avail_space:
ret = 1;
goto out;
}
+
ret = 0;
out:
return ret;
@@ -731,7 +714,7 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
if (ret)
goto out;
- ret = __dht_check_free_space_and_inodes (to, from, loc, &stbuf, flag);
+ ret = __dht_check_free_space (to, from, loc, &stbuf, flag);
if (ret) {
goto out;
}