summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-04-25 20:30:58 +0000
committerJeremy Allison <jra@samba.org>2000-04-25 20:30:58 +0000
commite4d382750caa522b5e249d690fdb469d7b0c12a1 (patch)
treeca1eb9f39f94f26725b1642a887dd2049bbe3fe6 /source3/include
parent00e3fe132476fcaed0f4b9bbe74b0a6559c39df0 (diff)
downloadsamba-e4d382750caa522b5e249d690fdb469d7b0c12a1.tar.gz
samba-e4d382750caa522b5e249d690fdb469d7b0c12a1.tar.bz2
samba-e4d382750caa522b5e249d690fdb469d7b0c12a1.zip
Added the hard code :-).
HEAD should now map brl locks correctly into POSIX locks, including the really nasty case of large range unlock. There is a lot of pretty ASCII art in locking/brlock.c explaining exactly how this code works. If it is unclear, please ask me. Jeremy. (This used to be commit 135855dbd3b8934a49229b81646cd4469acba926)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h5
-rw-r--r--source3/include/smb.h12
2 files changed, 16 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index db50e12ab6..79ebe331ad 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -816,6 +816,8 @@ 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);
@@ -824,11 +826,11 @@ 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 */
-void locking_close_file(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);
@@ -838,6 +840,7 @@ BOOL do_lock(files_struct *fsp,connection_struct *conn,
BOOL do_unlock(files_struct *fsp,connection_struct *conn,
SMB_BIG_UINT count,SMB_BIG_UINT offset,
int *eclass,uint32 *ecode);
+void locking_close_file(files_struct *fsp);
BOOL locking_init(int read_only);
BOOL locking_end(void);
BOOL lock_share_entry(connection_struct *conn,
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 5147a567b4..1559143418 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -519,6 +519,18 @@ 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;
+};
+
typedef struct
{
char *name;