damn, Solaris already has a "enum lock_type"
authorAndrew Tridgell <tridge@samba.org>
Fri, 14 Jan 2000 08:01:44 +0000 (08:01 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 14 Jan 2000 08:01:44 +0000 (08:01 +0000)
changed it to "enum brl_type"

source/include/proto.h
source/include/smb.h
source/libsmb/clientgen.c
source/locking/brlock.c
source/locking/locking.c

index 8618c1cd69be69e40900447141c727a4ef599084..6829b89fe1e9344def5a4f8141b563384d6da334 100644 (file)
@@ -589,9 +589,8 @@ int cli_nt_create(struct cli_state *cli, char *fname);
 int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode);
 BOOL cli_close(struct cli_state *cli, int fnum);
 BOOL cli_lock(struct cli_state *cli, int fnum, 
-             uint32 offset, uint32 len, int timeout, enum lock_type lock_type);
-BOOL cli_unlock(struct cli_state *cli, int fnum, 
-               uint32 offset, uint32 len);
+             uint32 offset, uint32 len, int timeout, enum brl_type lock_type);
+BOOL cli_unlock(struct cli_state *cli, int fnum, uint32 offset, uint32 len);
 size_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_t size);
 ssize_t cli_write(struct cli_state *cli,
                  int fnum, uint16 write_mode,
@@ -758,14 +757,14 @@ void brl_init(void);
 BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
              uint16 smbpid, pid_t pid, uint16 tid,
              br_off start, br_off size, 
-             enum lock_type lock_type);
+             enum brl_type lock_type);
 BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
                uint16 smbpid, pid_t pid, uint16 tid,
                br_off start, br_off size);
 BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, 
                  uint16 smbpid, pid_t pid, uint16 tid,
                  br_off start, br_off size, 
-                 enum lock_type lock_type);
+                 enum brl_type lock_type);
 void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
 
 /*The following definitions come from  locking/locking.c  */
@@ -773,9 +772,9 @@ void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
 void locking_close_file(files_struct *fsp);
 BOOL is_locked(files_struct *fsp,connection_struct *conn,
               SMB_OFF_T count,SMB_OFF_T offset, 
-              enum lock_type lock_type);
+              enum brl_type lock_type);
 BOOL do_lock(files_struct *fsp,connection_struct *conn,
-             SMB_OFF_T count,SMB_OFF_T offset,enum lock_type lock_type,
+             SMB_OFF_T count,SMB_OFF_T offset,enum brl_type lock_type,
              int *eclass,uint32 *ecode);
 BOOL do_unlock(files_struct *fsp,connection_struct *conn,
                SMB_OFF_T count,SMB_OFF_T offset, 
index 2139a38fe5e4a73fa3169ff519f02da925b1d0f2..4527ff9bffd9c4ea5494d96bc23e767371cc7063 100644 (file)
@@ -906,7 +906,7 @@ typedef enum
 } parm_class;
 
 /* passed to br lock code */
-enum lock_type {READ_LOCK, WRITE_LOCK};
+enum brl_type {READ_LOCK, WRITE_LOCK};
 
 struct enum_list {
        int value;
index 1c9a2123cce1b3e270404b65bb7f33fab1efc096..3497fb0f141d07d256e6fb741084f3523c4a0c18 100644 (file)
@@ -1345,7 +1345,7 @@ BOOL cli_close(struct cli_state *cli, int fnum)
   lock a file
 ****************************************************************************/
 BOOL cli_lock(struct cli_state *cli, int fnum, 
-             uint32 offset, uint32 len, int timeout, enum lock_type lock_type)
+             uint32 offset, uint32 len, int timeout, enum brl_type lock_type)
 {
        char *p;
         int saved_timeout = cli->timeout;
index 653a40728bd00d7db86fcc749a21bc62ee538402..11766433fc105eb94b151f3e2d780ed726dc355c 100644 (file)
@@ -44,7 +44,7 @@ struct lock_struct {
        br_off start;
        br_off size;
        int fnum;
-       enum lock_type lock_type;
+       enum brl_type lock_type;
 };
 
 /* the key used in the brlock database */
@@ -74,7 +74,8 @@ see if lock2 can be added when lock1 is in place
 static BOOL brl_conflict(struct lock_struct *lck1, 
                         struct lock_struct *lck2)
 {
-       if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK) return False;
+       if (lck1->lock_type == READ_LOCK && lck2->lock_type == READ_LOCK) 
+               return False;
 
        if (brl_same_context(&lck1->context, &lck2->context) &&
            lck2->lock_type == READ_LOCK) return False;
@@ -106,7 +107,7 @@ lock a range of bytes
 BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
              uint16 smbpid, pid_t pid, uint16 tid,
              br_off start, br_off size, 
-             enum lock_type lock_type)
+             enum brl_type lock_type)
 {
        struct lock_key key;
        TDB_DATA kbuf, dbuf;
@@ -231,7 +232,7 @@ test if we could add a lock if we wanted to
 BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, 
                  uint16 smbpid, pid_t pid, uint16 tid,
                  br_off start, br_off size, 
-                 enum lock_type lock_type)
+                 enum brl_type lock_type)
 {
        struct lock_key key;
        TDB_DATA kbuf, dbuf;
index 350057d1a78498690fd2a86db5461498e8419265..5348659917cbdb46d92ff76ca88d2ceb86455b1e 100644 (file)
@@ -58,7 +58,7 @@ void locking_close_file(files_struct *fsp)
 ****************************************************************************/
 BOOL is_locked(files_struct *fsp,connection_struct *conn,
               SMB_OFF_T count,SMB_OFF_T offset, 
-              enum lock_type lock_type)
+              enum brl_type lock_type)
 {
        int snum = SNUM(conn);
        
@@ -78,7 +78,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn,
  Utility function called by locking requests.
 ****************************************************************************/
 BOOL do_lock(files_struct *fsp,connection_struct *conn,
-             SMB_OFF_T count,SMB_OFF_T offset,enum lock_type lock_type,
+             SMB_OFF_T count,SMB_OFF_T offset,enum brl_type lock_type,
              int *eclass,uint32 *ecode)
 {
        BOOL ok = False;