svn commit: samba r2573 - in branches/SAMBA_4_0/source/ntvfs: . posix

tridge at samba.org tridge at samba.org
Fri Sep 24 00:44:42 GMT 2004


Author: tridge
Date: 2004-09-24 00:44:42 +0000 (Fri, 24 Sep 2004)
New Revision: 2573

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ntvfs&rev=2573&nolog=1

Log:
- added a configure test for nanosecond time resolution in struct stat
  (recently Linux systems support this, allowing us to support the
  full resolution in NTTIME)

- use nanosecond resolution in the posix backend if available

- moved the configure tests and list of object files for the posix
  backend into ntvfs/posix/ to keep them more neatlly separated.

Added:
   branches/SAMBA_4_0/source/ntvfs/posix/config.m4
   branches/SAMBA_4_0/source/ntvfs/posix/config.mk
Modified:
   branches/SAMBA_4_0/source/ntvfs/config.m4
   branches/SAMBA_4_0/source/ntvfs/config.mk
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_fileinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/config.m4
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/config.m4	2004-09-24 00:42:20 UTC (rev 2572)
+++ branches/SAMBA_4_0/source/ntvfs/config.m4	2004-09-24 00:44:42 UTC (rev 2573)
@@ -1,5 +1,8 @@
 dnl # NTVFS Server subsystem
 
+SMB_INCLUDE_M4(ntvfs/posix/config.m4)
+SMB_MODULE_MK(ntvfs_posix, NTVFS, STATIC, ntvfs/posix/config.mk)
+
 SMB_MODULE_MK(ntvfs_cifs, NTVFS, STATIC, ntvfs/config.mk)
 
 SMB_MODULE_MK(ntvfs_simple, NTVFS, STATIC, ntvfs/config.mk)
@@ -8,8 +11,6 @@
 
 SMB_MODULE_MK(ntvfs_ipc, NTVFS, STATIC, ntvfs/config.mk)
 
-SMB_MODULE_MK(ntvfs_posix, NTVFS, STATIC, ntvfs/config.mk)
-
 SMB_MODULE_MK(ntvfs_nbench, NTVFS, STATIC, ntvfs/config.mk)
 
 SMB_SUBSYSTEM_MK(NTVFS,ntvfs/config.mk)

Modified: branches/SAMBA_4_0/source/ntvfs/config.mk
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/config.mk	2004-09-24 00:42:20 UTC (rev 2572)
+++ branches/SAMBA_4_0/source/ntvfs/config.mk	2004-09-24 00:44:42 UTC (rev 2573)
@@ -35,34 +35,11 @@
 		ntvfs/ipc/vfs_ipc.o \
 		ntvfs/ipc/ipc_rap.o \
 		ntvfs/ipc/rap_server.o
-
 # End MODULE ntvfs_ipc
 ################################################
 
-################################################
-# Start MODULE ntvfs_posix
-[MODULE::ntvfs_posix]
-INIT_OBJ_FILES = \
-		ntvfs/posix/vfs_posix.o
-ADD_OBJ_FILES = \
-		ntvfs/posix/pvfs_util.o \
-		ntvfs/posix/pvfs_search.o \
-		ntvfs/posix/pvfs_dirlist.o \
-		ntvfs/posix/pvfs_fileinfo.o \
-		ntvfs/posix/pvfs_unlink.o \
-		ntvfs/posix/pvfs_mkdir.o \
-		ntvfs/posix/pvfs_open.o \
-		ntvfs/posix/pvfs_read.o \
-		ntvfs/posix/pvfs_write.o \
-		ntvfs/posix/pvfs_fsinfo.o \
-		ntvfs/posix/pvfs_qfileinfo.o \
-		ntvfs/posix/pvfs_setfileinfo.o \
-		ntvfs/posix/pvfs_rename.o \
-		ntvfs/posix/pvfs_resolve.o \
-		ntvfs/posix/pvfs_shortname.o
-# End MODULE ntvfs_posix
-################################################
 
