diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-14 17:38:29 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-14 17:38:29 +0000 |
commit | b9623ab59e813131b1ed3f51616a46e719d59c21 (patch) | |
tree | a1ba04e55e67ca102b05dd22b024bab9e9d51d57 /source3/locking/locking_shm.c | |
parent | 58fb3c31c03601042fdba71501068fcaea8a821c (diff) | |
download | samba-b9623ab59e813131b1ed3f51616a46e719d59c21.tar.gz samba-b9623ab59e813131b1ed3f51616a46e719d59c21.tar.bz2 samba-b9623ab59e813131b1ed3f51616a46e719d59c21.zip |
this is the bug change to using connection_struct* instead of cnum.
Connections[] is now a local array in server.c
I might have broken something with this change. In particular the
oplock code is suspect and some .dll files aren't being oplocked when
I expected them to be. I'll look at it after I've got some sleep.
(This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6)
Diffstat (limited to 'source3/locking/locking_shm.c')
-rw-r--r-- | source3/locking/locking_shm.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c index 43a927e14c..84310d3a33 100644 --- a/source3/locking/locking_shm.c +++ b/source3/locking/locking_shm.c @@ -37,7 +37,6 @@ #ifdef FAST_SHARE_MODES extern int DEBUGLEVEL; -extern connection_struct Connections[]; extern files_struct Files[]; static struct shmem_ops *shmops; @@ -79,15 +78,17 @@ static BOOL shm_stop_share_mode_mgmt(void) /******************************************************************* lock a hash bucket entry in shared memory for share_mode management ******************************************************************/ -static BOOL shm_lock_share_entry(int cnum, uint32 dev, uint32 inode, int *ptok) +static BOOL shm_lock_share_entry(connection_struct *conn, + uint32 dev, uint32 inode, int *ptok) { - return shmops->lock_hash_entry(HASH_ENTRY(dev, inode)); + return shmops->lock_hash_entry(HASH_ENTRY(dev, inode)); } /******************************************************************* unlock a hash bucket entry in shared memory for share_mode management ******************************************************************/ -static BOOL shm_unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token) +static BOOL shm_unlock_share_entry(connection_struct *conn, + uint32 dev, uint32 inode, int token) { return shmops->unlock_hash_entry(HASH_ENTRY(dev, inode)); } @@ -95,7 +96,8 @@ static BOOL shm_unlock_share_entry(int cnum, uint32 dev, uint32 inode, int token /******************************************************************* get all share mode entries in shared memory for a dev/inode pair. ********************************************************************/ -static int shm_get_share_modes(int cnum, int token, uint32 dev, uint32 inode, +static int shm_get_share_modes(connection_struct *conn, + int token, uint32 dev, uint32 inode, share_mode_entry **old_shares) { int *mode_array; @@ -426,7 +428,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) /* We must create a share_mode_record */ share_mode_record *new_mode_p = NULL; int new_offset = shmops->shm_alloc(sizeof(share_mode_record) + - strlen(fs_p->name) + 1); + strlen(fs_p->fsp_name) + 1); if(new_offset == 0) { DEBUG(0,("ERROR:set_share_mode shmops->shm_alloc fail!\n")); return False; @@ -437,7 +439,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) new_mode_p->st_ino = inode; new_mode_p->num_share_mode_entries = 0; new_mode_p->share_mode_entries = 0; - pstrcpy(new_mode_p->file_name, fs_p->name); + pstrcpy(new_mode_p->file_name, fs_p->fsp_name); /* Chain onto the start of the hash chain (in the hope we will be used first). */ new_mode_p->next_offset = mode_array[hash_entry]; @@ -446,7 +448,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) file_scanner_p = new_mode_p; DEBUG(3,("set_share_mode: Created share record for %s (dev %d inode %d)\n", - fs_p->name, dev, inode)); + fs_p->fsp_name, dev, inode)); } /* Now create the share mode entry */ @@ -485,7 +487,7 @@ static BOOL shm_set_share_mode(int token, int fnum, uint16 port, uint16 op_type) file_scanner_p->num_share_mode_entries += 1; DEBUG(3,("set_share_mode: Created share entry for %s with mode 0x%X pid=%d\n", - fs_p->name, fs_p->share_mode, new_entry_p->e.pid)); + fs_p->fsp_name, fs_p->share_mode, new_entry_p->e.pid)); return(True); } |