In the future not all callers will have a share_mode_lock around.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
struct tevent_req *share_mode_watch_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct share_mode_lock *lck,
+ struct file_id *id,
struct server_id blocker)
{
- struct file_id id = share_mode_lock_file_id(lck);
- TDB_DATA key = locking_key(&id);
+ TDB_DATA key = locking_key(id);
struct tevent_req *req = NULL, *subreq = NULL;
struct share_mode_watch_state *state = NULL;
struct tevent_req *share_mode_watch_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct share_mode_lock *lck,
+ struct file_id *id,
struct server_id blocker);
NTSTATUS share_mode_watch_recv(
struct tevent_req *req, bool *blockerdead, struct server_id *blocker);
setup_retry:
subreq = share_mode_watch_send(
- state, state->ev, lck, blocking_pid);
+ state, state->ev, &state->fsp->file_id, blocking_pid);
if (tevent_req_nomem(subreq, req)) {
goto done;
}
watch_req = share_mode_watch_send(
watch_state,
req->sconn->ev_ctx,
- lck,
+ &id,
(struct server_id){0});
if (watch_req == NULL) {
exit_server("Could not watch share mode record");
TALLOC_CTX *mem_ctx;
struct tevent_context *ev_ctx;
struct tevent_req *watch_req;
+ struct file_id id;
};
static void poll_open_setup_watcher_fn(struct share_mode_lock *lck,
state->watch_req = share_mode_watch_send(
state->mem_ctx,
state->ev_ctx,
- lck,
+ &state->id,
(struct server_id) {0});
if (state->watch_req == NULL) {
DBG_WARNING("share_mode_watch_send failed\n");
struct poll_open_setup_watcher_state wstate = {
.mem_ctx = open_rec,
.ev_ctx = req->sconn->ev_ctx,
+ .id = *id,
};
NTSTATUS status;
DBG_DEBUG("Watching share mode lock\n");
subreq = share_mode_watch_send(
- state, state->ev, lck, blocking_pid);
+ state, state->ev, &state->fsp->file_id, blocking_pid);
TALLOC_FREE(lck);
if (tevent_req_nomem(subreq, req)) {
return;
subreq = share_mode_watch_send(state,
state->ev,
- state->lck,
+ &state->fsp->file_id,
(struct server_id){0});
if (tevent_req_nomem(subreq, req)) {
return;