summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-08-31 20:20:54 +0000
committerJeremy Allison <jra@samba.org>1998-08-31 20:20:54 +0000
commit693480af8bb2d3e83566af9463ca427f47a879da (patch)
treecb7070685621c8b4ffd651c8108e1450bf3272d9 /source3/locking
parentd2e0d0f73bfce64665feb386e2cc4032258ad437 (diff)
downloadsamba-693480af8bb2d3e83566af9463ca427f47a879da.tar.gz
samba-693480af8bb2d3e83566af9463ca427f47a879da.tar.bz2
samba-693480af8bb2d3e83566af9463ca427f47a879da.zip
configure.in, configure: include/config.h.in: Added stropts and poll.
include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where all the other defines live (changed them from typedefs to defines). Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T in preparation for moving to size independed (ie. 64 bit clean) device and inode access. Stat call wrapper comes next :-). Jeremy. (This used to be commit 3d9ec96de5e04e83abafe9c5d980bd39eee856ea)
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c6
-rw-r--r--source3/locking/locking_shm.c24
-rw-r--r--source3/locking/locking_slow.c16
3 files changed, 24 insertions, 22 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 4f2c9ab345..856b7cfcf6 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -190,7 +190,7 @@ BOOL locking_end(void)
Lock a hash bucket entry.
******************************************************************/
BOOL lock_share_entry(connection_struct *conn,
- uint32 dev, uint32 inode, int *ptok)
+ SMB_DEV_T dev, SMB_INO_T inode, int *ptok)
{
return share_ops->lock_entry(conn, dev, inode, ptok);
}
@@ -199,7 +199,7 @@ BOOL lock_share_entry(connection_struct *conn,
Unlock a hash bucket entry.
******************************************************************/
BOOL unlock_share_entry(connection_struct *conn,
- uint32 dev, uint32 inode, int token)
+ SMB_DEV_T dev, SMB_INO_T inode, int token)
{
return share_ops->unlock_entry(conn, dev, inode, token);
}
@@ -208,7 +208,7 @@ BOOL unlock_share_entry(connection_struct *conn,
Get all share mode entries for a dev/inode pair.
********************************************************************/
int get_share_modes(connection_struct *conn,
- int token, uint32 dev, uint32 inode,
+ int token, SMB_DEV_T dev, SMB_INO_T inode,
share_mode_entry **shares)
{
return share_ops->get_entries(conn, token, dev, inode, shares);
diff --git a/source3/locking/locking_shm.c b/source3/locking/locking_shm.c
index cded5e628d..909bdb78e4 100644
--- a/source3/locking/locking_shm.c
+++ b/source3/locking/locking_shm.c
@@ -45,8 +45,8 @@ typedef struct
{
int next_offset; /* offset of next record in chain from hash bucket */
int locking_version;
- int32 st_dev;
- int32 st_ino;
+ SMB_DEV_T st_dev;
+ SMB_INO_T st_ino;
int num_share_mode_entries;
int share_mode_entries; /* Chain of share mode entries for this file */
char file_name[1];
@@ -63,7 +63,7 @@ static int read_only;
/* Conversion to hash entry index from device and inode numbers. */
-#define HASH_ENTRY(dev,ino) ((((uint32)(dev)) ^ ((uint32)(ino))) % shmops->hash_size())
+#define HASH_ENTRY(dev,ino) ((unsigned int)(((dev) ^ (ino)) % shmops->hash_size()))
/*******************************************************************
@@ -78,7 +78,7 @@ 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(connection_struct *conn,
- uint32 dev, uint32 inode, int *ptok)
+ SMB_DEV_T dev, SMB_INO_T inode, int *ptok)
{
return shmops->lock_hash_entry(HASH_ENTRY(dev, inode));
}
@@ -87,7 +87,7 @@ static BOOL shm_lock_share_entry(connection_struct *conn,
unlock a hash bucket entry in shared memory for share_mode management
******************************************************************/
static BOOL shm_unlock_share_entry(connection_struct *conn,
- uint32 dev, uint32 inode, int token)
+ SMB_DEV_T dev, SMB_INO_T inode, int token)
{
return shmops->unlock_hash_entry(HASH_ENTRY(dev, inode));
}
@@ -96,7 +96,7 @@ static BOOL shm_unlock_share_entry(connection_struct *conn,
get all share mode entries in shared memory for a dev/inode pair.
********************************************************************/
static int shm_get_share_modes(connection_struct *conn,
- int token, uint32 dev, uint32 inode,
+ int token, SMB_DEV_T dev, SMB_INO_T inode,
share_mode_entry **old_shares)
{
int *mode_array;
@@ -259,7 +259,8 @@ del the share mode of a file.
********************************************************************/
static void shm_del_share_mode(int token, files_struct *fsp)
{
- uint32 dev, inode;
+ SMB_DEV_T dev;
+ SMB_INO_T inode;
int *mode_array;
unsigned int hash_entry;
share_mode_record *file_scanner_p;
@@ -387,7 +388,8 @@ set the share mode of a file. Return False on fail, True on success.
********************************************************************/
static BOOL shm_set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type)
{
- int32 dev, inode;
+ SMB_DEV_T dev;
+ SMB_INO_T inode;
int *mode_array;
unsigned int hash_entry;
share_mode_record *file_scanner_p;
@@ -495,7 +497,8 @@ Remove an oplock port and mode entry from a share mode.
********************************************************************/
static BOOL shm_remove_share_oplock(files_struct *fsp, int token)
{
- uint32 dev, inode;
+ SMB_DEV_T dev;
+ SMB_INO_T inode;
int *mode_array;
unsigned int hash_entry;
share_mode_record *file_scanner_p;
@@ -696,6 +699,3 @@ struct share_ops *locking_shm_init(int ronly)
int locking_shm_dummy_procedure(void)
{return 0;}
#endif /* FAST_SHARE_MODES */
-
-
-
diff --git a/source3/locking/locking_slow.c b/source3/locking/locking_slow.c
index 2017f09289..0a766c9ab9 100644
--- a/source3/locking/locking_slow.c
+++ b/source3/locking/locking_slow.c
@@ -81,7 +81,7 @@ static BOOL slow_stop_share_mode_mgmt(void)
name a share file
******************************************************************/
static BOOL share_name(connection_struct *conn,
- uint32 dev, uint32 inode, char *name)
+ SMB_DEV_T dev, SMB_INO_T inode, char *name)
{
int len;
pstrcpy(name,lp_lockdir());
@@ -124,7 +124,7 @@ static int delete_share_file(connection_struct *conn, char *fname )
lock a share mode file.
******************************************************************/
static BOOL slow_lock_share_entry(connection_struct *conn,
- uint32 dev, uint32 inode, int *ptok)
+ SMB_DEV_T dev, SMB_INO_T inode, int *ptok)
{
pstring fname;
int fd;
@@ -217,9 +217,9 @@ static BOOL slow_lock_share_entry(connection_struct *conn,
unlock a share mode file.
******************************************************************/
static BOOL slow_unlock_share_entry(connection_struct *conn,
- uint32 dev, uint32 inode, int token)
+ SMB_DEV_T dev, SMB_INO_T inode, int token)
{
- int fd = (int)token;
+ int fd = token;
int ret = True;
struct stat sb;
pstring fname;
@@ -348,10 +348,11 @@ deleting it.\n", fname));
/*******************************************************************
get all share mode entries in a share file for a dev/inode pair.
********************************************************************/
-static int slow_get_share_modes(connection_struct *conn, int token, uint32 dev, uint32 inode,
+static int slow_get_share_modes(connection_struct *conn, int token,
+ SMB_DEV_T dev, SMB_INO_T inode,
share_mode_entry **old_shares)
{
- int fd = (int)token;
+ int fd = token;
pstring fname;
int i;
int num_entries;
@@ -960,7 +961,8 @@ static int slow_share_forall(void (*fn)(share_mode_entry *, char *))
char *base;
int fd;
pstring lname;
- uint32 dev,inode;
+ SMB_DEV_T dev;
+ SMB_INO_T inode;
BOOL new_file;
pstring fname;