diff options
| author | krishna <ksriniva@redhat.com> | 2012-02-09 12:08:07 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2012-02-08 22:51:40 -0800 | 
| commit | fa580e9299e09562c395bd464f3a1cf8a1116d6e (patch) | |
| tree | 017e31bca8a988130c15b95e0be1ad88c4bf7555 /xlators/cluster/dht/src/dht-helper.c | |
| parent | 2741c0a27e23e908fe77a6c14695cbee879accd5 (diff) | |
support for nano second resolution for mtime,ctime,atime attributes.v3.2.6qa2
Change-Id: Id5078f270d0fec280b53d4aa7b16bbaf42a2df05
BUG: 784095
Signed-off-by: krishna <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/2729
Reviewed-by: Anand Avati <avati@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-helper.c')
| -rw-r--r-- | xlators/cluster/dht/src/dht-helper.c | 18 | 
1 files changed, 15 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 8c4926db534..75fb7bcebc6 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -428,6 +428,15 @@ out:                          (a) = (b);              \          } while (0) + +#define set_if_greater_time(a, an, b, bn) do {                          \ +                if (((a) < (b)) || (((a) == (b)) && ((an) < (bn)))){    \ +                        (a) = (b);                                      \ +                        (an) = (bn);                                    \ +                }                                                       \ +        } while (0)                                                     \ + +  int  dht_iatt_merge (xlator_t *this, struct iatt *to,                  struct iatt *from, xlator_t *subvol) @@ -452,9 +461,12 @@ dht_iatt_merge (xlator_t *this, struct iatt *to,          set_if_greater (to->ia_uid, from->ia_uid);          set_if_greater (to->ia_gid, from->ia_gid); -        set_if_greater (to->ia_atime, from->ia_atime); -        set_if_greater (to->ia_mtime, from->ia_mtime); -        set_if_greater (to->ia_ctime, from->ia_ctime); +        set_if_greater_time(to->ia_atime, to->ia_atime_nsec, +                            from->ia_atime, from->ia_atime_nsec); +        set_if_greater_time (to->ia_mtime, to->ia_mtime_nsec, +                             from->ia_mtime, from->ia_mtime_nsec); +        set_if_greater_time (to->ia_ctime, to->ia_ctime_nsec, +                             from->ia_ctime, from->ia_ctime_nsec);          return 0;  }  | 
