summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-02-25 16:14:23 +0100
committerStefan Metzmacher <metze@samba.org>2008-02-26 09:29:41 +0100
commit940e86132d365cbc583a96975068918e9a4eb608 (patch)
tree7e5d45e66cdf7c4d2a075093f525e67b08314a5b /source4
parentc749b66ead71af3076d4f911aa0cd65e35284ca4 (diff)
downloadsamba-940e86132d365cbc583a96975068918e9a4eb608.tar.gz
samba-940e86132d365cbc583a96975068918e9a4eb608.tar.bz2
samba-940e86132d365cbc583a96975068918e9a4eb608.zip
opendb_tdb: add force break to none logic
metze (This used to be commit fbfe953ba347a902297bd8eae900ca70efd2db01)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/common/opendb_tdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/ntvfs/common/opendb_tdb.c b/source4/ntvfs/common/opendb_tdb.c
index b445981b57..656e113742 100644
--- a/source4/ntvfs/common/opendb_tdb.c
+++ b/source4/ntvfs/common/opendb_tdb.c
@@ -322,6 +322,7 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck, void *file_handle,
struct opendb_file file;
NTSTATUS status;
uint32_t open_disposition = 0;
+ bool break_to_none = false;
bool attrs_only = false;
if (odb->oplocks == false) {
@@ -349,6 +350,7 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck, void *file_handle,
/* see if anyone has an oplock, which we need to break */
for (i=0;i<file.num_entries;i++) {
if (file.entries[i].oplock_level == OPLOCK_BATCH) {
+ bool oplock_return = OPLOCK_BREAK_TO_LEVEL_II;
/* if this is an attribute only access
* it doesn't conflict with a BACTCH oplock
* but we'll not grant the oplock below
@@ -365,8 +367,11 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck, void *file_handle,
break request and suspending this call
until the break is acknowledged or the file
is closed */
+ if (break_to_none) {
+ oplock_return = OPLOCK_BREAK_TO_NONE;
+ }
odb_oplock_break_send(odb, &file.entries[i],
- OPLOCK_BREAK_TO_LEVEL_II/*TODO*/);
+ oplock_return);
return NT_STATUS_OPLOCK_NOT_GRANTED;
}
}
@@ -391,7 +396,7 @@ static NTSTATUS odb_tdb_open_file(struct odb_lock *lck, void *file_handle,
for (i=0;i<file.num_entries;i++) {
if (file.entries[i].oplock_level == OPLOCK_EXCLUSIVE) {
odb_oplock_break_send(odb, &file.entries[i],
- OPLOCK_BREAK_TO_NONE/*TODO*/);
+ OPLOCK_BREAK_TO_NONE);
return NT_STATUS_OPLOCK_NOT_GRANTED;
}
}