[SCM] SAMBA-CTDB repository - branch v3-4-ctdb updated - 3.4.2-ctdb-21-8-g968e731

Michael Adam obnox at samba.org
Fri Feb 12 08:58:02 MST 2010


The branch, v3-4-ctdb has been updated
       via  968e731d7c2b905d816ba283a096195b1a964539 (commit)
       via  073d77818ba702a0eee37715615db46d3b1dce25 (commit)
       via  4610cb0764ba81a0339af60a2dbaeaf16e4713b7 (commit)
       via  5b6b12894fb643d303cbfc4efb5c1d026e4cbd7d (commit)
       via  f3b1f9e83af2276300157de3fbcc90672721d9b1 (commit)
       via  5239e4376a1f725e9a096e221d74aa3d28a8c692 (commit)
       via  2e11163ea55778c7c7c34a12059081b87a970d56 (commit)
       via  b14f7a5de4055c10f0e1a4f97e8ec96994b80104 (commit)
      from  cb39faaa1dd3e70ba61d9e26c0117fa9c46c351a (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-4-ctdb


- Log -----------------------------------------------------------------
commit 968e731d7c2b905d816ba283a096195b1a964539
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Feb 10 10:21:28 2010 +0100

    v3-4-ctdb: Bump ctdb vendor patch level to 22

commit 073d77818ba702a0eee37715615db46d3b1dce25
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 12 12:06:50 2010 +0100

    s3: notify_onelevel does not use seqnums, so don't open asking for it

commit 4610cb0764ba81a0339af60a2dbaeaf16e4713b7
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 5 14:25:03 2010 +1100

    s3-events: make the old timed events compatible with tevent
    
    tevent ensures that a timed event is only called once. The old events
    code relied on the called handler removing the event itself. If the
    handler removed the event after calling a function which invoked the
    event loop then the timed event could loop forever.
    
    This change makes the two timed event systems more compatible, by
    allowing the handler to free the te if it wants to, but ensuring it is
    off the linked list of events before the handler is called, and
    ensuring it is freed even if the handler doesn't free it.

commit 5b6b12894fb643d303cbfc4efb5c1d026e4cbd7d
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 5 12:42:06 2010 +1100

    s3-smbd: add a rate limited cleanup of brl, connections and locking db
    
    On unclean shutdown we can end up with stale entries in the brlock,
    connections and locking db. Previously we would do the cleanup on
    every unclean exit, but that can cause smbd to be completely
    unavailable for several minutes when a large number of child smbd
    processes exit.
    
    This adds a rate limited cleanup of the databases, with the default
    that cleanup happens at most every 20s

commit f3b1f9e83af2276300157de3fbcc90672721d9b1
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Feb 4 18:02:52 2010 +1100

    s3-brlock: we don't need these MSG_SMB_UNLOCK calls now
    
    These have been replaced with the min timeout in blocking.c

commit 5239e4376a1f725e9a096e221d74aa3d28a8c692
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 5 20:59:43 2010 -0800

    s3-brlock: add a minimim retry time for pending blocking locks
    
    When we are waiting on a pending byte range lock, another smbd might
    exit uncleanly, and therefore not notify us of the removal of the
    lock, and thus not trigger the lock to be retried.
    
    We coped with this up to now by adding a message_send_all() in the
    SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
    all smbd processes. That would generate O(N^2) work when a large
    number of clients disconnected at once (such as on a network outage),
    which could leave the whole system unusable for a very long time (many
    minutes, or even longer).
    
    By adding a minimum re-check time for pending byte range locks we
    avoid this problem by ensuring that pending locks are retried at a
    more regular interval.

commit 2e11163ea55778c7c7c34a12059081b87a970d56
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 9 08:00:06 2010 +0100

    packaging(RHEL-CTDB): adapt configure.rpm to match the spec-file configure call
    
    Michael

commit b14f7a5de4055c10f0e1a4f97e8ec96994b80104
Author: Abhidnya P Chirmule <achirmul at in.ibm.com>
Date:   Wed Jan 6 19:45:24 2010 +0100

    s3: Add a vfs_time_audit module
    
    This warns if a file system is slow

-----------------------------------------------------------------------

Summary of changes:
 packaging/RHEL-CTDB/configure.rpm   |    3 +-
 packaging/RHEL-CTDB/samba.spec.tmpl |    1 +
 source3/Makefile.in                 |    5 +
 source3/VERSION                     |    2 +-
 source3/configure.in                |    3 +-
 source3/lib/ctdbd_conn.c            |    7 -
 source3/lib/events.c                |   23 +-
 source3/modules/vfs_time_audit.c    | 2468 +++++++++++++++++++++++++++++++++++
 source3/smbd/blocking.c             |   20 +
 source3/smbd/notify_internal.c      |    2 +-
 source3/smbd/server.c               |   51 +-
 11 files changed, 2564 insertions(+), 21 deletions(-)
 create mode 100644 source3/modules/vfs_time_audit.c


Changeset truncated at 500 lines:

diff --git a/packaging/RHEL-CTDB/configure.rpm b/packaging/RHEL-CTDB/configure.rpm
index 84e7346..61276f8 100755
--- a/packaging/RHEL-CTDB/configure.rpm
+++ b/packaging/RHEL-CTDB/configure.rpm
@@ -30,7 +30,8 @@ CC="$CC" CFLAGS="-Wall -g -D_GNU_SOURCE" ./configure -C \
 	--prefix=${_prefix} \
 	--localstatedir=/var \
 	--with-configdir=${_sysconfdir}/samba \
-	--with-libdir=${_libarchdir}/samba \
+	--libdir=${_libarchdir} \
+	--with-modulesdir=${_libarchdir}/samba \
 	--with-pammodulesdir=/${_libarch}/security \
 	--with-lockdir=/var/lib/samba \
 	--with-logfilebase=/var/log/samba \
diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl
index 4978cfa..6d90176 100644
--- a/packaging/RHEL-CTDB/samba.spec.tmpl
+++ b/packaging/RHEL-CTDB/samba.spec.tmpl
@@ -492,6 +492,7 @@ exit 0
 %{_libarchdir}/samba/vfs/streams_depot.so
 %{_libarchdir}/samba/vfs/streams_xattr.so
 %{_libarchdir}/samba/vfs/syncops.so
+%{_libarchdir}/samba/vfs/time_audit.so
 %{_libarchdir}/samba/vfs/tsmsm.so
 %{_libarchdir}/samba/vfs/xattr_tdb.so
 
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 5795e45..c731406 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -693,6 +693,7 @@ VFS_ONEFS_SHADOW_COPY_OBJ = modules/vfs_onefs_shadow_copy.o modules/onefs_shadow
 PERFCOUNT_ONEFS_OBJ = modules/perfcount_onefs.o
 PERFCOUNT_TEST_OBJ = modules/perfcount_test.o
 VFS_DIRSORT_OBJ = modules/vfs_dirsort.o
+VFS_TIME_AUDIT_OBJ = modules/vfs_time_audit.o
 
 PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
 
@@ -2695,6 +2696,10 @@ bin/dirsort. at SHLIBEXT@: $(BINARY_PREREQS) $(VFS_DIRSORT_OBJ)
 	@echo "Building plugin $@"
 	@$(SHLD_MODULE) $(VFS_DIRSORT_OBJ)
 
+bin/time_audit. at SHLIBEXT@: $(BINARY_PREREQS) $(VFS_TIME_AUDIT_OBJ)
+	@echo "Building plugin $@"
+	@$(SHLD_MODULE) $(VFS_TIME_AUDIT_OBJ)
+
 #########################################################
 ## IdMap NSS plugins
 
diff --git a/source3/VERSION b/source3/VERSION
index 7b8bf5a..ab42fc4 100644
--- a/source3/VERSION
+++ b/source3/VERSION
@@ -85,7 +85,7 @@ SAMBA_VERSION_IS_GIT_SNAPSHOT=no
 #                                                      #
 ########################################################
 SAMBA_VERSION_VENDOR_SUFFIX="ctdb"
-SAMBA_VERSION_VENDOR_PATCH=21
+SAMBA_VERSION_VENDOR_PATCH=22
 
 ########################################################
 # This can be set by vendors if they want..            #
diff --git a/source3/configure.in b/source3/configure.in
index 9ddf1be..5ac18f8 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -429,7 +429,7 @@ dnl These have to be built static:
 default_static_modules="pdb_smbpasswd pdb_tdbsam pdb_wbc_sam rpc_lsarpc rpc_samr rpc_winreg rpc_initshutdown rpc_dssetup rpc_wkssvc rpc_svcctl rpc_ntsvcs rpc_netlogon rpc_netdfs rpc_srvsvc rpc_spoolss rpc_eventlog auth_sam auth_unix auth_winbind auth_wbc auth_server auth_domain auth_builtin auth_netlogond vfs_default nss_info_template"
 
 dnl These are preferably build shared, and static if dlopen() is not available
-default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer vfs_preopen"
+default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_full_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap vfs_expand_msdfs vfs_shadow_copy vfs_shadow_copy2 charset_CP850 charset_CP437 auth_script vfs_readahead vfs_xattr_tdb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer vfs_preopen vfs_time_audit"
 
 if test "x$developer" = xyes; then
    default_static_modules="$default_static_modules rpc_rpcecho"
@@ -6289,6 +6289,7 @@ SMB_MODULE(vfs_smb_traffic_analyzer, \$(VFS_SMB_TRAFFIC_ANALYZER_OBJ), "bin/smb_
 SMB_MODULE(vfs_onefs, \$(VFS_ONEFS), "bin/onefs.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_onefs_shadow_copy, \$(VFS_ONEFS_SHADOW_COPY), "bin/onefs_shadow_copy.$SHLIBEXT", VFS)
 SMB_MODULE(vfs_dirsort, \$(VFS_DIRSORT_OBJ), "bin/dirsort.$SHLIBEXT", VFS)
+SMB_MODULE(vfs_time_audit, \$(VFS_TIME_AUDIT_OBJ), "bin/time_audit.$SHLIBEXT", VFS)
 
 SMB_SUBSYSTEM(VFS,smbd/vfs.o)
 
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index 3983b3d..fbd6395 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -626,13 +626,6 @@ static NTSTATUS ctdb_handle_message(uint8_t *buf, size_t length,
 		messaging_send(conn->msg_ctx, procid_self(),
 			       MSG_SMB_BRL_VALIDATE, &data_blob_null);
 
-		/*
-		 * it's possible that we have just rejoined the cluster after
-		 * an outage. In that case our pending locks could have been
-		 * removed from the lockdb, so retry them once more
-		 */
-		message_send_all(conn->msg_ctx, MSG_SMB_UNLOCK, NULL, 0, NULL);
-
 		messaging_send(conn->msg_ctx, procid_self(),
 			       MSG_DBWRAP_G_LOCK_RETRY,
 			       &data_blob_null);
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 90d86c6..d285980 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -100,12 +100,29 @@ bool run_events(struct tevent_context *ev,
 
 	if ((ev->timer_events != NULL)
 	    && (timeval_compare(&now, &ev->timer_events->next_event) >= 0)) {
-
+		struct tevent_timer *te = ev->timer_events;
+		TALLOC_CTX *tmp_ctx;
 		DEBUG(10, ("Running timed event \"%s\" %p\n",
 			   ev->timer_events->handler_name, ev->timer_events));
 
-		ev->timer_events->handler(ev, ev->timer_events, now,
-					  ev->timer_events->private_data);
+
+		/* this older events system did not auto-free timed
+		   events on running them, and had a race condition
+		   where the event could be called twice if the
+		   talloc_free of the te happened after the callback
+		   made a call which invoked the event loop. To avoid
+		   this while still allowing old code which frees the
+		   te, we need to create a temporary context which
+		   will be used to ensure the te is freed. We also
+		   remove the te from the timed event list before we
+		   call the handler, to ensure we can't loop */
+		DLIST_REMOVE(ev->timer_events, te);
+		tmp_ctx = talloc_new(ev);
+		talloc_steal(tmp_ctx, te);
+
+		te->handler(ev, te, now, te->private_data);
+
+		talloc_free(tmp_ctx);
 		return true;
 	}
 
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
new file mode 100644
index 0000000..fb22c19
--- /dev/null
+++ b/source3/modules/vfs_time_audit.c
@@ -0,0 +1,2468 @@
+/*
+ * Time auditing VFS module for samba.  Log time taken for VFS call to syslog
+ * facility.
+ *
+ * Copyright (C) Abhidnya Chirmule <achirmul at in.ibm.com> 2009
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * This module implements logging for time taken for all Samba VFS operations.
+ *
+ * vfs objects = time_audit
+ */
+
+
+#include "includes.h"
+
+#undef DBGC_CLASS
+#define DBGC_CLASS DBGC_VFS
+
+static double audit_timeout;
+
+static int smb_time_audit_connect(vfs_handle_struct *handle,
+				  const char *svc, const char *user)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	if (!handle) {
+		return -1;
+	}
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_CONNECT(handle, svc, user);
+	timediff = timeval_elapsed(&tv);
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("connect: Took %.2f seconds\n", timediff));
+	}
+	return result;
+}
+
+static void smb_time_audit_disconnect(vfs_handle_struct *handle)
+{
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	SMB_VFS_NEXT_DISCONNECT(handle);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("disconnect: Took %.2f seconds\n", timediff));
+	}
+
+	return;
+}
+
+static uint64_t smb_time_audit_disk_free(vfs_handle_struct *handle,
+					 const char *path,
+					 bool small_query, uint64_t *bsize,
+					 uint64_t *dfree, uint64_t *dsize)
+{
+	uint64_t result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
+					dfree, dsize);
+	timediff = timeval_elapsed(&tv);
+
+	/* Don't have a reasonable notion of failure here */
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("disk_free: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_get_quota(struct vfs_handle_struct *handle,
+				    enum SMB_QUOTA_TYPE qtype, unid_t id,
+				    SMB_DISK_QUOTA *qt)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("get_quota: Took %.2f seconds\n", timediff));
+	}
+	return result;
+}
+
+static int smb_time_audit_set_quota(struct vfs_handle_struct *handle,
+				    enum SMB_QUOTA_TYPE qtype, unid_t id,
+				    SMB_DISK_QUOTA *qt)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("set_quota: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
+					       struct files_struct *fsp,
+					       SHADOW_COPY_DATA *shadow_copy_data,
+					       bool labels)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp,
+						   shadow_copy_data, labels);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("get_shadow_copy_data: Took %.2f seconds\n",
+			  timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_statvfs(struct vfs_handle_struct *handle,
+				  const char *path,
+				  struct vfs_statvfs_struct *statbuf)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("statvfs: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_fs_capabilities(struct vfs_handle_struct *handle)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_FS_CAPABILITIES(handle);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("fs_capabilities: Took %.2f seconds\n",
+			  timediff));
+	}
+
+	return result;
+}
+
+static SMB_STRUCT_DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
+					      const char *fname,
+					      const char *mask, uint32 attr)
+{
+	SMB_STRUCT_DIR *result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("opendir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static SMB_STRUCT_DIRENT *smb_time_audit_readdir(vfs_handle_struct *handle,
+						 SMB_STRUCT_DIR *dirp,
+						 SMB_STRUCT_STAT *sbuf)
+{
+	SMB_STRUCT_DIRENT *result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("readdir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static void smb_time_audit_seekdir(vfs_handle_struct *handle,
+				   SMB_STRUCT_DIR *dirp, long offset)
+{
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("seekdir: Took %.2f seconds\n", timediff));
+	}
+
+	return;
+}
+
+static long smb_time_audit_telldir(vfs_handle_struct *handle,
+				   SMB_STRUCT_DIR *dirp)
+{
+	long result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_TELLDIR(handle, dirp);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("telldir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static void smb_time_audit_rewinddir(vfs_handle_struct *handle,
+				     SMB_STRUCT_DIR *dirp)
+{
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	SMB_VFS_NEXT_REWINDDIR(handle, dirp);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("rewinddir: Took %.2f seconds\n", timediff));
+	}
+
+	return;
+}
+
+static int smb_time_audit_mkdir(vfs_handle_struct *handle,
+				const char *path, mode_t mode)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_MKDIR(handle, path, mode);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("mkdir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_rmdir(vfs_handle_struct *handle,
+				const char *path)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_RMDIR(handle, path);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("rmdir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static int smb_time_audit_closedir(vfs_handle_struct *handle,
+				   SMB_STRUCT_DIR *dirp)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	result = SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("closedir: Took %.2f seconds\n", timediff));
+	}
+
+	return result;
+}
+
+static void smb_time_audit_init_search_op(vfs_handle_struct *handle,
+					  SMB_STRUCT_DIR *dirp)
+{
+	struct timeval tv;
+	double timediff;
+
+	GetTimeOfDay(&tv);
+	SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
+	timediff = timeval_elapsed(&tv);
+
+	if (timediff > audit_timeout) {
+		DEBUG(0, ("init_search_op: Took %.2f seconds\n", timediff));
+	}
+	return;
+}
+
+static int smb_time_audit_open(vfs_handle_struct *handle,
+			       const char *fname, files_struct *fsp,
+			       int flags, mode_t mode)
+{
+	int result;
+	struct timeval tv;
+	double timediff;
+


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list