diff options
author | krishna <ksriniva@redhat.com> | 2012-02-09 12:08:07 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2012-02-09 07:58:56 -0800 |
commit | b71c572df106f33cda0e4b90f174f6426f598741 (patch) | |
tree | 0d89bc2192e39b034d2880730c525a7015d25d64 /xlators/nfs | |
parent | f47558fc72bcb6d786b117061add384f9f6aa6d5 (diff) |
support for nano second resolution for mtime,ctime,atime attributes.
Change-Id: Id5078f270d0fec280b53d4aa7b16bbaf42a2df05
BUG: 784095
Signed-off-by: krishna <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/2730
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r-- | xlators/nfs/server/src/nfs3-helpers.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c index 5b0daed8253..7075b3e6cde 100644 --- a/xlators/nfs/server/src/nfs3-helpers.c +++ b/xlators/nfs/server/src/nfs3-helpers.c @@ -346,25 +346,15 @@ nfs3_stat_to_fattr3 (struct iatt *buf) fa.fsid = buf->ia_dev; fa.fileid = nfs3_iatt_gfid_to_ino (buf); - /* FIXME: Handle time resolutions for sub-second granularity */ - if (buf->ia_atime == 9669) { - fa.mtime.seconds = 0; - fa.mtime.nseconds = 0; - fa.atime.seconds = 0; - fa.atime.nseconds = 0; - } else { - fa.mtime.seconds = buf->ia_mtime; - fa.mtime.nseconds = 0; - fa.atime.seconds = buf->ia_atime; - fa.atime.seconds = 0; - fa.atime.nseconds = 0; - } fa.atime.seconds = buf->ia_atime; - fa.atime.nseconds = 0; + fa.atime.nseconds = buf->ia_atime_nsec; fa.ctime.seconds = buf->ia_ctime; - fa.ctime.nseconds = 0; + fa.ctime.nseconds = buf->ia_ctime_nsec; + + fa.mtime.seconds = buf->ia_mtime; + fa.mtime.nseconds = buf->ia_mtime_nsec; return fa; } @@ -408,11 +398,10 @@ nfs3_stat_to_pre_op_attr (struct iatt *pre) poa.attributes_follow = TRUE; poa.pre_op_attr_u.attributes.size = pre->ia_size; - if (pre->ia_atime == 9669) - poa.pre_op_attr_u.attributes.mtime.seconds = 0; - else - poa.pre_op_attr_u.attributes.mtime.seconds = pre->ia_mtime; + poa.pre_op_attr_u.attributes.mtime.seconds = pre->ia_mtime; + poa.pre_op_attr_u.attributes.mtime.nseconds = pre->ia_mtime_nsec; poa.pre_op_attr_u.attributes.ctime.seconds = pre->ia_ctime; + poa.pre_op_attr_u.attributes.ctime.nseconds = pre->ia_ctime_nsec; out: return poa; |