summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-08-16 11:40:38 +0000
committerMichael Adam <obnox@samba.org>2013-08-20 12:34:00 +0200
commite7dab403c0ca6f64d0ffe5a61898cd642a16b078 (patch)
tree3a67555b3aeaa598fd2e76ec6dfa4b5bae8dcbde /source3/smbd
parent1808316b1245290fd4a4aa87a801410899e4c1e3 (diff)
downloadsamba-e7dab403c0ca6f64d0ffe5a61898cd642a16b078.tar.gz
samba-e7dab403c0ca6f64d0ffe5a61898cd642a16b078.tar.bz2
samba-e7dab403c0ca6f64d0ffe5a61898cd642a16b078.zip
smbd: Replace a 0-timeout wakeup_send
A tevent_immediate is simpler and is what we want here. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index e08a96350c..fbdd6c8796 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -632,7 +632,9 @@ struct break_to_none_state {
struct smbd_server_connection *sconn;
struct file_id id;
};
-static void do_break_to_none(struct tevent_req *req);
+static void do_break_to_none(struct tevent_context *ctx,
+ struct tevent_immediate *im,
+ void *private_data);
/****************************************************************************
This function is called on any file modification or lock request. If a file
@@ -644,7 +646,7 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
enum level2_contention_type type)
{
struct smbd_server_connection *sconn = fsp->conn->sconn;
- struct tevent_req *req;
+ struct tevent_immediate *im;
struct break_to_none_state *state;
/*
@@ -673,31 +675,25 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp,
state->sconn = sconn;
state->id = fsp->file_id;
- req = tevent_wakeup_send(state, sconn->ev_ctx, timeval_set(0, 0));
- if (req == NULL) {
- DEBUG(1, ("tevent_wakeup_send failed\n"));
+ im = tevent_create_immediate(state);
+ if (im == NULL) {
+ DEBUG(1, ("tevent_create_immediate failed\n"));
TALLOC_FREE(state);
return;
}
- tevent_req_set_callback(req, do_break_to_none, state);
- return;
+ tevent_schedule_immediate(im, sconn->ev_ctx, do_break_to_none, state);
}
-static void do_break_to_none(struct tevent_req *req)
+static void do_break_to_none(struct tevent_context *ctx,
+ struct tevent_immediate *im,
+ void *private_data)
{
- struct break_to_none_state *state = tevent_req_callback_data(
- req, struct break_to_none_state);
+ struct break_to_none_state *state = talloc_get_type_abort(
+ private_data, struct break_to_none_state);
struct server_id self = messaging_server_id(state->sconn->msg_ctx);
- bool ret;
int i;
struct share_mode_lock *lck;
- ret = tevent_wakeup_recv(req);
- TALLOC_FREE(req);
- if (!ret) {
- DEBUG(1, ("tevent_wakeup_recv failed\n"));
- goto done;
- }
lck = get_existing_share_mode_lock(talloc_tos(), state->id);
if (lck == NULL) {
DEBUG(1, ("release_level_2_oplocks_on_change: failed to lock "