summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-28 20:54:23 +0000
committerJeremy Allison <jra@samba.org>2000-04-28 20:54:23 +0000
commit9a5eb068ab32418e793d482db1f078f147f9ee08 (patch)
tree9939206f1f8220e16f168cba1f19f18ee25dacc6 /source3/include
parent46e84a0090516e3ae67b3ceb06b3d9a546e8e71e (diff)
downloadsamba-9a5eb068ab32418e793d482db1f078f147f9ee08.tar.gz
samba-9a5eb068ab32418e793d482db1f078f147f9ee08.tar.bz2
samba-9a5eb068ab32418e793d482db1f078f147f9ee08.zip
Ok - this is the *third* implementation of this (third time's the charm :-).
This implementation keeps all POSIX lock records in a separate in memory tdb database only known about in locking/posix.c. In addition, the pending close fd's are also held in a tdb which has an array of fd's indexed by device and inode. The walk-split code uglyness has been moved to posix.c from brlock.c, which is the only place that needs to know about it, and the extra functions hacked into brlock to expose internal state have been removed. This implementation passes smbtorture locktest4, the only thing I need to check now for completeness is what to do about lock upgrade/downgrades which Win32 allows under some *very* strange circumstances. Jeremy. (This used to be commit 3f655de1c764b9ee1472a111621d4317f19f624d)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h14
-rw-r--r--source3/include/smb.h13
2 files changed, 10 insertions, 17 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 1d952da4ee..dc12838e77 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -816,8 +816,6 @@ 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 brl_type lock_type);
-struct unlock_list *brl_unlock_list(TALLOC_CTX *ctx, struct unlock_list *ulhead,
- pid_t pid, SMB_DEV_T dev, SMB_INO_T ino);
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);
@@ -826,12 +824,10 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino,
br_off start, br_off size,
enum brl_type lock_type);
void brl_close(SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
-struct unlock_list *brl_getlocklist( TALLOC_CTX *ctx, SMB_DEV_T dev, SMB_INO_T ino, pid_t pid, int tid, int fnum);
int brl_forall(BRLOCK_FN(fn));
/*The following definitions come from locking/locking.c */
-int fd_close_posix(struct connection_struct *conn, files_struct *fsp);
BOOL is_locked(files_struct *fsp,connection_struct *conn,
SMB_BIG_UINT count,SMB_BIG_UINT offset,
enum brl_type lock_type);
@@ -860,6 +856,16 @@ BOOL downgrade_share_oplock(files_struct *fsp);
BOOL modify_share_mode(files_struct *fsp, int new_mode, uint16 new_oplock);
int share_mode_forall(SHAREMODE_FN(fn));
+/*The following definitions come from locking/posix.c */
+
+int fd_close_posix(struct connection_struct *conn, files_struct *fsp);
+BOOL is_posix_locked(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
+BOOL set_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count, enum brl_type lock_type);
+BOOL release_posix_lock(files_struct *fsp, SMB_BIG_UINT u_offset, SMB_BIG_UINT u_count);
+void posix_locking_close_file(files_struct *fsp);
+BOOL posix_locking_init(void);
+BOOL posix_locking_end(void);
+
/*The following definitions come from msdfs/msdfs.c */
BOOL dfs_redirect(char* pathname, connection_struct* conn);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index ee14466cf7..f61c8cbbad 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -516,19 +516,6 @@ struct uid_cache {
uid_t list[UID_CACHE_SIZE];
};
-/*
- * Structure used when splitting a lock range
- * into a POSIX lock range. Doubly linked list.
- */
-
-struct unlock_list {
- struct unlock_list *next;
- struct unlock_list *prev;
- SMB_BIG_UINT start;
- SMB_BIG_UINT size;
- uint16 smbpid;
-};
-
typedef struct
{
char *name;