summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-04-17 09:36:09 +0200
committerAndrew Tridgell <tridge@samba.org>2008-04-17 09:36:09 +0200
commit30b9c37420100c98df1a538673d508e46517accf (patch)
tree33ccf13461371c1281a0fc707e66a814a3bc88e9 /source4/ntvfs
parent4bbaf36f6fd85c9d07a16320ad58d7a6ad43fd6c (diff)
parentbaad7a7e56e2b0f24885e01672cd9bdc6667a6a8 (diff)
downloadsamba-30b9c37420100c98df1a538673d508e46517accf.tar.gz
samba-30b9c37420100c98df1a538673d508e46517accf.tar.bz2
samba-30b9c37420100c98df1a538673d508e46517accf.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
Conflicts: source/ntvfs/ntvfs_generic.c (This used to be commit a626a9c69cb2c07c8de69dcfe45361f86d6de58d)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/ntvfs_generic.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c
index 01c3a16433..5d4bbf388c 100644
--- a/source4/ntvfs/ntvfs_generic.c
+++ b/source4/ntvfs/ntvfs_generic.c
@@ -208,7 +208,20 @@ static NTSTATUS ntvfs_map_open_finish(struct ntvfs_module_context *ntvfs,
case RAW_OPEN_SMB2:
io->smb2.out.file.ntvfs = io2->generic.out.file.ntvfs;
- io->smb2.out.oplock_level = 0;
+ switch (io2->generic.out.oplock_level) {
+ case OPLOCK_BATCH:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_BATCH;
+ break;
+ case OPLOCK_EXCLUSIVE:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_EXCLUSIVE;
+ break;
+ case OPLOCK_LEVEL_II:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_II;
+ break;
+ default:
+ io->smb2.out.oplock_level = SMB2_OPLOCK_LEVEL_NONE;
+ break;
+ }
io->smb2.out.reserved = 0;
io->smb2.out.create_action = io2->generic.out.create_action;
io->smb2.out.create_time = io2->generic.out.create_time;
@@ -485,7 +498,18 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
status = ntvfs->ops->open(ntvfs, req, io2);
break;
case RAW_OPEN_SMB2:
- io2->generic.in.flags = 0;
+ switch (io->smb2.in.oplock_level) {
+ case SMB2_OPLOCK_LEVEL_BATCH:
+ io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK |
+ NTCREATEX_FLAGS_REQUEST_OPLOCK;
+ break;
+ case SMB2_OPLOCK_LEVEL_EXCLUSIVE:
+ io2->generic.in.flags = NTCREATEX_FLAGS_REQUEST_OPLOCK;
+ break;
+ default:
+ io2->generic.in.flags = 0;
+ break;
+ }
io2->generic.in.root_fid = 0;
io2->generic.in.access_mask = io->smb2.in.desired_access;
io2->generic.in.alloc_size = 0;