summaryrefslogtreecommitdiffstats
path: root/source3/smbd/oplock.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1999-12-21 09:25:59 +0000
committerAndrew Tridgell <tridge@samba.org>1999-12-21 09:25:59 +0000
commit4e1291a83f61a72989045879763d9ef05fd38f71 (patch)
tree0711bf9c940e930c327f9a5a00d65dd6ec1a8ae9 /source3/smbd/oplock.c
parent69d24d869bf97978b31a51fe8e8d08cac4874d67 (diff)
downloadsamba-4e1291a83f61a72989045879763d9ef05fd38f71.tar.gz
samba-4e1291a83f61a72989045879763d9ef05fd38f71.tar.xz
samba-4e1291a83f61a72989045879763d9ef05fd38f71.zip
converted all our existing shared memory code to use a tdb database
instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
Diffstat (limited to 'source3/smbd/oplock.c')
-rw-r--r--source3/smbd/oplock.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index a64dd2d0efc..c5cab8c2252 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -406,13 +406,12 @@ static void downgrade_file_oplock(files_struct *fsp)
BOOL remove_oplock(files_struct *fsp)
{
- int token;
SMB_DEV_T dev = fsp->fd_ptr->dev;
SMB_INO_T inode = fsp->fd_ptr->inode;
BOOL ret = True;
/* Remove the oplock flag from the sharemode. */
- if (lock_share_entry(fsp->conn, dev, inode, &token) == False) {
+ if (lock_share_entry(fsp->conn, dev, inode) == False) {
DEBUG(0,("remove_oplock: failed to lock share entry for file %s\n",
fsp->fsp_name ));
ret = False;
@@ -424,7 +423,7 @@ BOOL remove_oplock(files_struct *fsp)
* Deal with a reply when a break-to-none was sent.
*/
- if(remove_share_oplock(token, fsp)==False) {
+ if(remove_share_oplock(fsp)==False) {
DEBUG(0,("remove_oplock: failed to remove share oplock for file %s fnum %d, \
dev = %x, inode = %.0f\n", fsp->fsp_name, fsp->fnum, (unsigned int)dev, (double)inode));
ret = False;
@@ -438,7 +437,7 @@ dev = %x, inode = %.0f\n", fsp->fsp_name, fsp->fnum, (unsigned int)dev, (double)
* Deal with a reply when a break-to-level II was sent.
*/
- if(downgrade_share_oplock(token, fsp)==False) {
+ if(downgrade_share_oplock(fsp)==False) {
DEBUG(0,("remove_oplock: failed to downgrade share oplock for file %s fnum %d, \
dev = %x, inode = %.0f\n", fsp->fsp_name, fsp->fnum, (unsigned int)dev, (double)inode));
ret = False;
@@ -447,7 +446,7 @@ dev = %x, inode = %.0f\n", fsp->fsp_name, fsp->fnum, (unsigned int)dev, (double)
downgrade_file_oplock(fsp);
}
- unlock_share_entry(fsp->conn, dev, inode, token);
+ unlock_share_entry(fsp->conn, dev, inode);
return ret;
}
@@ -792,18 +791,18 @@ BOOL oplock_break_level2(files_struct *fsp, BOOL local_request, int token)
* the existing lock on the shared memory area.
*/
- if(!local_request && lock_share_entry(fsp->conn, dev, inode, &token) == False) {
+ if(!local_request && lock_share_entry(fsp->conn, dev, inode) == False) {
DEBUG(0,("oplock_break_level2: unable to lock share entry for file %s\n", fsp->fsp_name ));
} else {
got_lock = True;
}
- if(remove_share_oplock(token, fsp)==False) {
+ if(remove_share_oplock(fsp)==False) {
DEBUG(0,("oplock_break_level2: unable to remove level II oplock for file %s\n", fsp->fsp_name ));
}
if (!local_request && got_lock)
- unlock_share_entry(fsp->conn, dev, inode, token);
+ unlock_share_entry(fsp->conn, dev, inode);
fsp->oplock_type = NO_OPLOCK;
level_II_oplocks_open--;