1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

s3-libsmb: introduce cli_lock32()

Same like cli_lock() but return NTSTATUS instead of bool

Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Björn Baumbach 2011-07-11 11:13:18 +02:00 committed by Stefan Metzmacher
parent 330c00a14d
commit 57194d8c5d
2 changed files with 18 additions and 0 deletions

View File

@ -2580,6 +2580,22 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
note that timeout is in units of 2 milliseconds note that timeout is in units of 2 milliseconds
****************************************************************************/ ****************************************************************************/
NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len, int timeout,
enum brl_type lock_type)
{
NTSTATUS status;
status = cli_locktype(cli, fnum, offset, len, timeout,
(lock_type == READ_LOCK? 1 : 0));
return status;
}
/****************************************************************************
Lock a file.
note that timeout is in units of 2 milliseconds
****************************************************************************/
bool cli_lock(struct cli_state *cli, uint16_t fnum, bool cli_lock(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len, int timeout, uint32_t offset, uint32_t len, int timeout,
enum brl_type lock_type) enum brl_type lock_type)

View File

@ -390,6 +390,8 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
int timeout, unsigned char locktype); int timeout, unsigned char locktype);
bool cli_lock(struct cli_state *cli, uint16_t fnum, bool cli_lock(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type); uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type);
NTSTATUS cli_lock32(struct cli_state *cli, uint16_t fnum, uint32_t offset,
uint32_t len, int timeout, enum brl_type lock_type);
struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx, struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx,
struct event_context *ev, struct event_context *ev,
struct cli_state *cli, struct cli_state *cli,