{
unsigned int i;
files_struct *fsp = br_lck->fsp;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
for (i=0; i < br_lck->num_locks; i++) {
/* Do any Windows or POSIX locks conflict ? */
memcpy(&locks[br_lck->num_locks], plock, sizeof(struct lock_struct));
br_lck->num_locks += 1;
- br_lck->lock_data = (void *)locks;
+ br_lck->lock_data = locks;
br_lck->modified = True;
return NT_STATUS_OK;
const struct lock_struct *plock)
{
unsigned int i, count;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
struct lock_struct *tp;
BOOL lock_was_added = False;
BOOL signal_pending_read = False;
}
br_lck->num_locks = count;
SAFE_FREE(br_lck->lock_data);
- br_lck->lock_data = (void *)tp;
+ br_lck->lock_data = tp;
locks = tp;
br_lck->modified = True;
static BOOL brl_unlock_windows(struct byte_range_lock *br_lck, const struct lock_struct *plock)
{
unsigned int i, j;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
enum brl_type deleted_lock_type = READ_LOCK; /* shut the compiler up.... */
#if ZERO_ZERO
{
unsigned int i, j, count;
struct lock_struct *tp;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
BOOL overlap_found = False;
/* No zero-zero locks for POSIX. */
br_lck->num_locks = count;
SAFE_FREE(br_lck->lock_data);
locks = tp;
- br_lck->lock_data = (void *)tp;
+ br_lck->lock_data = tp;
br_lck->modified = True;
/* Send unlock messages to any pending waiters that overlap. */
BOOL ret = True;
unsigned int i;
struct lock_struct lock;
- const struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ const struct lock_struct *locks = br_lck->lock_data;
files_struct *fsp = br_lck->fsp;
lock.context.smbpid = smbpid;
{
unsigned int i;
struct lock_struct lock;
- const struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ const struct lock_struct *locks = br_lck->lock_data;
files_struct *fsp = br_lck->fsp;
lock.context.smbpid = *psmbpid;
enum brl_flavour lock_flav)
{
unsigned int i;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
struct lock_context context;
context.smbpid = smbpid;
int fnum = fsp->fnum;
unsigned int i, j, dcount=0;
int num_deleted_windows_locks = 0;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
struct process_id pid = procid_self();
BOOL unlock_individually = False;
talloc_set_destructor(br_lck, byte_range_lock_destructor);
data = tdb_fetch(tdb, key);
- br_lck->lock_data = (void *)data.dptr;
+ br_lck->lock_data = (struct lock_struct *)data.dptr;
br_lck->num_locks = data.dsize / sizeof(struct lock_struct);
if (!fsp->lockdb_clean) {
/* Go through and ensure all entries exist - remove any that don't. */
/* Makes the lockdb self cleaning at low cost. */
- struct lock_struct *locks =
- (struct lock_struct *)br_lck->lock_data;
-
- if (!validate_lock_entries(&br_lck->num_locks, &locks)) {
+ if (!validate_lock_entries(&br_lck->num_locks,
+ &br_lck->lock_data)) {
SAFE_FREE(br_lck->lock_data);
TALLOC_FREE(br_lck);
return NULL;
}
- /*
- * validate_lock_entries might have changed locks. We can't
- * use a direct pointer here because otherwise gcc warnes
- * about strict aliasing rules being violated.
- */
- br_lck->lock_data = locks;
-
/* Mark the lockdb as "clean" as seen from this open file. */
fsp->lockdb_clean = True;
}
if (DEBUGLEVEL >= 10) {
unsigned int i;
- struct lock_struct *locks = (struct lock_struct *)br_lck->lock_data;
+ struct lock_struct *locks = br_lck->lock_data;
DEBUG(10,("brl_get_locks_internal: %u current locks on dev=%.0f, inode=%.0f\n",
br_lck->num_locks,
(double)fsp->dev, (double)fsp->inode ));