cluster/tier: add watermarks and policy driver
[obnox/glusterfs.git] / xlators / cluster / dht / src / dht-rebalance.c
index c53c7a998829de63cc0f7c29ff48b0d73dac5030..7dc89d8a069b06c1b7135c6c42ee7e034b13edee 100644 (file)
@@ -1326,6 +1326,14 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
                 }
         }
 
+        /* store size of previous migrated file  */
+        if (defrag->tier_conf.is_tier) {
+                if (from == conf->subvolumes[0]) {
+                        defrag->tier_conf.st_last_promoted_size = stbuf.ia_size;
+                } else {
+                        defrag->tier_conf.st_last_demoted_size = stbuf.ia_size;
+                }
+        }
 
         /* The src file is being unlinked after this so we don't need
            to clean it up */