summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-12 21:40:28 -0700
committerJeremy Allison <jra@samba.org>2010-04-12 21:40:28 -0700
commit79842437684be380407661fc27e64f223a326b18 (patch)
tree867b994fdc97991637d5b33fa57ba77b214c9cca /source3/include
parent8a2169d6749498c7929e7533f6b3c9d965b0aa3b (diff)
downloadsamba-79842437684be380407661fc27e64f223a326b18.tar.gz
samba-79842437684be380407661fc27e64f223a326b18.tar.bz2
samba-79842437684be380407661fc27e64f223a326b18.zip
Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2 servers. Jeremy
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/proto.h24
-rw-r--r--source3/include/smb.h55
2 files changed, 48 insertions, 31 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index bd81690702..f1cba8ffa2 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3510,12 +3510,12 @@ bool is_valid_share_mode_entry(const struct share_mode_entry *e);
bool is_deferred_open_entry(const struct share_mode_entry *e);
bool is_unused_share_mode_entry(const struct share_mode_entry *e);
void set_share_mode(struct share_mode_lock *lck, files_struct *fsp,
- uid_t uid, uint16 mid, uint16 op_type);
-void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
+ uid_t uid, uint64_t mid, uint16 op_type);
+void add_deferred_open(struct share_mode_lock *lck, uint64_t mid,
struct timeval request_time,
struct file_id id);
bool del_share_mode(struct share_mode_lock *lck, files_struct *fsp);
-void del_deferred_open_entry(struct share_mode_lock *lck, uint16 mid);
+void del_deferred_open_entry(struct share_mode_lock *lck, uint64_t mid);
bool remove_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
bool downgrade_share_oplock(struct share_mode_lock *lck, files_struct *fsp);
NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode);
@@ -6090,7 +6090,7 @@ NTSTATUS schedule_aio_write_and_X(connection_struct *conn,
size_t numtowrite);
int wait_for_aio_completion(files_struct *fsp);
void cancel_aio_by_fsp(files_struct *fsp);
-void smbd_aio_complete_mid(unsigned int mid);
+void smbd_aio_complete_mid(uint64_t mid);
/* The following definitions come from smbd/blocking.c */
@@ -6107,8 +6107,8 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
uint64_t count,
uint32 blocking_pid);
void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck);
-void remove_pending_lock_requests_by_mid(int mid);
-bool blocking_lock_was_deferred(int mid);
+void remove_pending_lock_requests_by_mid(uint64_t mid);
+bool blocking_lock_was_deferred(uint64_t mid);
struct blocking_lock_record *blocking_lock_cancel(files_struct *fsp,
uint32 lock_pid,
uint64_t offset,
@@ -6547,7 +6547,7 @@ NTSTATUS change_notify_add_request(struct smb_request *req,
void (*reply_fn)(struct smb_request *req,
NTSTATUS error_code,
uint8_t *buf, size_t len));
-void remove_pending_change_notify_requests_by_mid(uint16 mid);
+void remove_pending_change_notify_requests_by_mid(uint64_t mid);
void remove_pending_change_notify_requests_by_fid(files_struct *fsp,
NTSTATUS status);
void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
@@ -6808,10 +6808,10 @@ int srv_set_message(char *buf,
int num_words,
int num_bytes,
bool zero);
-void remove_deferred_open_message_smb(uint16_t mid);
-void schedule_deferred_open_message_smb(uint16_t mid);
-bool open_was_deferred(uint16_t mid);
-bool get_deferred_open_message_state(uint16_t mid,
+void remove_deferred_open_message_smb(uint64_t mid);
+void schedule_deferred_open_message_smb(uint64_t mid);
+bool open_was_deferred(uint64_t mid);
+bool get_deferred_open_message_state(uint64_t mid,
struct timeval *p_request_time,
void **pp_state);
bool push_deferred_open_message_smb(struct smb_request *req,
@@ -6825,7 +6825,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
bool (*handler)(const struct timeval *now,
void *private_data),
void *private_data);
-NTSTATUS allow_new_trans(struct trans_state *list, int mid);
+NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid);
void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes);
const char *smb_fn_name(int type);
void add_to_common_flags2(uint32 v);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 853ced0aa6..19e45edf70 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -496,7 +496,7 @@ typedef struct {
struct trans_state {
struct trans_state *next, *prev;
uint16 vuid;
- uint16 mid;
+ uint64_t mid;
uint32 max_param_return;
uint32 max_data_return;
@@ -629,7 +629,7 @@ struct smb_request {
uint8_t cmd;
uint16 flags2;
uint16 smbpid;
- uint16 mid;
+ uint64_t mid; /* For compatibility with SMB2. */
uint32_t seqnum;
uint16 vuid;
uint16 tid;
@@ -751,7 +751,7 @@ struct pending_message_list {
/* struct returned by get_share_modes */
struct share_mode_entry {
struct server_id pid;
- uint16 op_mid;
+ uint64_t op_mid; /* For compatibility with SMB2 opens. */
uint16 op_type;
uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */
uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
@@ -770,26 +770,43 @@ struct share_mode_entry {
Offset Data length.
0 struct server_id pid 4
-4 uint16 op_mid 2
-6 uint16 op_type 2
-8 uint32 access_mask 4
-12 uint32 share_access 4
-16 uint32 private_options 4
-20 uint32 time sec 4
-24 uint32 time usec 4
-28 uint64 dev 8 bytes
-36 uint64 inode 8 bytes
-44 uint64 extid 8 bytes
-52 unsigned long file_id 4 bytes
-56 uint32 uid 4 bytes
-60 uint16 flags 2 bytes
-62
+4 uint16 op_mid 8
+12 uint16 op_type 2
+14 uint32 access_mask 4
+18 uint32 share_access 4
+22 uint32 private_options 4
+26 uint32 time sec 4
+30 uint32 time usec 4
+34 uint64 dev 8 bytes
+42 uint64 inode 8 bytes
+50 uint64 extid 8 bytes
+58 unsigned long file_id 4 bytes
+62 uint32 uid 4 bytes
+66 uint16 flags 2 bytes
+68
*/
+
+#define OP_BREAK_MSG_PID_OFFSET 0
+#define OP_BREAK_MSG_MID_OFFSET 4
+#define OP_BREAK_MSG_OP_TYPE_OFFSET 12
+#define OP_BREAK_MSG_ACCESS_MASK_OFFSET 14
+#define OP_BREAK_MSG_SHARE_ACCESS_OFFSET 18
+#define OP_BREAK_MSG_PRIV_OFFSET 22
+#define OP_BREAK_MSG_TIME_SEC_OFFSET 26
+#define OP_BREAK_MSG_TIME_USEC_OFFSET 30
+#define OP_BREAK_MSG_DEV_OFFSET 34
+#define OP_BREAK_MSG_INO_OFFSET 42
+#define OP_BREAK_MSG_EXTID_OFFSET 50
+#define OP_BREAK_MSG_FILE_ID_OFFSET 58
+#define OP_BREAK_MSG_UID_OFFSET 62
+#define OP_BREAK_MSG_FLAGS_OFFSET 66
+
#ifdef CLUSTER_SUPPORT
-#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 66
+#define OP_BREAK_MSG_VNN_OFFSET 68
+#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 72
#else
-#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 62
+#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 68
#endif
struct share_mode_lock {