+
 ################################################
 # Start MODULE ntvfs_nbench
 [MODULE::ntvfs_nbench]

Added: branches/SAMBA_4_0/source/ntvfs/posix/config.m4
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/config.m4	2004-09-24 00:42:20 UTC (rev 2572)
+++ branches/SAMBA_4_0/source/ntvfs/posix/config.m4	2004-09-24 00:44:42 UTC (rev 2573)
@@ -0,0 +1,23 @@
+SMB_MODULE_MK(ntvfs_posix, NTVFS, STATIC, ntvfs/config.mk)
+
+
+dnl #############################################
+dnl see if we have nanosecond resolution for stat
+AC_CACHE_CHECK([for tv_nsec nanosecond fields in struct stat],ac_cv_have_stat_tv_nsec,[
+AC_TRY_COMPILE(
+[
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+],
+[struct stat st; 
+ st.st_mtim.tv_nsec;
+ st.st_atim.tv_nsec;
+ st.st_ctim.tv_nsec;
+],
+ac_cv_decl_have_stat_tv_nsec=yes,
+ac_cv_decl_have_stat_tv_nsec=no)
+])
+if test x"$ac_cv_decl_have_stat_tv_nsec" = x"yes"; then
+   AC_DEFINE(HAVE_STAT_TV_NSEC,1,[Whether stat has tv_nsec nanosecond fields])
+fi

Added: branches/SAMBA_4_0/source/ntvfs/posix/config.mk
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/config.mk	2004-09-24 00:42:20 UTC (rev 2572)
+++ branches/SAMBA_4_0/source/ntvfs/posix/config.mk	2004-09-24 00:44:42 UTC (rev 2573)
@@ -0,0 +1,23 @@
+################################################
+# Start MODULE ntvfs_posix
+[MODULE::ntvfs_posix]
+INIT_OBJ_FILES = \
+		ntvfs/posix/vfs_posix.o
+ADD_OBJ_FILES = \
+		ntvfs/posix/pvfs_util.o \
+		ntvfs/posix/pvfs_search.o \
+		ntvfs/posix/pvfs_dirlist.o \
+		ntvfs/posix/pvfs_fileinfo.o \
+		ntvfs/posix/pvfs_unlink.o \
+		ntvfs/posix/pvfs_mkdir.o \
+		ntvfs/posix/pvfs_open.o \
+		ntvfs/posix/pvfs_read.o \
+		ntvfs/posix/pvfs_write.o \
+		ntvfs/posix/pvfs_fsinfo.o \
+		ntvfs/posix/pvfs_qfileinfo.o \
+		ntvfs/posix/pvfs_setfileinfo.o \
+		ntvfs/posix/pvfs_rename.o \
+		ntvfs/posix/pvfs_resolve.o \
+		ntvfs/posix/pvfs_shortname.o
+# End MODULE ntvfs_posix
+################################################

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_fileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_fileinfo.c	2004-09-24 00:42:20 UTC (rev 2572)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_fileinfo.c	2004-09-24 00:44:42 UTC (rev 2573)
@@ -139,6 +139,12 @@
 	unix_to_nt_time(&name->dos.access_time, name->st.st_atime);
 	unix_to_nt_time(&name->dos.write_time, name->st.st_mtime);
 	unix_to_nt_time(&name->dos.change_time, name->st.st_mtime);
+#ifdef HAVE_STAT_TV_NSEC
+	name->dos.create_time += name->st.st_ctim.tv_nsec / 100;
+	name->dos.access_time += name->st.st_atim.tv_nsec / 100;
+	name->dos.write_time  += name->st.st_mtim.tv_nsec / 100;
+	name->dos.change_time += name->st.st_mtim.tv_nsec / 100;
+#endif
 	name->dos.attrib = dos_mode_from_stat(pvfs, &name->st);
 	name->dos.alloc_size = name->st.st_size;
 	name->dos.nlink = name->st.st_nlink;



More information about the samba-cvs mailing list