2 Unix SMB/CIFS implementation.
3 Blocking Locking functions
4 Copyright (C) Jeremy Allison 1998-2003
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 extern char *OutBuffer
;
25 /****************************************************************************
26 This is the structure to queue to implement blocking locks.
27 notify. It consists of the requesting SMB and the expiry time.
28 *****************************************************************************/
41 } blocking_lock_record
;
43 static ubi_slList blocking_lock_queue
= { NULL
, (ubi_slNodePtr
)&blocking_lock_queue
, 0};
45 /****************************************************************************
46 Destructor for the above structure.
47 ****************************************************************************/
49 static void free_blocking_lock_record(blocking_lock_record
*blr
)
51 SAFE_FREE(blr
->inbuf
);
55 /****************************************************************************
56 Get the files_struct given a particular queued SMB.
57 *****************************************************************************/
59 static files_struct
*get_fsp_from_pkt(char *inbuf
)
61 switch(CVAL(inbuf
,smb_com
)) {
64 return file_fsp(inbuf
,smb_vwv0
);
66 return file_fsp(inbuf
,smb_vwv2
);
68 DEBUG(0,("get_fsp_from_pkt: PANIC - unknown type on blocking lock queue - exiting.!\n"));
69 exit_server("PANIC - unknown type on blocking lock queue");
71 return NULL
; /* Keep compiler happy. */
74 /****************************************************************************
75 Determine if this is a secondary element of a chained SMB.
76 **************************************************************************/
78 static BOOL
in_chained_smb(void)
80 return (chain_size
!= 0);
83 static void received_unlock_msg(int msg_type
, pid_t src
, void *buf
, size_t len
);
85 /****************************************************************************
86 Function to push a blocking lock request onto the lock queue.
87 ****************************************************************************/
89 BOOL
push_blocking_lock_request( char *inbuf
, int length
, int lock_timeout
,
90 int lock_num
, uint16 lock_pid
, SMB_BIG_UINT offset
, SMB_BIG_UINT count
)
92 static BOOL set_lock_msg
;
93 blocking_lock_record
*blr
;
94 BOOL my_lock_ctx
= False
;
97 if(in_chained_smb() ) {
98 DEBUG(0,("push_blocking_lock_request: cannot queue a chained request (currently).\n"));
103 * Now queue an entry on the blocking lock queue. We setup
104 * the expiration time here.
107 if((blr
= (blocking_lock_record
*)malloc(sizeof(blocking_lock_record
))) == NULL
) {
108 DEBUG(0,("push_blocking_lock_request: Malloc fail !\n" ));
112 if((blr
->inbuf
= (char *)malloc(length
)) == NULL
) {
113 DEBUG(0,("push_blocking_lock_request: Malloc fail (2)!\n" ));
118 blr
->com_type
= CVAL(inbuf
,smb_com
);
119 blr
->fsp
= get_fsp_from_pkt(inbuf
);
120 blr
->expire_time
= (lock_timeout
== -1) ? (time_t)-1 : time(NULL
) + (time_t)lock_timeout
;
121 blr
->lock_num
= lock_num
;
122 blr
->lock_pid
= lock_pid
;
123 blr
->offset
= offset
;
125 memcpy(blr
->inbuf
, inbuf
, length
);
126 blr
->length
= length
;
128 /* Add a pending lock record for this. */
129 status
= brl_lock(blr
->fsp
->dev
, blr
->fsp
->inode
, blr
->fsp
->fnum
,
130 lock_pid
, sys_getpid(), blr
->fsp
->conn
->cnum
,
131 offset
, count
, PENDING_LOCK
, &my_lock_ctx
);
133 if (!NT_STATUS_IS_OK(status
)) {
134 DEBUG(0,("push_blocking_lock_request: failed to add PENDING_LOCK record.\n"));
135 free_blocking_lock_record(blr
);
139 ubi_slAddTail(&blocking_lock_queue
, blr
);
141 /* Ensure we'll receive messages when this is unlocked. */
143 message_register(MSG_SMB_UNLOCK
, received_unlock_msg
);
147 DEBUG(3,("push_blocking_lock_request: lock request length=%d blocked with expiry time %d (+%d) \
148 for fnum = %d, name = %s\n", length
, (int)blr
->expire_time
, lock_timeout
,
149 blr
->fsp
->fnum
, blr
->fsp
->fsp_name
));
151 /* Push the MID of this packet on the signing queue. */
152 srv_defer_sign_response(SVAL(inbuf
,smb_mid
));
157 /****************************************************************************
158 Return a smd with a given size.
159 *****************************************************************************/
161 static void send_blocking_reply(char *outbuf
, int outsize
)
164 smb_setlen(outbuf
,outsize
- 4);
166 if (!send_smb(smbd_server_fd(),outbuf
))
167 exit_server("send_blocking_reply: send_smb failed.");
170 /****************************************************************************
171 Return a lockingX success SMB.
172 *****************************************************************************/
174 static void reply_lockingX_success(blocking_lock_record
*blr
)
176 char *outbuf
= OutBuffer
;
177 int bufsize
= BUFFER_SIZE
;
178 char *inbuf
= blr
->inbuf
;
181 construct_reply_common(inbuf
, outbuf
);
182 set_message(outbuf
,2,0,True
);
185 * As this message is a lockingX call we must handle
186 * any following chained message correctly.
187 * This is normally handled in construct_reply(),
188 * but as that calls switch_message, we can't use
189 * that here and must set up the chain info manually.
192 outsize
= chain_reply(inbuf
,outbuf
,blr
->length
,bufsize
);
194 outsize
+= chain_size
;
196 send_blocking_reply(outbuf
,outsize
);
199 /****************************************************************************
200 Return a generic lock fail error blocking call.
201 *****************************************************************************/
203 static void generic_blocking_lock_error(blocking_lock_record
*blr
, NTSTATUS status
)
205 char *outbuf
= OutBuffer
;
206 char *inbuf
= blr
->inbuf
;
207 construct_reply_common(inbuf
, outbuf
);
209 /* whenever a timeout is given w2k maps LOCK_NOT_GRANTED to
210 FILE_LOCK_CONFLICT! (tridge) */
211 if (NT_STATUS_EQUAL(status
, NT_STATUS_LOCK_NOT_GRANTED
)) {
212 status
= NT_STATUS_FILE_LOCK_CONFLICT
;
216 if (!send_smb(smbd_server_fd(),outbuf
))
217 exit_server("generic_blocking_lock_error: send_smb failed.");
220 /****************************************************************************
221 Return a lock fail error for a lockingX call. Undo all the locks we have
223 *****************************************************************************/
225 static void reply_lockingX_error(blocking_lock_record
*blr
, NTSTATUS status
)
227 char *inbuf
= blr
->inbuf
;
228 files_struct
*fsp
= blr
->fsp
;
229 connection_struct
*conn
= conn_find(SVAL(inbuf
,smb_tid
));
230 uint16 num_ulocks
= SVAL(inbuf
,smb_vwv6
);
231 SMB_BIG_UINT count
= (SMB_BIG_UINT
)0, offset
= (SMB_BIG_UINT
) 0;
233 unsigned char locktype
= CVAL(inbuf
,smb_vwv3
);
234 BOOL large_file_format
= (locktype
& LOCKING_ANDX_LARGE_FILES
);
238 data
= smb_buf(inbuf
) + ((large_file_format
? 20 : 10)*num_ulocks
);
241 * Data now points at the beginning of the list
242 * of smb_lkrng structs.
246 * Ensure we don't do a remove on the lock that just failed,
247 * as under POSIX rules, if we have a lock already there, we
248 * will delete it (and we shouldn't) .....
251 for(i
= blr
->lock_num
- 1; i
>= 0; i
--) {
254 lock_pid
= get_lock_pid( data
, i
, large_file_format
);
255 count
= get_lock_count( data
, i
, large_file_format
);
256 offset
= get_lock_offset( data
, i
, large_file_format
, &err
);
259 * We know err cannot be set as if it was the lock
260 * request would never have been queued. JRA.
263 do_unlock(fsp
,conn
,lock_pid
,count
,offset
);
266 generic_blocking_lock_error(blr
, status
);
269 /****************************************************************************
270 Return a lock fail error.
271 *****************************************************************************/
273 static void blocking_lock_reply_error(blocking_lock_record
*blr
, NTSTATUS status
)
275 switch(blr
->com_type
) {
278 generic_blocking_lock_error(blr
, status
);
281 reply_lockingX_error(blr
, status
);
284 DEBUG(0,("blocking_lock_reply_error: PANIC - unknown type on blocking lock queue - exiting.!\n"));
285 exit_server("PANIC - unknown type on blocking lock queue");
289 /****************************************************************************
290 Attempt to finish off getting all pending blocking locks for a lockread call.
291 Returns True if we want to be removed from the list.
292 *****************************************************************************/
294 static BOOL
process_lockread(blocking_lock_record
*blr
)
296 char *outbuf
= OutBuffer
;
297 char *inbuf
= blr
->inbuf
;
301 SMB_BIG_UINT startpos
;
304 connection_struct
*conn
= conn_find(SVAL(inbuf
,smb_tid
));
305 files_struct
*fsp
= blr
->fsp
;
306 BOOL my_lock_ctx
= False
;
308 numtoread
= SVAL(inbuf
,smb_vwv1
);
309 startpos
= (SMB_BIG_UINT
)IVAL(inbuf
,smb_vwv2
);
311 numtoread
= MIN(BUFFER_SIZE
-outsize
,numtoread
);
312 data
= smb_buf(outbuf
) + 3;
314 status
= do_lock_spin( fsp
, conn
, SVAL(inbuf
,smb_pid
), (SMB_BIG_UINT
)numtoread
, startpos
, READ_LOCK
, &my_lock_ctx
);
315 if (NT_STATUS_V(status
)) {
316 if (!NT_STATUS_EQUAL(status
,NT_STATUS_LOCK_NOT_GRANTED
) &&
317 !NT_STATUS_EQUAL(status
,NT_STATUS_FILE_LOCK_CONFLICT
)) {
319 * We have other than a "can't get lock"
320 * error. Send an error.
321 * Return True so we get dequeued.
323 generic_blocking_lock_error(blr
, status
);
328 * Still waiting for lock....
331 DEBUG(10,("process_lockread: failed to get lock for file = %s. Still waiting....\n",
336 nread
= read_file(fsp
,data
,startpos
,numtoread
);
339 generic_blocking_lock_error(blr
,NT_STATUS_ACCESS_DENIED
);
343 construct_reply_common(inbuf
, outbuf
);
344 outsize
= set_message(outbuf
,5,0,True
);
347 SSVAL(outbuf
,smb_vwv0
,nread
);
348 SSVAL(outbuf
,smb_vwv5
,nread
+3);
351 SSVAL(p
,0,nread
); p
+= 2;
352 set_message_end(outbuf
, p
+nread
);
354 DEBUG(3, ( "process_lockread file = %s, fnum=%d num=%d nread=%d\n",
355 fsp
->fsp_name
, fsp
->fnum
, (int)numtoread
, (int)nread
) );
357 send_blocking_reply(outbuf
,outsize
);
361 /****************************************************************************
362 Attempt to finish off getting all pending blocking locks for a lock call.
363 Returns True if we want to be removed from the list.
364 *****************************************************************************/
366 static BOOL
process_lock(blocking_lock_record
*blr
)
368 char *outbuf
= OutBuffer
;
369 char *inbuf
= blr
->inbuf
;
371 SMB_BIG_UINT count
= (SMB_BIG_UINT
)0, offset
= (SMB_BIG_UINT
)0;
373 connection_struct
*conn
= conn_find(SVAL(inbuf
,smb_tid
));
374 files_struct
*fsp
= blr
->fsp
;
375 BOOL my_lock_ctx
= False
;
377 count
= IVAL_TO_SMB_OFF_T(inbuf
,smb_vwv1
);
378 offset
= IVAL_TO_SMB_OFF_T(inbuf
,smb_vwv3
);
381 status
= do_lock_spin(fsp
, conn
, SVAL(inbuf
,smb_pid
), count
, offset
, WRITE_LOCK
, &my_lock_ctx
);
382 if (NT_STATUS_IS_ERR(status
)) {
383 if (!NT_STATUS_EQUAL(status
,NT_STATUS_LOCK_NOT_GRANTED
) &&
384 !NT_STATUS_EQUAL(status
,NT_STATUS_FILE_LOCK_CONFLICT
)) {
386 * We have other than a "can't get lock"
387 * error. Send an error.
388 * Return True so we get dequeued.
391 blocking_lock_reply_error(blr
, status
);
395 * Still can't get the lock - keep waiting.
397 DEBUG(10,("process_lock: failed to get lock for file = %s. Still waiting....\n",
403 * Success - we got the lock.
406 DEBUG(3,("process_lock : file=%s fnum=%d offset=%.0f count=%.0f\n",
407 fsp
->fsp_name
, fsp
->fnum
, (double)offset
, (double)count
));
409 construct_reply_common(inbuf
, outbuf
);
410 outsize
= set_message(outbuf
,0,0,True
);
411 send_blocking_reply(outbuf
,outsize
);
415 /****************************************************************************
416 Attempt to finish off getting all pending blocking locks for a lockingX call.
417 Returns True if we want to be removed from the list.
418 *****************************************************************************/
420 static BOOL
process_lockingX(blocking_lock_record
*blr
)
422 char *inbuf
= blr
->inbuf
;
423 unsigned char locktype
= CVAL(inbuf
,smb_vwv3
);
424 files_struct
*fsp
= blr
->fsp
;
425 connection_struct
*conn
= conn_find(SVAL(inbuf
,smb_tid
));
426 uint16 num_ulocks
= SVAL(inbuf
,smb_vwv6
);
427 uint16 num_locks
= SVAL(inbuf
,smb_vwv7
);
428 SMB_BIG_UINT count
= (SMB_BIG_UINT
)0, offset
= (SMB_BIG_UINT
)0;
430 BOOL large_file_format
= (locktype
& LOCKING_ANDX_LARGE_FILES
);
432 BOOL my_lock_ctx
= False
;
433 NTSTATUS status
= NT_STATUS_OK
;
435 data
= smb_buf(inbuf
) + ((large_file_format
? 20 : 10)*num_ulocks
);
438 * Data now points at the beginning of the list
439 * of smb_lkrng structs.
442 for(; blr
->lock_num
< num_locks
; blr
->lock_num
++) {
445 lock_pid
= get_lock_pid( data
, blr
->lock_num
, large_file_format
);
446 count
= get_lock_count( data
, blr
->lock_num
, large_file_format
);
447 offset
= get_lock_offset( data
, blr
->lock_num
, large_file_format
, &err
);
450 * We know err cannot be set as if it was the lock
451 * request would never have been queued. JRA.
454 status
= do_lock_spin(fsp
,conn
,lock_pid
,count
,offset
,
455 ((locktype
& 1) ? READ_LOCK
: WRITE_LOCK
), &my_lock_ctx
);
456 if (NT_STATUS_IS_ERR(status
)) break;
459 if(blr
->lock_num
== num_locks
) {
461 * Success - we got all the locks.
464 DEBUG(3,("process_lockingX file = %s, fnum=%d type=%d num_locks=%d\n",
465 fsp
->fsp_name
, fsp
->fnum
, (unsigned int)locktype
, num_locks
) );
467 reply_lockingX_success(blr
);
469 } else if (!NT_STATUS_EQUAL(status
,NT_STATUS_LOCK_NOT_GRANTED
) &&
470 !NT_STATUS_EQUAL(status
,NT_STATUS_FILE_LOCK_CONFLICT
)) {
472 * We have other than a "can't get lock"
473 * error. Free any locks we had and return an error.
474 * Return True so we get dequeued.
477 blocking_lock_reply_error(blr
, status
);
482 * Still can't get all the locks - keep waiting.
485 DEBUG(10,("process_lockingX: only got %d locks of %d needed for file %s, fnum = %d. \
487 blr
->lock_num
, num_locks
, fsp
->fsp_name
, fsp
->fnum
));
492 /****************************************************************************
493 Process a blocking lock SMB.
494 Returns True if we want to be removed from the list.
495 *****************************************************************************/
497 static BOOL
blocking_lock_record_process(blocking_lock_record
*blr
)
499 switch(blr
->com_type
) {
501 return process_lock(blr
);
503 return process_lockread(blr
);
505 return process_lockingX(blr
);
507 DEBUG(0,("blocking_lock_record_process: PANIC - unknown type on blocking lock queue - exiting.!\n"));
508 exit_server("PANIC - unknown type on blocking lock queue");
510 return False
; /* Keep compiler happy. */
513 /****************************************************************************
514 Delete entries by fnum from the blocking lock pending queue.
515 *****************************************************************************/
517 void remove_pending_lock_requests_by_fid(files_struct
*fsp
)
519 blocking_lock_record
*blr
= (blocking_lock_record
*)ubi_slFirst( &blocking_lock_queue
);
520 blocking_lock_record
*prev
= NULL
;
523 if(blr
->fsp
->fnum
== fsp
->fnum
) {
525 DEBUG(10,("remove_pending_lock_requests_by_fid - removing request type %d for \
526 file %s fnum = %d\n", blr
->com_type
, fsp
->fsp_name
, fsp
->fnum
));
528 brl_unlock(blr
->fsp
->dev
, blr
->fsp
->inode
, blr
->fsp
->fnum
,
529 blr
->lock_pid
, sys_getpid(), blr
->fsp
->conn
->cnum
,
530 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
532 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
533 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
538 blr
= (blocking_lock_record
*)ubi_slNext(blr
);
542 /****************************************************************************
543 Delete entries by mid from the blocking lock pending queue. Always send reply.
544 *****************************************************************************/
546 void remove_pending_lock_requests_by_mid(int mid
)
548 blocking_lock_record
*blr
= (blocking_lock_record
*)ubi_slFirst( &blocking_lock_queue
);
549 blocking_lock_record
*prev
= NULL
;
552 if(SVAL(blr
->inbuf
,smb_mid
) == mid
) {
553 files_struct
*fsp
= blr
->fsp
;
555 DEBUG(10,("remove_pending_lock_requests_by_mid - removing request type %d for \
556 file %s fnum = %d\n", blr
->com_type
, fsp
->fsp_name
, fsp
->fnum
));
558 blocking_lock_reply_error(blr
,NT_STATUS_FILE_LOCK_CONFLICT
);
559 brl_unlock(blr
->fsp
->dev
, blr
->fsp
->inode
, blr
->fsp
->fnum
,
560 blr
->lock_pid
, sys_getpid(), blr
->fsp
->conn
->cnum
,
561 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
562 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
563 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
568 blr
= (blocking_lock_record
*)ubi_slNext(blr
);
572 /****************************************************************************
573 Set a flag as an unlock request affects one of our pending locks.
574 *****************************************************************************/
576 static void received_unlock_msg(int msg_type
, pid_t src
, void *buf
, size_t len
)
578 DEBUG(10,("received_unlock_msg\n"));
579 process_blocking_lock_queue(time(NULL
));
582 /****************************************************************************
583 Return the number of seconds to the next blocking locks timeout, or default_timeout
584 *****************************************************************************/
586 unsigned blocking_locks_timeout(unsigned default_timeout
)
588 unsigned timeout
= default_timeout
;
590 blocking_lock_record
*blr
= (blocking_lock_record
*)ubi_slFirst(&blocking_lock_queue
);
592 /* note that we avoid the time() syscall if there are no blocking locks */
599 if ((blr
->expire_time
!= (time_t)-1) &&
600 (timeout
> (blr
->expire_time
- t
))) {
601 timeout
= blr
->expire_time
- t
;
603 blr
= (blocking_lock_record
*)ubi_slNext(blr
);
612 /****************************************************************************
613 Process the blocking lock queue. Note that this is only called as root.
614 *****************************************************************************/
616 void process_blocking_lock_queue(time_t t
)
618 blocking_lock_record
*blr
= (blocking_lock_record
*)ubi_slFirst( &blocking_lock_queue
);
619 blocking_lock_record
*prev
= NULL
;
625 * Go through the queue and see if we can get any of the locks.
629 connection_struct
*conn
= NULL
;
631 files_struct
*fsp
= NULL
;
634 * Ensure we don't have any old chain_fsp values
641 conn
= conn_find(SVAL(blr
->inbuf
,smb_tid
));
642 vuid
= (lp_security() == SEC_SHARE
) ? UID_FIELD_INVALID
:
643 SVAL(blr
->inbuf
,smb_uid
);
645 DEBUG(5,("process_blocking_lock_queue: examining pending lock fnum = %d for file %s\n",
646 fsp
->fnum
, fsp
->fsp_name
));
648 if((blr
->expire_time
!= -1) && (blr
->expire_time
<= t
)) {
650 * Lock expired - throw away all previously
651 * obtained locks and return lock error.
653 DEBUG(5,("process_blocking_lock_queue: pending lock fnum = %d for file %s timed out.\n",
654 fsp
->fnum
, fsp
->fsp_name
));
656 brl_unlock(fsp
->dev
, fsp
->inode
, fsp
->fnum
,
657 blr
->lock_pid
, sys_getpid(), conn
->cnum
,
658 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
660 blocking_lock_reply_error(blr
,NT_STATUS_FILE_LOCK_CONFLICT
);
661 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
662 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
666 if(!change_to_user(conn
,vuid
)) {
667 DEBUG(0,("process_blocking_lock_queue: Unable to become user vuid=%d.\n",
670 * Remove the entry and return an error to the client.
672 blocking_lock_reply_error(blr
,NT_STATUS_ACCESS_DENIED
);
674 brl_unlock(fsp
->dev
, fsp
->inode
, fsp
->fnum
,
675 blr
->lock_pid
, sys_getpid(), conn
->cnum
,
676 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
678 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
679 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
683 if(!set_current_service(conn
,True
)) {
684 DEBUG(0,("process_blocking_lock_queue: Unable to become service Error was %s.\n", strerror(errno
) ));
686 * Remove the entry and return an error to the client.
688 blocking_lock_reply_error(blr
,NT_STATUS_ACCESS_DENIED
);
690 brl_unlock(fsp
->dev
, fsp
->inode
, fsp
->fnum
,
691 blr
->lock_pid
, sys_getpid(), conn
->cnum
,
692 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
694 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
695 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
696 change_to_root_user();
701 * Go through the remaining locks and try and obtain them.
702 * The call returns True if all locks were obtained successfully
703 * and False if we still need to wait.
706 if(blocking_lock_record_process(blr
)) {
708 brl_unlock(fsp
->dev
, fsp
->inode
, fsp
->fnum
,
709 blr
->lock_pid
, sys_getpid(), conn
->cnum
,
710 blr
->offset
, blr
->count
, True
, NULL
, NULL
);
712 free_blocking_lock_record((blocking_lock_record
*)ubi_slRemNext( &blocking_lock_queue
, prev
));
713 blr
= (blocking_lock_record
*)(prev
? ubi_slNext(prev
) : ubi_slFirst(&blocking_lock_queue
));
714 change_to_root_user();
718 change_to_root_user();
721 * Move to the next in the list.
724 blr
= (blocking_lock_record
*)ubi_slNext(blr
);