summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-22 01:14:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:02:24 -0500
commit1ec644619d9607758cf090ea904eb2d84500481c (patch)
tree66c4fdfc8e0c079ae72baf3659e73be33fd42f1d /source4/ntvfs
parent27129573ff5b87ac8b107d267cde87b516d9e6b9 (diff)
downloadsamba-1ec644619d9607758cf090ea904eb2d84500481c.tar.gz
samba-1ec644619d9607758cf090ea904eb2d84500481c.tar.bz2
samba-1ec644619d9607758cf090ea904eb2d84500481c.zip
r3126: in the brlock code I had used a void* for the brl context as I didn't
want to expose the brl context structure outside the brlock.c code. Instead, I now use "struct brl_context *" and rely on C being happy to pass around pointers to unknown structures as long as they are not dereferenced. I will be interested to see how the build farm likes this. (This used to be commit cb155c8ad837285c5a7f5b104968239df0b65fd2)
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/common/brlock.c23
-rw-r--r--source4/ntvfs/posix/vfs_posix.h2
2 files changed, 10 insertions, 15 deletions
diff --git a/source4/ntvfs/common/brlock.c b/source4/ntvfs/common/brlock.c
index 2da32891fb..607947615e 100644
--- a/source4/ntvfs/common/brlock.c
+++ b/source4/ntvfs/common/brlock.c
@@ -71,8 +71,8 @@ struct brl_context {
talloc_free(). We need the messaging_ctx to allow for
pending lock notifications.
*/
-void *brl_init(TALLOC_CTX *mem_ctx, servid_t server, uint16_t tid,
- void *messaging_ctx)
+struct brl_context *brl_init(TALLOC_CTX *mem_ctx, servid_t server, uint16_t tid,
+ void *messaging_ctx)
{
char *path;
struct brl_context *brl;
@@ -97,7 +97,7 @@ void *brl_init(TALLOC_CTX *mem_ctx, servid_t server, uint16_t tid,
brl->messaging_ctx = messaging_ctx;
ZERO_STRUCT(brl->last_lock_failure);
- return (void *)brl;
+ return brl;
}
@@ -219,7 +219,7 @@ static NTSTATUS brl_lock_failed(struct brl_context *brl, struct lock_struct *loc
someone else closing an overlapping lock range) a messaging
notification is sent, identified by the notify_ptr
*/
-NTSTATUS brl_lock(void *brl_ctx,
+NTSTATUS brl_lock(struct brl_context *brl,
DATA_BLOB *file_key,
uint16_t smbpid,
uint16_t fnum,
@@ -227,7 +227,6 @@ NTSTATUS brl_lock(void *brl_ctx,
enum brl_type lock_type,
void *notify_ptr)
{
- struct brl_context *brl = brl_ctx;
TDB_DATA kbuf, dbuf;
int count, i;
struct lock_struct lock, *locks;
@@ -248,7 +247,7 @@ NTSTATUS brl_lock(void *brl_ctx,
preventing the real lock gets removed */
if (lock_type >= PENDING_READ_LOCK) {
enum brl_type rw = (lock_type==PENDING_READ_LOCK? READ_LOCK : WRITE_LOCK);
- status = brl_lock(brl_ctx, file_key, smbpid, fnum, start, size, rw, NULL);
+ status = brl_lock(brl, file_key, smbpid, fnum, start, size, rw, NULL);
if (NT_STATUS_IS_OK(status)) {
tdb_chainunlock(brl->w->tdb, kbuf);
return NT_STATUS_OK;
@@ -368,13 +367,12 @@ static void brl_notify_all(struct brl_context *brl,
/*
Unlock a range of bytes.
*/
-NTSTATUS brl_unlock(void *brl_ctx,
+NTSTATUS brl_unlock(struct brl_context *brl,
DATA_BLOB *file_key,
uint16_t smbpid,
uint16_t fnum,
uint64_t start, uint64_t size)
{
- struct brl_context *brl = brl_ctx;
TDB_DATA kbuf, dbuf;
int count, i;
struct lock_struct *locks;
@@ -456,11 +454,10 @@ NTSTATUS brl_unlock(void *brl_ctx,
given up trying to establish a lock or when they have succeeded in
getting it. In either case they no longer need to be notified.
*/
-NTSTATUS brl_remove_pending(void *brl_ctx,
+NTSTATUS brl_remove_pending(struct brl_context *brl,
DATA_BLOB *file_key,
void *notify_ptr)
{
- struct brl_context *brl = brl_ctx;
TDB_DATA kbuf, dbuf;
int count, i;
struct lock_struct *locks;
@@ -526,14 +523,13 @@ NTSTATUS brl_remove_pending(void *brl_ctx,
/*
Test if we are allowed to perform IO on a region of an open file
*/
-NTSTATUS brl_locktest(void *brl_ctx,
+NTSTATUS brl_locktest(struct brl_context *brl,
DATA_BLOB *file_key,
uint16_t fnum,
uint16 smbpid,
uint64_t start, uint64_t size,
enum brl_type lock_type)
{
- struct brl_context *brl = brl_ctx;
TDB_DATA kbuf, dbuf;
int count, i;
struct lock_struct lock, *locks;
@@ -573,10 +569,9 @@ NTSTATUS brl_locktest(void *brl_ctx,
/*
Remove any locks associated with a open file.
*/
-NTSTATUS brl_close(void *brl_ctx,
+NTSTATUS brl_close(struct brl_context *brl,
DATA_BLOB *file_key, int fnum)
{
- struct brl_context *brl = brl_ctx;
TDB_DATA kbuf, dbuf;
int count, i, dcount=0;
struct lock_struct *locks;
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index ae601c60c7..a0aacf3786 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -36,7 +36,7 @@ struct pvfs_state {
struct pvfs_mangle_context *mangle_ctx;
- void *brl_context;
+ struct brl_context *brl_context;
/* an id tree mapping open search ID to a pvfs_search_state structure */
void *idtree_search;