From 2afd5d5eb5c176f09a9f4f00ea3b517e89ef0ddf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 14 Jan 2000 00:50:48 +0000 Subject: some more work on the byte range locking note the ugly global_smbpid - I hope that won't bethere for long, I just didn't want to do two lots of major surgery at the one time. Using global_smbpid avoids the big change of getting rid of our inbuf/outbuf interface to reply routines. I'll do that once the locking stuff passes all tests. (This used to be commit f8bebf91abcaa5bda3ec8701f9242f220da8943a) --- source3/locking/locking.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index a0d140bffdd..e95ec08c58b 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -38,6 +38,8 @@ extern int DEBUGLEVEL; /* the locking database handle */ static TDB_CONTEXT *tdb; +int global_smbpid; + /**************************************************************************** Utility function called to see if a file region is locked. ****************************************************************************/ @@ -53,8 +55,8 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn, if (!lp_locking(snum) || !lp_strict_locking(snum)) return(False); - return !brl_locktest(fsp->fd_ptr->inode, fsp->fd_ptr->dev, - 1, getpid(), conn->cnum, + return !brl_locktest(fsp->fd_ptr->dev, fsp->fd_ptr->inode, + global_smbpid, getpid(), conn->cnum, offset, count, lock_type); } @@ -81,8 +83,8 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn, lock_type, (double)offset, (double)count, fsp->fsp_name )); if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) { - ok = brl_lock(fsp->fd_ptr->inode, fsp->fd_ptr->dev, - 1, getpid(), conn->cnum, + ok = brl_lock(fsp->fd_ptr->dev, fsp->fd_ptr->inode, + global_smbpid, getpid(), conn->cnum, offset, count, lock_type); } @@ -112,8 +114,8 @@ BOOL do_unlock(files_struct *fsp,connection_struct *conn, (double)offset, (double)count, fsp->fsp_name )); if (OPEN_FSP(fsp) && fsp->can_lock && (fsp->conn == conn)) { - ok = brl_unlock(fsp->fd_ptr->inode, fsp->fd_ptr->dev, - 1, getpid(), conn->cnum, + ok = brl_unlock(fsp->fd_ptr->dev, fsp->fd_ptr->inode, + global_smbpid, getpid(), conn->cnum, offset, count); } -- cgit