summaryrefslogtreecommitdiffstats
path: root/source/locking
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-12-16 12:30:49 +0000
committerGerald Carter <jerry@samba.org>2004-12-16 12:30:49 +0000
commit8d91e07ef22ad3ed484b04bc4968380a24940696 (patch)
treeb5b8989f8da9ef7f852081f0460995386edd4b5d /source/locking
parent1a878c865637feb80206c0dc599acebf7f4a46bd (diff)
downloadsamba-3.0.10.tar.gz
samba-3.0.10.tar.xz
samba-3.0.10.zip
r4231: commiting changes to 3.0.10samba-3.0.10
Diffstat (limited to 'source/locking')
-rw-r--r--source/locking/brlock.c2
-rw-r--r--source/locking/locking.c22
-rw-r--r--source/locking/posix.c11
3 files changed, 10 insertions, 25 deletions
diff --git a/source/locking/brlock.c b/source/locking/brlock.c
index 61144eb59a9..d92027e267a 100644
--- a/source/locking/brlock.c
+++ b/source/locking/brlock.c
@@ -407,7 +407,7 @@ NTSTATUS brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
}
/* no conflicts - add it to the list of locks */
- tp = Realloc(dbuf.dptr, dbuf.dsize + sizeof(*locks));
+ tp = SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(*locks));
if (!tp) {
status = NT_STATUS_NO_MEMORY;
goto fail;
diff --git a/source/locking/locking.c b/source/locking/locking.c
index d4e8c493d50..15a4500bfa8 100644
--- a/source/locking/locking.c
+++ b/source/locking/locking.c
@@ -541,19 +541,6 @@ static void fill_share_mode(char *p, files_struct *fsp, uint16 port, uint16 op_t
BOOL share_modes_identical( share_mode_entry *e1, share_mode_entry *e2)
{
-#if 1 /* JRA PARANOIA TEST - REMOVE LATER */
- if (e1->pid == e2->pid &&
- e1->share_file_id == e2->share_file_id &&
- e1->dev == e2->dev &&
- e1->inode == e2->inode &&
- (e1->share_mode & ~DELETE_ON_CLOSE_FLAG) != (e2->share_mode & ~DELETE_ON_CLOSE_FLAG)) {
- DEBUG(0,("PANIC: share_modes_identical: share_mode missmatch (e1 = %u, e2 = %u). Logic error.\n",
- (unsigned int)(e1->share_mode & ~DELETE_ON_CLOSE_FLAG),
- (unsigned int)(e2->share_mode & ~DELETE_ON_CLOSE_FLAG) ));
- smb_panic("PANIC: share_modes_identical logic error.\n");
- }
-#endif
-
return (e1->pid == e2->pid &&
(e1->share_mode & ~DELETE_ON_CLOSE_FLAG) == (e2->share_mode & ~DELETE_ON_CLOSE_FLAG) &&
e1->dev == e2->dev &&
@@ -679,7 +666,7 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type)
pstrcat(fname, fsp->fsp_name);
size = sizeof(*data) + sizeof(share_mode_entry) + strlen(fname) + 1;
- p = (char *)malloc(size);
+ p = (char *)SMB_MALLOC(size);
if (!p)
return False;
data = (struct locking_data *)p;
@@ -711,7 +698,7 @@ BOOL set_share_mode(files_struct *fsp, uint16 port, uint16 op_type)
fsp->fsp_name, data->u.num_share_mode_entries ));
size = dbuf.dsize + sizeof(share_mode_entry);
- p = malloc(size);
+ p = SMB_MALLOC(size);
if (!p) {
SAFE_FREE(dbuf.dptr);
return False;
@@ -925,7 +912,6 @@ static void print_deferred_open_table(struct deferred_open_data *data)
}
}
-
/*******************************************************************
Form a static deferred open locking key for a dev/inode pair.
******************************************************************/
@@ -1161,7 +1147,7 @@ BOOL add_deferred_open(uint16 mid, struct timeval *ptv, SMB_DEV_T dev, SMB_INO_T
/* we'll need to create a new record */
size = sizeof(*data) + sizeof(deferred_open_entry) + strlen(fname) + 1;
- p = (char *)malloc(size);
+ p = (char *)SMB_MALLOC(size);
if (!p)
return False;
data = (struct deferred_open_data *)p;
@@ -1193,7 +1179,7 @@ BOOL add_deferred_open(uint16 mid, struct timeval *ptv, SMB_DEV_T dev, SMB_INO_T
fname, data->u.num_deferred_open_entries ));
size = dbuf.dsize + sizeof(deferred_open_entry);
- p = malloc(size);
+ p = SMB_MALLOC(size);
if (!p) {
SAFE_FREE(dbuf.dptr);
return False;
diff --git a/source/locking/posix.c b/source/locking/posix.c
index 0e5edfa0eb8..6ab2ed377e2 100644
--- a/source/locking/posix.c
+++ b/source/locking/posix.c
@@ -102,7 +102,7 @@ static BOOL add_fd_to_close_entry(files_struct *fsp)
dbuf = tdb_fetch(posix_pending_close_tdb, kbuf);
- tp = Realloc(dbuf.dptr, dbuf.dsize + sizeof(int));
+ tp = SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(int));
if (!tp) {
DEBUG(0,("add_fd_to_close_entry: Realloc fail !\n"));
SAFE_FREE(dbuf.dptr);
@@ -371,7 +371,7 @@ static BOOL add_posix_lock_entry(files_struct *fsp, SMB_OFF_T start, SMB_OFF_T s
pl.size = size;
pl.lock_type = lock_type;
- tp = Realloc(dbuf.dptr, dbuf.dsize + sizeof(pl));
+ tp = SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(pl));
if (!tp) {
DEBUG(0,("add_posix_lock_entry: Realloc fail !\n"));
goto fail;
@@ -896,8 +896,7 @@ BECOMES.....
| l_curr| | l_new |
+-------+ +---------+
**********************************************/
- struct lock_list *l_new = (struct lock_list *)talloc(ctx,
- sizeof(struct lock_list));
+ struct lock_list *l_new = TALLOC_P(ctx, struct lock_list);
if(l_new == NULL) {
DEBUG(0,("posix_lock_list: talloc fail.\n"));
@@ -1002,7 +1001,7 @@ BOOL set_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_cou
return True; /* Not a fatal error. */
}
- if ((ll = (struct lock_list *)talloc(l_ctx, sizeof(struct lock_list))) == NULL) {
+ if ((ll = TALLOC_P(l_ctx, struct lock_list)) == NULL) {
DEBUG(0,("set_posix_lock: unable to talloc unlock list.\n"));
talloc_destroy(l_ctx);
return True; /* Not a fatal error. */
@@ -1148,7 +1147,7 @@ BOOL release_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u
return True; /* Not a fatal error. */
}
- if ((ul = (struct lock_list *)talloc(ul_ctx, sizeof(struct lock_list))) == NULL) {
+ if ((ul = TALLOC_P(ul_ctx, struct lock_list)) == NULL) {
DEBUG(0,("release_posix_lock: unable to talloc unlock list.\n"));
talloc_destroy(ul_ctx);
return True; /* Not a fatal error. */