summaryrefslogtreecommitdiffstats
path: root/source/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-09 01:07:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:34 -0500
commit596f23051363f8cc8896119b3eca0663a61a38c3 (patch)
treeb223656e28b24dbb60f1a56dd83a38b4d7b7f4f5 /source/locking
parent1feda3649fa5dd7233ea66057fc431948c87825b (diff)
downloadsamba-596f23051363f8cc8896119b3eca0663a61a38c3.tar.gz
samba-596f23051363f8cc8896119b3eca0663a61a38c3.tar.xz
samba-596f23051363f8cc8896119b3eca0663a61a38c3.zip
r4108: As check_self is *always* False in every invokation, remove the
logic for it. We still pass Samba4 RAW-LOCK test. Jeremy.
Diffstat (limited to 'source/locking')
-rw-r--r--source/locking/brlock.c17
-rw-r--r--source/locking/locking.c7
2 files changed, 8 insertions, 16 deletions
diff --git a/source/locking/brlock.c b/source/locking/brlock.c
index d92027e267a..3451b0cc1ab 100644
--- a/source/locking/brlock.c
+++ b/source/locking/brlock.c
@@ -592,7 +592,7 @@ BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
uint16 smbpid, pid_t pid, uint16 tid,
br_off start, br_off size,
- enum brl_type lock_type, int check_self)
+ enum brl_type lock_type)
{
TDB_DATA kbuf, dbuf;
int count, i;
@@ -617,16 +617,11 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
locks = (struct lock_struct *)dbuf.dptr;
count = dbuf.dsize / sizeof(*locks);
for (i=0; i<count; i++) {
- if (check_self) {
- if (brl_conflict(&locks[i], &lock))
- goto fail;
- } else {
- /*
- * Our own locks don't conflict.
- */
- if (brl_conflict_other(&locks[i], &lock))
- goto fail;
- }
+ /*
+ * Our own locks don't conflict.
+ */
+ if (brl_conflict_other(&locks[i], &lock))
+ goto fail;
}
}
diff --git a/source/locking/locking.c b/source/locking/locking.c
index b2f30a56843..b6e2ced3360 100644
--- a/source/locking/locking.c
+++ b/source/locking/locking.c
@@ -62,14 +62,11 @@ static const char *lock_type_name(enum brl_type lock_type)
/****************************************************************************
Utility function called to see if a file region is locked.
- If check_self is True, then checks on our own fd with the same locking context
- are still made. If check_self is False, then checks are not made on our own fd
- with the same locking context are not made.
****************************************************************************/
BOOL is_locked(files_struct *fsp,connection_struct *conn,
SMB_BIG_UINT count,SMB_BIG_UINT offset,
- enum brl_type lock_type, BOOL check_self)
+ enum brl_type lock_type)
{
int snum = SNUM(conn);
BOOL ret;
@@ -82,7 +79,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn,
ret = !brl_locktest(fsp->dev, fsp->inode, fsp->fnum,
global_smbpid, sys_getpid(), conn->cnum,
- offset, count, lock_type, check_self);
+ offset, count, lock_type);
DEBUG(10,("is_locked: brl start=%.0f len=%.0f %s for file %s\n",
(double)offset, (double)count, ret ? "locked" : "unlocked",