2 Unix SMB/CIFS implementation.
3 global locks based on dbwrap and messaging
4 Copyright (C) 2009 by Volker Lendecke
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "dbwrap/dbwrap.h"
26 struct messaging_context
;
35 struct g_lock_ctx
*g_lock_ctx_init_backend(
37 struct messaging_context
*msg
,
38 struct db_context
**backend
);
39 struct g_lock_ctx
*g_lock_ctx_init(TALLOC_CTX
*mem_ctx
,
40 struct messaging_context
*msg
);
42 struct tevent_req
*g_lock_lock_send(TALLOC_CTX
*mem_ctx
,
43 struct tevent_context
*ev
,
44 struct g_lock_ctx
*ctx
,
46 enum g_lock_type type
);
47 NTSTATUS
g_lock_lock_recv(struct tevent_req
*req
);
48 NTSTATUS
g_lock_lock(struct g_lock_ctx
*ctx
, TDB_DATA key
,
49 enum g_lock_type lock_type
, struct timeval timeout
);
50 NTSTATUS
g_lock_unlock(struct g_lock_ctx
*ctx
, TDB_DATA key
);
52 NTSTATUS
g_lock_write_data(struct g_lock_ctx
*ctx
, TDB_DATA key
,
53 const uint8_t *buf
, size_t buflen
);
55 int g_lock_locks(struct g_lock_ctx
*ctx
,
56 int (*fn
)(TDB_DATA key
, void *private_data
),
58 NTSTATUS
g_lock_dump(struct g_lock_ctx
*ctx
,
60 void (*fn
)(struct server_id exclusive
,
62 struct server_id
*shared
,