diff options
author | Amar Tumballi <amar@gluster.com> | 2011-09-14 09:02:01 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-19 23:49:10 -0700 |
commit | cb2c6982bd6d588a91fa2827f95f0d9cf3ff2560 (patch) | |
tree | d82ac0af25d70e5bc4dbf464e0f742c08ab9f543 /xlators/cluster/dht/src/dht-common.h | |
parent | b5b0bb056391659802099908f4bccde5afdb9e34 (diff) |
cluster/distribute: minor fixes in open file migration
* incorporated Avati's comments on the first patch.
* send proper stat information while unwinding
Change-Id: I36982cec610753c241c372272620ab2bd581fd9f
BUG: 3071
Reviewed-on: http://review.gluster.com/408
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.h')
-rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 3545c0f995c..97a2bd016a0 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -244,6 +244,22 @@ typedef struct dht_disk_layout dht_disk_layout_t; ((st_mode_from_ia (s->ia_prot, s->ia_type) & ~S_IFMT) \ == DHT_LINKFILE_MODE)) +#define IS_DHT_MIGRATION_PHASE2(buf) ( \ + IA_ISREG ((buf)->ia_type) && \ + ((st_mode_from_ia ((buf)->ia_prot, (buf)->ia_type) & \ + ~S_IFMT) == DHT_LINKFILE_MODE)) + +#define IS_DHT_MIGRATION_PHASE1(buf) ( \ + IA_ISREG ((buf)->ia_type) && \ + ((buf)->ia_prot.sticky == 1) && \ + ((buf)->ia_prot.sgid == 1)) + +#define DHT_STRIP_PHASE1_FLAGS(buf) do { \ + if (IS_DHT_MIGRATION_PHASE1(buf)) { \ + (buf)->ia_prot.sticky = 0; \ + (buf)->ia_prot.sgid = 0; \ + } \ + } while (0) #define check_is_dir(i,s,x) (IA_ISDIR(s->ia_type)) |