summaryrefslogtreecommitdiffstats
path: root/source3/locking/locking.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-17 03:52:05 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-17 03:52:05 +0000
commit8978aae69699ccab76fdf95037948b1cc7e7c286 (patch)
tree19d2fdbc1da4d4353d226a81960f500ac06c0359 /source3/locking/locking.c
parentf2d538a105a61ce6d2852700fc328e15ac158827 (diff)
downloadsamba-8978aae69699ccab76fdf95037948b1cc7e7c286.tar.gz
samba-8978aae69699ccab76fdf95037948b1cc7e7c286.tar.xz
samba-8978aae69699ccab76fdf95037948b1cc7e7c286.zip
much cleaner chain pointer handling for both files and pipes.
the chain pointer is now stored as a static and is set whenever a handle is created or extracted. This also makes the code less error prone. (This used to be commit 068a862982bea726e8d7b1b4065d510b9840a272)
Diffstat (limited to 'source3/locking/locking.c')
-rw-r--r--source3/locking/locking.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index cdaeea6d7e..8737a12e17 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -61,7 +61,7 @@ static ubi_slList blocking_lock_queue = { NULL, (ubi_slNodePtr)&blocking_lock_qu
BOOL push_blocking_lock_request( char *inbuf, int length, int lock_timeout, int lock_num)
{
blocking_lock_record *blr;
- files_struct *fsp = GETFSP(inbuf,smb_vwv2);
+ files_struct *fsp = file_fsp(inbuf,smb_vwv2);
/*
* Now queue an entry on the blocking lock queue. We setup
@@ -98,12 +98,11 @@ for fnum = %d, name = %s\n", blr->expire_time, fsp->fnum, fsp->name ));
static void blocking_lock_reply_success(blocking_lock_record *blr)
{
extern int chain_size;
- extern files_struct *chain_fsp;
extern char *OutBuffer;
char *outbuf = OutBuffer;
int bufsize = BUFFER_SIZE;
char *inbuf = blr->inbuf;
- files_struct *fsp = GETFSP(inbuf,smb_vwv2);
+ files_struct *fsp = file_fsp(inbuf,smb_vwv2);
int outsize = 0;
construct_reply_common(inbuf, outbuf);
@@ -117,7 +116,7 @@ static void blocking_lock_reply_success(blocking_lock_record *blr)
* that here and must set up the chain info manually.
*/
- chain_fsp = fsp;
+ file_set_chain(fsp);
chain_size = 0;
outsize = chain_reply(inbuf,outbuf,blr->length,bufsize);
@@ -140,7 +139,7 @@ static void blocking_lock_reply_error(blocking_lock_record *blr, int eclass, int
char *outbuf = OutBuffer;
int bufsize = BUFFER_SIZE;
char *inbuf = blr->inbuf;
- files_struct *fsp = GETFSP(inbuf,smb_vwv2);
+ files_struct *fsp = file_fsp(inbuf,smb_vwv2);
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
uint16 num_locks = SVAL(inbuf,smb_vwv7);
uint32 count, offset;
@@ -175,7 +174,7 @@ static BOOL blocking_lock_record_process(blocking_lock_record *blr)
{
char *inbuf = blr->inbuf;
unsigned char locktype = CVAL(inbuf,smb_vwv3);
- files_struct *fsp = GETFSP(inbuf,smb_vwv2);
+ files_struct *fsp = file_fsp(inbuf,smb_vwv2);
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
uint16 num_locks = SVAL(inbuf,smb_vwv7);
uint32 count, offset;
@@ -250,7 +249,7 @@ void process_blocking_lock_queue(time_t t)
*/
while(blr != NULL) {
- files_struct *fsp = GETFSP(blr->inbuf,smb_vwv2);
+ files_struct *fsp = file_fsp(blr->inbuf,smb_vwv2);
uint16 vuid = (lp_security() == SEC_SHARE) ? UID_FIELD_INVALID :
SVAL(blr->inbuf,smb_uid);