svn commit: samba r15613 - in branches/SAMBA_4_0/source/ntvfs: common posix

metze at samba.org metze at samba.org
Mon May 15 11:43:25 GMT 2006


Author: metze
Date: 2006-05-15 11:43:25 +0000 (Mon, 15 May 2006)
New Revision: 15613

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15613

Log:
the snum doesn't identify the tcon, but the brl_context pointer does

metze
Modified:
   branches/SAMBA_4_0/source/ntvfs/common/brlock.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/common/brlock.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/common/brlock.c	2006-05-15 10:45:38 UTC (rev 15612)
+++ branches/SAMBA_4_0/source/ntvfs/common/brlock.c	2006-05-15 11:43:25 UTC (rev 15613)
@@ -41,6 +41,7 @@
   as it is applied consistently.
 */
 
+struct brl_context;
 /*
   the lock context contains the elements that define whether one
   lock is the same as another lock
@@ -48,7 +49,7 @@
 struct lock_context {
 	uint32_t server;
 	uint16_t smbpid;
-	int snum;
+	struct brl_context *ctx;
 };
 
 /* The data in brlock records is an unsorted linear array of these
@@ -66,7 +67,6 @@
 struct brl_context {
 	struct tdb_wrap *w;
 	uint32_t server;
-	int snum;
 	struct messaging_context *messaging_ctx;
 	struct lock_struct last_lock;
 };
@@ -77,7 +77,7 @@
   talloc_free(). We need the messaging_ctx to allow for
   pending lock notifications.
 */
-struct brl_context *brl_init(TALLOC_CTX *mem_ctx, uint32_t server, int snum, 
+struct brl_context *brl_init(TALLOC_CTX *mem_ctx, uint32_t server, 
 			     struct messaging_context *messaging_ctx)
 {
 	char *path;
@@ -98,7 +98,6 @@
 	}
 
 	brl->server = server;
-	brl->snum = snum;
 	brl->messaging_ctx = messaging_ctx;
 	ZERO_STRUCT(brl->last_lock);
 
@@ -113,7 +112,7 @@
 {
 	return (ctx1->server == ctx2->server &&
 		ctx1->smbpid == ctx2->smbpid &&
-		ctx1->snum == ctx2->snum);
+		ctx1->ctx == ctx2->ctx);
 }
 
 /*
@@ -200,7 +199,7 @@
 static NTSTATUS brl_lock_failed(struct brl_context *brl, struct lock_struct *lock)
 {
 	if (lock->context.server == brl->last_lock.context.server &&
-	    lock->context.snum == brl->last_lock.context.snum &&
+	    lock->context.ctx == brl->last_lock.context.ctx &&
 	    lock->fnum == brl->last_lock.fnum &&
 	    lock->start == brl->last_lock.start &&
 	    lock->size == brl->last_lock.size) {
@@ -263,7 +262,7 @@
 
 	lock.context.smbpid = smbpid;
 	lock.context.server = brl->server;
-	lock.context.snum = brl->snum;
+	lock.context.ctx = brl;
 	lock.start = start;
 	lock.size = size;
 	lock.fnum = fnum;
@@ -398,7 +397,7 @@
 
 	context.smbpid = smbpid;
 	context.server = brl->server;
-	context.snum = brl->snum;
+	context.ctx = brl;
 
 	/* there are existing locks - find a match */
 	locks = (struct lock_struct *)dbuf.dptr;
@@ -549,7 +548,7 @@
 
 	lock.context.smbpid = smbpid;
 	lock.context.server = brl->server;
-	lock.context.snum = brl->snum;
+	lock.context.ctx = brl;
 	lock.start = start;
 	lock.size = size;
 	lock.fnum = fnum;
@@ -602,7 +601,7 @@
 	for (i=0; i<count; i++) {
 		struct lock_struct *lock = &locks[i];
 
-		if (lock->context.snum == brl->snum &&
+		if (lock->context.ctx == brl &&
 		    lock->context.server == brl->server &&
 		    lock->fnum == fnum) {
 			/* found it - delete it */

Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c	2006-05-15 10:45:38 UTC (rev 15612)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c	2006-05-15 11:43:25 UTC (rev 15613)
@@ -171,8 +171,7 @@
 	ntvfs->private_data = pvfs;
 
 	pvfs->brl_context = brl_init(pvfs, 
-				     pvfs->ntvfs->ctx->server_id,  
-				     pvfs->ntvfs->ctx->config.snum,
+				     pvfs->ntvfs->ctx->server_id,
 				     pvfs->ntvfs->ctx->msg_ctx);
 	if (pvfs->brl_context == NULL) {
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;



More information about the samba-cvs mailing list