summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-04-07 09:27:22 +0200
committerStefan Metzmacher <metze@samba.org>2008-04-07 12:29:31 +0200
commit206e7eeb6fb5491155ac4b54e13b7b81ae6c29a0 (patch)
tree6eda07fd706cd8bbb3f7fd13d7f777d400d2ace5 /source3
parent19f49de92e176495f3e0640502d4a330eacbf59e (diff)
downloadsamba-206e7eeb6fb5491155ac4b54e13b7b81ae6c29a0.tar.gz
samba-206e7eeb6fb5491155ac4b54e13b7b81ae6c29a0.tar.bz2
samba-206e7eeb6fb5491155ac4b54e13b7b81ae6c29a0.zip
smbd: make it possible to change the write time delay for testing
metze (This used to be commit df8c100c2b53575a0d425a2daf52e2d59904746a)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/local.h3
-rw-r--r--source3/smbd/fileio.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/source3/include/local.h b/source3/include/local.h
index 6d32f4fe6e..c125ded371 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -233,6 +233,9 @@
/* Number of microseconds to wait before a sharing violation. */
#define SHARING_VIOLATION_USEC_WAIT 950000
+/* Number of microseconds to wait before a updating the write time (2 secs). */
+#define WRITE_TIME_UPDATE_USEC_DELAY 2000000
+
#define MAX_LDAP_REPLICATION_SLEEP_TIME 5000 /* In milliseconds. */
/* tdb hash size for the open database. */
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 93a303f6c8..64cea7f7ce 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -188,6 +188,8 @@ static void update_write_time_handler(struct event_context *ctx,
void trigger_write_time_update(struct files_struct *fsp)
{
+ int delay;
+
if (fsp->write_time_forced) {
return;
}
@@ -197,11 +199,15 @@ void trigger_write_time_update(struct files_struct *fsp)
}
fsp->update_write_time_triggered = true;
+ delay = lp_parm_int(SNUM(fsp->conn),
+ "smbd", "writetimeupdatedelay",
+ WRITE_TIME_UPDATE_USEC_DELAY);
+
/* trigger the update 2 seconds later */
fsp->update_write_time_on_close = true;
fsp->update_write_time_event =
event_add_timed(smbd_event_context(), NULL,
- timeval_current_ofs(2, 0),
+ timeval_current_ofs(0, delay),
"update_write_time_handler",
update_write_time_handler, fsp);
}