diff options
author | Niklas Hambüchen <mail@nh2.me> | 2017-02-18 00:49:02 +0100 |
---|---|---|
committer | Jeff Darcy <jdarcy@redhat.com> | 2017-03-07 12:10:02 -0500 |
commit | ce8d8195dc253a87cceaaeeb1a725090471ae4f8 (patch) | |
tree | 87c027440d7a6af44956861b34fec3844d699038 /libglusterfs/src/syscall.h | |
parent | 89c6bedc1c2e978f67ca29f212a357984cd8a2dd (diff) |
posix: use nanosecond accuracy when available
Programs that set mtime, such as `rsync -a`, don't work correctly on
GlusterFS, because it sets the nanoseconds to 000. This creates
problems for incremental backups, where files get accidentally copied
again and again.
For example, consider `myfile` on an ext4 system, being copied to a
GlusterFS volume, with `rsync -a` and then `cp -u` in turn. You'd
expect that after the first `rsync -a`, `cp -u` agrees that the file
need not be copied.
BUG: 1422074
Change-Id: I89c7b6a73e2e06c02851ff76b7e5cdfaa271e985
Signed-off-by: Niklas Hambüchen <mail@nh2.me>
Reviewed-on: https://review.gluster.org/16667
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Jeff Darcy <jdarcy@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/syscall.h')
-rw-r--r-- | libglusterfs/src/syscall.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/syscall.h b/libglusterfs/src/syscall.h index b1bcad138c5..6bb374822ee 100644 --- a/libglusterfs/src/syscall.h +++ b/libglusterfs/src/syscall.h @@ -129,6 +129,12 @@ sys_ftruncate (int fd, off_t length); int sys_utimes (const char *filename, const struct timeval times[2]); +#if defined(HAVE_UTIMENSAT) +int +sys_utimensat (int dirfd, const char *filename, const struct timespec times[2], + int flags); +#endif + int sys_creat (const char *pathname, mode_t mode); |