summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-10-04 10:11:38 +0000
committerJeremy Allison <jra@samba.org>2013-10-15 03:42:53 +0200
commit9646dfcdf2ffe0fbd56284a87007b63a9ab34a30 (patch)
tree9cf3a00c8e71fa0143031f7585906b6aad10b0ff /source3/smbd
parent1d2c6f477b5bc17ac8b940de56432c69d7039304 (diff)
downloadsamba-9646dfcdf2ffe0fbd56284a87007b63a9ab34a30.tar.gz
samba-9646dfcdf2ffe0fbd56284a87007b63a9ab34a30.tar.bz2
samba-9646dfcdf2ffe0fbd56284a87007b63a9ab34a30.zip
smbd: Inline break_level2_to_none_async
With the special case for bug 5980 in do_break_to_none we only have one caller: process_oplock_async_level2_break_message. The further goal is to merge process_oplock_async_level2_break_message with process_oplock_break_message. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 15 03:42:53 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c70
1 files changed, 32 insertions, 38 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index b0ab1b58cb..e2880c5de9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -409,43 +409,6 @@ static void send_break_message_smb1(files_struct *fsp, int level)
}
}
-static void break_level2_to_none_async(struct server_id src, files_struct *fsp)
-{
- struct smbd_server_connection *sconn = fsp->conn->sconn;
- struct server_id self = messaging_server_id(sconn->msg_ctx);
-
- if (fsp->oplock_type == NO_OPLOCK) {
- /* We already got a "break to none" message and we've handled
- * it. just ignore. */
- DEBUG(3, ("process_oplock_async_level2_break_message: already "
- "broken to none, ignoring.\n"));
- return;
- }
-
- /* Ensure we're really at level2 state. */
- SMB_ASSERT(fsp->oplock_type == LEVEL_II_OPLOCK);
-
- DEBUG(10,("process_oplock_async_level2_break_message: sending break "
- "to none message for %s, file %s\n", fsp_fnum_dbg(fsp),
- fsp_str_dbg(fsp)));
-
- /* Need to wait before sending a break
- message if we sent ourselves this message. */
- if (serverid_equal(&self, &src)) {
- wait_before_sending_break();
- }
-
- /* Now send a break to none message to our client. */
- if (sconn->using_smb2) {
- send_break_message_smb2(fsp, OPLOCKLEVEL_NONE);
- } else {
- send_break_message_smb1(fsp, OPLOCKLEVEL_NONE);
- }
-
- /* Async level2 request, don't send a reply, just remove the oplock. */
- remove_oplock(fsp);
-}
-
/*******************************************************************
This handles the case of a write triggering a break to none
message on a level2 oplock.
@@ -465,6 +428,7 @@ static void process_oplock_async_level2_break_message(struct messaging_context *
struct smbd_server_connection *sconn =
talloc_get_type_abort(private_data,
struct smbd_server_connection);
+ struct server_id self = messaging_server_id(sconn->msg_ctx);
if (data->data == NULL) {
DEBUG(0, ("Got NULL buffer\n"));
@@ -494,7 +458,37 @@ static void process_oplock_async_level2_break_message(struct messaging_context *
return;
}
- break_level2_to_none_async(src, fsp);
+
+ if (fsp->oplock_type == NO_OPLOCK) {
+ /* We already got a "break to none" message and we've handled
+ * it. just ignore. */
+ DEBUG(3, ("process_oplock_async_level2_break_message: already "
+ "broken to none, ignoring.\n"));
+ return;
+ }
+
+ /* Ensure we're really at level2 state. */
+ SMB_ASSERT(fsp->oplock_type == LEVEL_II_OPLOCK);
+
+ DEBUG(10,("process_oplock_async_level2_break_message: sending break "
+ "to none message for %s, file %s\n", fsp_fnum_dbg(fsp),
+ fsp_str_dbg(fsp)));
+
+ /* Need to wait before sending a break
+ message if we sent ourselves this message. */
+ if (serverid_equal(&self, &src)) {
+ wait_before_sending_break();
+ }
+
+ /* Now send a break to none message to our client. */
+ if (sconn->using_smb2) {
+ send_break_message_smb2(fsp, OPLOCKLEVEL_NONE);
+ } else {
+ send_break_message_smb1(fsp, OPLOCKLEVEL_NONE);
+ }
+
+ /* Async level2 request, don't send a reply, just remove the oplock. */
+ remove_oplock(fsp);
}
/*******************************************************************