summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-23 01:48:45 +0000
committerJeremy Allison <jra@samba.org>1998-09-23 01:48:45 +0000
commitaab2fe021643417854451c65e564932f4ac25f10 (patch)
tree2377d1c7ea68759507f471beb1ab1d101a067552 /source3/smbd/open.c
parent3b7cee95ac741ee24b8edd36095cc30e3377a23c (diff)
downloadsamba-aab2fe021643417854451c65e564932f4ac25f10.tar.gz
samba-aab2fe021643417854451c65e564932f4ac25f10.tar.bz2
samba-aab2fe021643417854451c65e564932f4ac25f10.zip
First cut at kernel oplocks. This should have no effect unless runnin
on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy. (This used to be commit c3c5e13f85c97939746070132dad941e79c546fb)
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0d8fcddbe5..64f28ddfe2 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -24,8 +24,7 @@
extern int DEBUGLEVEL;
extern pstring sesssetup_user;
-extern int global_oplocks_open;
-extern uint16 oplock_port;
+extern uint16 global_oplock_port;
/****************************************************************************
@@ -917,38 +916,23 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou
if (lp_share_modes(SNUM(conn)))
{
uint16 port = 0;
+
/* JRA. Currently this only services Exlcusive and batch
oplocks (no other opens on this file). This needs to
be extended to level II oplocks (multiple reader
oplocks). */
if((oplock_request) && (num_share_modes == 0) && lp_oplocks(SNUM(conn)) &&
- !IS_VETO_OPLOCK_PATH(conn,fname))
+ !IS_VETO_OPLOCK_PATH(conn,fname) && set_file_oplock(fsp) )
{
-#if defined(HAVE_KERNEL_OPLOCKS)
- /*
- * Try and get a *real* oplock on this file.
- * If we fail, set the port and oplock request to
- * zero so that we don't tell other SMB's that we
- * got an oplock.
- */
- if(lp_kernel_oplocks())
-#endif /* HAVE_KERNEL_OPLOCKS */
-
- fsp->granted_oplock = True;
- fsp->sent_oplock_break = False;
- global_oplocks_open++;
- port = oplock_port;
-
- DEBUG(5,("open_file_shared: granted oplock (%x) on file %s, \
-dev = %x, inode = %.0f\n", oplock_request, fname, (unsigned int)dev, (double)inode));
-
+ port = global_oplock_port;
}
else
{
port = 0;
oplock_request = 0;
}
+
set_share_mode(token, fsp, port, oplock_request);
}