Lock a file with 64 bit offsets.
****************************************************************************/
-bool cli_lock64(struct cli_state *cli, uint16_t fnum,
- uint64_t offset, uint64_t len, int timeout,
- enum brl_type lock_type)
+NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
+ uint64_t offset, uint64_t len, int timeout,
+ enum brl_type lock_type)
{
uint16_t vwv[8];
uint8_t bytes[20];
NTSTATUS status;
if (! (cli->capabilities & CAP_LARGE_FILES)) {
- return cli_lock(cli, fnum, offset, len, timeout, lock_type);
+ return cli_lock32(cli, fnum, offset, len, timeout, lock_type);
}
ltype = (lock_type == READ_LOCK? 1 : 0);
cli->timeout = saved_timeout;
- return NT_STATUS_IS_OK(status);
+ return status;
}
/****************************************************************************
uint64_t len);
NTSTATUS cli_unlock_recv(struct tevent_req *req);
NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len);
-bool cli_lock64(struct cli_state *cli, uint16_t fnum,
- uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type);
+NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
+ uint64_t offset, uint64_t len, int timeout,
+ enum brl_type lock_type);
struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct cli_state *cli,
uint64_t len = rec->len;
enum brl_type op = rec->lock_type;
int server;
- bool ret[NSERVERS];
NTSTATUS status[NSERVERS];
switch (rec->lock_op) {
case OP_LOCK:
/* set a lock */
for (server=0;server<NSERVERS;server++) {
- ret[server] = cli_lock64(cli[server][conn],
- fnum[server][conn][f],
- start, len, LOCK_TIMEOUT, op);
- status[server] = cli_nt_error(cli[server][conn]);
+ status[server] = cli_lock64(cli[server][conn],
+ fnum[server][conn][f],
+ start, len, LOCK_TIMEOUT,
+ op);
if (!exact_error_codes &&
NT_STATUS_EQUAL(status[server],
NT_STATUS_FILE_LOCK_CONFLICT)) {
case OP_UNLOCK:
/* unset a lock */
for (server=0;server<NSERVERS;server++) {
- ret[server] = NT_STATUS_IS_OK(cli_unlock64(cli[server][conn],
- fnum[server][conn][f],
- start, len));
- status[server] = cli_nt_error(cli[server][conn]);
+ status[server] = cli_unlock64(cli[server][conn],
+ fnum[server][conn][f],
+ start, len);
}
if (showall ||
(!hide_unlock_fails && !NT_STATUS_EQUAL(status[0],status[1]))) {