summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-23 03:34:50 +0000
committerJeremy Allison <jra@samba.org>1998-10-23 03:34:50 +0000
commit9bb7ac81b6e4d33e1be49447dbdbbb8d24259f53 (patch)
tree0bffe55dcb3dee8574d89546af83bd44cd476491 /source3/include
parent1e60cc49f5ecb864ab965a6e7ab9287e1204d1d6 (diff)
downloadsamba-9bb7ac81b6e4d33e1be49447dbdbbb8d24259f53.tar.gz
samba-9bb7ac81b6e4d33e1be49447dbdbbb8d24259f53.tar.bz2
samba-9bb7ac81b6e4d33e1be49447dbdbbb8d24259f53.zip
Reasonably large change to give us *exactly* correct NT delete on close semantics.
This was trickier than it looks :-). Check out the new DELETE_ON_CLOSE flag in the share modes and the new code that iterates through all open files on the same device and inode in files.c and trans2.c Also changed the code that modifies share mode entries to take generic function pointers rather than doing a specific thing so this sort of change should be easier in the future. Jeremy. (This used to be commit 5e6a7cd99d29d1cf068fc517272559c1cf47ea3a)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h5
-rw-r--r--source3/include/smb.h15
2 files changed, 14 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9b707adeef..9c78e84017 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -538,7 +538,8 @@ int get_share_modes(connection_struct *conn,
share_mode_entry **shares);
void del_share_mode(int token, files_struct *fsp);
BOOL set_share_mode(int token, files_struct *fsp, uint16 port, uint16 op_type);
-BOOL remove_share_oplock(files_struct *fsp, int token);
+BOOL remove_share_oplock(int token, files_struct *fsp);
+BOOL modify_share_mode(int token, files_struct *fsp, int new_mode);
int share_mode_forall(void (*fn)(share_mode_entry *, char *));
void share_status(FILE *f);
@@ -2147,6 +2148,8 @@ void file_close_conn(connection_struct *conn);
void file_init(void);
void file_close_user(int vuid);
files_struct *file_find_dit(SMB_DEV_T dev, SMB_INO_T inode, struct timeval *tval);
+files_struct *file_find_di_first(SMB_DEV_T dev, SMB_INO_T inode);
+files_struct *file_find_di_next(files_struct *start_fsp);
files_struct *file_find_print(void);
void file_sync_all(connection_struct *conn);
void fd_ptr_free(file_fd_struct *fd_ptr);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index d71d1cd1eb..2e27fa195f 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -201,14 +201,19 @@ implemented */
#define GET_DENY_MODE(x) (((x)>>SHARE_MODE_SHIFT) & SHARE_MODE_MASK)
#define SET_DENY_MODE(x) ((x)<<SHARE_MODE_SHIFT)
+/* Sync on open file (not sure if used anymore... ?) */
+#define FILE_SYNC_OPENMODE (1<<14)
+#define GET_FILE_SYNC_OPENMODE(x) (((x) & FILE_SYNC_OPENMODE) ? True : False)
+
/* allow delete on open file mode (used by NT SMB's). */
#define ALLOW_SHARE_DELETE (1<<15)
-#define GET_ALLOW_SHARE_DELETE(x) (((x) & ALLOW_SHARE_DELETE) ? 1 : 0)
+#define GET_ALLOW_SHARE_DELETE(x) (((x) & ALLOW_SHARE_DELETE) ? True : False)
#define SET_ALLOW_SHARE_DELETE(x) ((x) ? ALLOW_SHARE_DELETE : 0)
-/* Sync on open file (not sure if used anymore... ?) */
-#define FILE_SYNC_OPENMODE (1<<14)
-#define GET_FILE_SYNC_OPENMODE(x) (((x) & FILE_SYNC_OPENMODE) ? 1 : 0)
+/* delete on close flag (used by NT SMB's). */
+#define DELETE_ON_CLOSE_FLAG (1<<16)
+#define GET_DELETE_ON_CLOSE_FLAG(x) (((x) & DELETE_ON_CLOSE_FLAG) ? True : False)
+#define SET_DELETE_ON_CLOSE_FLAG(x) ((x) ? DELETE_ON_CLOSE_FLAG : 0)
/* open disposition values */
#define FILE_EXISTS_FAIL 0
@@ -669,7 +674,7 @@ struct share_ops {
int (*get_entries)(connection_struct *, int , SMB_DEV_T , SMB_INO_T , share_mode_entry **);
void (*del_entry)(int , files_struct *);
BOOL (*set_entry)(int, files_struct *, uint16 , uint16 );
- BOOL (*remove_oplock)(files_struct *, int);
+ BOOL (*mod_entry)(int, files_struct *, void (*)(share_mode_entry *, SMB_DEV_T, SMB_INO_T, void *), void *);
int (*forall)(void (*)(share_mode_entry *, char *));
void (*status)(FILE *);
};