]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: add a smbd_notify_cancel_by_map() helper function
authorStefan Metzmacher <metze@samba.org>
Fri, 1 May 2015 18:04:55 +0000 (20:04 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 20 May 2015 14:34:29 +0000 (16:34 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11182

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2c47fb16089602a42f62124520e58bdcd8c7d053)

source3/smbd/notify.c

index 4842d6f2fcb33b4a1ba34e404fa6a6666cb87c76..cb9f873894305f55758e3dacf1beeefb8f653241 100644 (file)
@@ -350,6 +350,17 @@ static void change_notify_remove_request(struct smbd_server_connection *sconn,
        TALLOC_FREE(req);
 }
 
+static void smbd_notify_cancel_by_map(struct notify_mid_map *map)
+{
+       struct smb_request *smbreq = map->req->req;
+       struct smbd_server_connection *sconn = smbreq->sconn;
+       NTSTATUS notify_status = NT_STATUS_CANCELLED;
+
+       change_notify_reply(smbreq, notify_status,
+                           0, NULL, map->req->reply_fn);
+       change_notify_remove_request(sconn, map->req);
+}
+
 /****************************************************************************
  Delete entries by mid from the change notify pending queue. Always send reply.
 *****************************************************************************/
@@ -369,9 +380,7 @@ void remove_pending_change_notify_requests_by_mid(
                return;
        }
 
-       change_notify_reply(map->req->req,
-                           NT_STATUS_CANCELLED, 0, NULL, map->req->reply_fn);
-       change_notify_remove_request(sconn, map->req);
+       smbd_notify_cancel_by_map(map);
 }
 
 void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq)
@@ -389,9 +398,7 @@ void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq)
                return;
        }
 
-       change_notify_reply(map->req->req,
-                           NT_STATUS_CANCELLED, 0, NULL, map->req->reply_fn);
-       change_notify_remove_request(sconn, map->req);
+       smbd_notify_cancel_by_map(map);
 }
 
 /****************************************************************************