summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-14 00:50:48 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-14 00:50:48 +0000
commit2afd5d5eb5c176f09a9f4f00ea3b517e89ef0ddf (patch)
treee217622062ac847e81b944e1bf111f67c1c75c2a /source3/locking
parentcdb8c99fce9b24d18f664f9ed42062f8a945e395 (diff)
downloadsamba-2afd5d5eb5c176f09a9f4f00ea3b517e89ef0ddf.tar.gz
samba-2afd5d5eb5c176f09a9f4f00ea3b517e89ef0ddf.tar.bz2
samba-2afd5d5eb5c176f09a9f4f00ea3b517e89ef0ddf.zip
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)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index a0d140bffd..e95ec08c58 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);
}