summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/posix')
-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;
};