diff options
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r-- | source3/smbd/open.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 4491082b2c..a940eda85d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -602,7 +602,7 @@ static void truncate_unless_locked(files_struct *fsp, connection_struct *conn, i have the share entry locked. Unlock it before closing. */ if (*share_locked && lp_share_modes(SNUM(conn))) unlock_share_entry( conn, fsp->fd_ptr->dev, - fsp->fd_ptr->inode, token); + fsp->fd_ptr->inode); close_file(fsp,False); /* Share mode no longer locked. */ *share_locked = False; @@ -858,9 +858,9 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int { dev = sbuf.st_dev; inode = sbuf.st_ino; - lock_share_entry(conn, dev, inode, &token); + lock_share_entry(conn, dev, inode); share_locked = True; - num_share_modes = get_share_modes(conn, token, dev, inode, &old_shares); + num_share_modes = get_share_modes(conn, dev, inode, &old_shares); } /* @@ -896,7 +896,7 @@ void open_file_shared(files_struct *fsp,connection_struct *conn,char *fname,int dev = %x, inode = %.0f\n", share_entry->op_type, fname, (unsigned int)dev, (double)inode)); /* Oplock break.... */ - unlock_share_entry(conn, dev, inode, token); + unlock_share_entry(conn, dev, inode); if(request_oplock_break(share_entry, dev, inode) == False) { free((char *)old_shares); @@ -909,7 +909,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou unix_ERR_code = ERRbadshare; return; } - lock_share_entry(conn, dev, inode, &token); + lock_share_entry(conn, dev, inode); broke_oplock = True; all_current_opens_are_level_II = False; break; @@ -922,7 +922,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou if(check_share_mode(share_entry, deny_mode, fname, fcbopen, &flags) == False) { free((char *)old_shares); - unlock_share_entry(conn, dev, inode, token); + unlock_share_entry(conn, dev, inode); errno = EACCES; return; } @@ -932,7 +932,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou if(broke_oplock) { free((char *)old_shares); - num_share_modes = get_share_modes(conn, token, dev, inode, &old_shares); + num_share_modes = get_share_modes(conn, dev, inode, &old_shares); oplock_contention_count++; } } while(broke_oplock); @@ -973,7 +973,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou /* We created the file - thus we must now lock the share entry before creating it. */ dev = fsp->fd_ptr->dev; inode = fsp->fd_ptr->inode; - lock_share_entry(conn, dev, inode, &token); + lock_share_entry(conn, dev, inode); share_locked = True; } @@ -1028,7 +1028,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou oplock_request = 0; } - set_share_mode(token, fsp, port, oplock_request); + set_share_mode(fsp, port, oplock_request); } if ((flags2&O_TRUNC) && file_existed) @@ -1036,7 +1036,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou } if (share_locked && lp_share_modes(SNUM(conn))) - unlock_share_entry( conn, dev, inode, token); + unlock_share_entry( conn, dev, inode); } /**************************************************************************** @@ -1224,7 +1224,6 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op) share_mode_entry *old_shares = 0; int num_share_modes; SMB_STRUCT_STAT sbuf; - int token; pid_t pid = getpid(); SMB_DEV_T dev; SMB_INO_T inode; @@ -1237,8 +1236,8 @@ BOOL check_file_sharing(connection_struct *conn,char *fname, BOOL rename_op) dev = sbuf.st_dev; inode = sbuf.st_ino; - lock_share_entry(conn, dev, inode, &token); - num_share_modes = get_share_modes(conn, token, dev, inode, &old_shares); + lock_share_entry(conn, dev, inode); + num_share_modes = get_share_modes(conn, dev, inode, &old_shares); /* * Check if the share modes will give us access. @@ -1308,7 +1307,7 @@ batch oplocked file %s, dev = %x, inode = %.0f\n", fname, (unsigned int)dev, (do dev = %x, inode = %.0f\n", share_entry->op_type, fname, (unsigned int)dev, (double)inode)); /* Oplock break.... */ - unlock_share_entry(conn, dev, inode, token); + unlock_share_entry(conn, dev, inode); if(request_oplock_break(share_entry, dev, inode) == False) { free((char *)old_shares); @@ -1318,7 +1317,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou return False; } - lock_share_entry(conn, dev, inode, &token); + lock_share_entry(conn, dev, inode); broke_oplock = True; break; } @@ -1345,7 +1344,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou if(broke_oplock) { free((char *)old_shares); - num_share_modes = get_share_modes(conn, token, dev, inode, &old_shares); + num_share_modes = get_share_modes(conn, dev, inode, &old_shares); } } while(broke_oplock); } @@ -1364,7 +1363,7 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou free_and_exit: - unlock_share_entry(conn, dev, inode, token); + unlock_share_entry(conn, dev, inode); if(old_shares != NULL) free((char *)old_shares); return(ret); |