From aab2fe021643417854451c65e564932f4ac25f10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Sep 1998 01:48:45 +0000 Subject: 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) --- source3/smbd/open.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'source3/smbd/open.c') 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); } -- cgit