summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/protocol.h
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-04-08 14:07:00 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-04-08 12:57:06 -0700
commit28818a5371e306a5cc0970f359aa5f20c8769794 (patch)
tree4e97d152254b0ac98228d01c2b06385433e8912d /libglusterfs/src/protocol.h
parent7ef3c9773015d1c77ba23a482eeaa25e2ff31328 (diff)
protocol: fix endianness for nanosecond field in stat structure
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 801 (Direct io-mode support and related changes in caching translators.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=801
Diffstat (limited to 'libglusterfs/src/protocol.h')
-rw-r--r--libglusterfs/src/protocol.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libglusterfs/src/protocol.h b/libglusterfs/src/protocol.h
index f8e03da2708..592d0a4f440 100644
--- a/libglusterfs/src/protocol.h
+++ b/libglusterfs/src/protocol.h
@@ -78,7 +78,9 @@ gf_stat_to_stat (struct gf_stat *gf_stat, struct stat *stat)
stat->st_atime = ntoh32 (gf_stat->atime);
stat->st_mtime = ntoh32 (gf_stat->mtime);
stat->st_ctime = ntoh32 (gf_stat->ctime);
- /* TODO: handle nsec */
+ ST_ATIM_NSEC_SET(stat, ntoh32 (gf_stat->atime_nsec));
+ ST_MTIM_NSEC_SET(stat, ntoh32 (gf_stat->mtime_nsec));
+ ST_CTIM_NSEC_SET(stat, ntoh32 (gf_stat->ctime_nsec));
}
@@ -98,7 +100,9 @@ gf_stat_from_stat (struct gf_stat *gf_stat, struct stat *stat)
gf_stat->atime = hton32 (stat->st_atime);
gf_stat->mtime = hton32 (stat->st_mtime);
gf_stat->ctime = hton32 (stat->st_ctime);
- /* TODO: handle nsec */
+ gf_stat->atime_nsec = hton32 (ST_ATIM_NSEC(stat));
+ gf_stat->mtime_nsec = hton32 (ST_MTIM_NSEC(stat));
+ gf_stat->ctime_nsec = hton32 (ST_CTIM_NSEC(stat));
}