summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-04 13:27:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:29 -0500
commitb2617daeb658af9959ea71432d87fa4273b7f1a4 (patch)
treedc909705ac11fdcffb4804931d8da791fc808c40
parent39cd0639e9007bfd8b896b335aea50ace8631112 (diff)
downloadsamba-b2617daeb658af9959ea71432d87fa4273b7f1a4.tar.gz
samba-b2617daeb658af9959ea71432d87fa4273b7f1a4.tar.bz2
samba-b2617daeb658af9959ea71432d87fa4273b7f1a4.zip
r3532: make sharing violation delay in pvfs configurable with "posix:sharedelay = usecs"
(This used to be commit c4758776491e5ed9f5b8c387226d1e75bc70eb2e)
-rw-r--r--source4/ntvfs/posix/pvfs_open.c4
-rw-r--r--source4/ntvfs/posix/vfs_posix.c7
-rw-r--r--source4/ntvfs/posix/vfs_posix.h3
3 files changed, 11 insertions, 3 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index 2c0f55cf22..06191cee0a 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -34,8 +34,6 @@
#define PVFS_MIN_NEW_FNUM 0x200
#define PVFS_MIN_DIR_FNUM 0x300
-#define SHARING_VIOLATION_DELAY 1000000
-
/*
find open file handle given fnum
*/
@@ -540,7 +538,7 @@ static NTSTATUS pvfs_open_setup_retry(struct smbsrv_request *req,
r->io = io;
r->f = f;
r->req = req;
- r->end_time = timeval_current_ofs(0, SHARING_VIOLATION_DELAY);
+ r->end_time = timeval_current_ofs(0, pvfs->sharing_violation_delay);
r->open_flags = open_flags;
/* setup a pending lock */
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index 9ad1d3cb35..2f0f38dd22 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -34,6 +34,7 @@
static void pvfs_setup_options(struct pvfs_state *pvfs)
{
int snum = pvfs->tcon->service;
+ int delay;
if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN;
if (lp_map_archive(snum)) pvfs->flags |= PVFS_FLAG_MAP_ARCHIVE;
@@ -43,6 +44,12 @@ static void pvfs_setup_options(struct pvfs_state *pvfs)
if (lp_strict_locking(snum)) pvfs->flags |= PVFS_FLAG_STRICT_LOCKING;
if (lp_ci_filesystem(snum)) pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM;
+ pvfs->sharing_violation_delay = 1000000;
+ delay = lp_parm_int(snum, "posix", "sharedelay");
+ if (delay != -1) {
+ pvfs->sharing_violation_delay = delay;
+ }
+
pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum));
}
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index ce6e7ad24d..e0d8e7fe37 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -50,6 +50,9 @@ struct pvfs_state {
/* a list of pending async requests. Needed to support
ntcancel */
struct pvfs_wait *wait_list;
+
+ /* the sharing violation timeout */
+ uint_t sharing_violation_delay;
};