[SCM] Samba Shared Repository - branch v3-5-test updated
Björn Jacke
bjacke at samba.org
Wed Nov 4 07:55:04 MST 2009
The branch, v3-5-test has been updated
via fedf1a0... s3: add support for full windows timestamps resolution on files
from ba15be4... WHATSNEW: Update release notes
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test
- Log -----------------------------------------------------------------
commit fedf1a052e3e59197c7e18ae0094b5920c6bfc9c
Author: Björn Jacke <bj at sernet.de>
Date: Wed Nov 4 11:15:31 2009 +0100
s3: add support for full windows timestamps resolution on files
setting nanosecond timestamps using utimensat() was first supported by Linux
kernel 2.6.22 and glibc 2.6. It's specified in POSIX.1-2008.
This effectively makes us use Windows' full 100ns timestamp resolution -
actually just an improvement from 10^-6 to 10^-7.
For now Linux CIFS vfs will also just be able to make use of 100ns resolution,
not 1ns.
-----------------------------------------------------------------------
Summary of changes:
source3/configure.in | 1 +
source3/modules/vfs_default.c | 19 +++++++++++++------
2 files changed, 14 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/configure.in b/source3/configure.in
index 790a0f0..819af5c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1016,6 +1016,7 @@ AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
AC_CHECK_FUNCS(syslog vsyslog timegm)
AC_CHECK_FUNCS(setlocale nl_langinfo)
AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)])
+AC_CHECK_FUNCS(utimensat)
AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
AC_CHECK_HEADERS(sys/mman.h)
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 036a438..b40e2ce 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -134,7 +134,9 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
* we might be able to set sub-second timestamps.
* See what filetime set primitives we have.
*/
-#if defined(HAVE_UTIMES)
+#if defined(HAVE_UTIMENSAT)
+ *p_ts_res = TIMESTAMP_SET_NT_OR_BETTER;
+#elif defined(HAVE_UTIMES)
/* utimes allows msec timestamps to be set. */
*p_ts_res = TIMESTAMP_SET_MSEC;
#elif defined(HAVE_UTIME)
@@ -142,10 +144,6 @@ static uint32_t vfswrap_fs_capabilities(struct vfs_handle_struct *handle,
*p_ts_res = TIMESTAMP_SET_SECONDS;
#endif
- /* TODO. Add a configure test for the Linux
- * nsec timestamp set system call, and use it
- * if available....
- */
DEBUG(10,("vfswrap_fs_capabilities: timestamp "
"resolution of %s "
"available on share %s, directory %s\n",
@@ -870,7 +868,16 @@ static int vfswrap_ntimes(vfs_handle_struct *handle,
return 0;
}
-#if defined(HAVE_UTIMES)
+#if defined(HAVE_UTIMENSAT)
+ if (ft != NULL) {
+ struct timespec ts[2];
+ ts[0] = ft->atime;
+ ts[1] = ft->mtime;
+ result = utimensat(AT_FDCWD, smb_fname->base_name, ts, 0);
+ } else {
+ result = utimensat(AT_FDCWD, smb_fname->base_name, NULL, 0);
+ }
+#elif defined(HAVE_UTIMES)
if (ft != NULL) {
struct timeval tv[2];
tv[0] = convert_timespec_to_timeval(ft->atime);
--
Samba Shared Repository
More information about the samba-cvs
mailing list