mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
smbd: Make share_mode_do_locked() use a const uint8_t *
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
14cc4a6576
commit
733ae9cd95
@ -250,7 +250,8 @@ struct do_lock_state {
|
||||
};
|
||||
|
||||
static void do_lock_fn(
|
||||
TDB_DATA value,
|
||||
const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data)
|
||||
{
|
||||
|
@ -144,7 +144,8 @@ bool file_has_read_lease(struct files_struct *fsp);
|
||||
struct db_record;
|
||||
NTSTATUS share_mode_do_locked(
|
||||
struct file_id id,
|
||||
void (*fn)(TDB_DATA value,
|
||||
void (*fn)(const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
|
@ -228,13 +228,16 @@ struct fsp_update_share_mode_flags_state {
|
||||
};
|
||||
|
||||
static void fsp_update_share_mode_flags_fn(
|
||||
TDB_DATA value, bool *modified_dependent, void *private_data)
|
||||
const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data)
|
||||
{
|
||||
struct fsp_update_share_mode_flags_state *state = private_data;
|
||||
uint64_t seq;
|
||||
|
||||
state->ndr_err = get_share_mode_blob_header(
|
||||
value.dptr, value.dsize, &seq, &state->share_mode_flags);
|
||||
buf, buflen, &seq, &state->share_mode_flags);
|
||||
}
|
||||
|
||||
static NTSTATUS fsp_update_share_mode_flags(struct files_struct *fsp)
|
||||
@ -723,7 +726,8 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
|
||||
}
|
||||
|
||||
struct share_mode_do_locked_state {
|
||||
void (*fn)(TDB_DATA value,
|
||||
void (*fn)(const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data);
|
||||
void *private_data;
|
||||
@ -747,7 +751,10 @@ static void share_mode_do_locked_fn(
|
||||
SMB_ASSERT(static_share_mode_record == rec);
|
||||
}
|
||||
|
||||
state->fn(value, &modified_dependent, state->private_data);
|
||||
state->fn(value.dptr,
|
||||
value.dsize,
|
||||
&modified_dependent,
|
||||
state->private_data);
|
||||
|
||||
if (modified_dependent) {
|
||||
dbwrap_watched_wakeup(rec);
|
||||
@ -760,7 +767,8 @@ static void share_mode_do_locked_fn(
|
||||
|
||||
NTSTATUS share_mode_do_locked(
|
||||
struct file_id id,
|
||||
void (*fn)(TDB_DATA value,
|
||||
void (*fn)(const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
@ -782,7 +790,8 @@ NTSTATUS share_mode_do_locked(
|
||||
return NT_STATUS_INVALID_LOCK_SEQUENCE;
|
||||
}
|
||||
|
||||
fn(static_share_mode_record_value,
|
||||
fn(static_share_mode_record_value.dptr,
|
||||
static_share_mode_record_value.dsize,
|
||||
&modified_dependent,
|
||||
private_data);
|
||||
|
||||
@ -809,7 +818,9 @@ NTSTATUS share_mode_do_locked(
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
static void share_mode_wakeup_waiters_fn(TDB_DATA value,
|
||||
static void share_mode_wakeup_waiters_fn(
|
||||
const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data)
|
||||
{
|
||||
@ -834,7 +845,10 @@ struct share_mode_watch_state {
|
||||
};
|
||||
|
||||
static void share_mode_watch_fn(
|
||||
TDB_DATA value, bool *modified_dependent, void *private_data)
|
||||
const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *modified_dependent,
|
||||
void *private_data)
|
||||
{
|
||||
struct share_mode_watch_state *state = talloc_get_type_abort(
|
||||
private_data, struct share_mode_watch_state);
|
||||
|
@ -9069,7 +9069,10 @@ struct smbd_do_unlocking_state {
|
||||
};
|
||||
|
||||
static void smbd_do_unlocking_fn(
|
||||
TDB_DATA value, bool *pmodified_dependent, void *private_data)
|
||||
const uint8_t *buf,
|
||||
size_t buflen,
|
||||
bool *pmodified_dependent,
|
||||
void *private_data)
|
||||
{
|
||||
struct smbd_do_unlocking_state *state = private_data;
|
||||
struct files_struct *fsp = state->fsp;
|
||||
|
Loading…
x
Reference in New Issue
Block a user