summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-09 19:26:34 -0700
committerJeremy Allison <jra@samba.org>2010-04-09 19:26:34 -0700
commite15939b4561b84eda283a9df233e2a3a0ed42621 (patch)
tree6475d00552b99dc4b17fc887f93c2f8210e29b1c /source3/smbd/open.c
parentb253385611ac4934bb46390ef519c547bba87eb3 (diff)
downloadsamba-e15939b4561b84eda283a9df233e2a3a0ed42621.tar.gz
samba-e15939b4561b84eda283a9df233e2a3a0ed42621.tar.bz2
samba-e15939b4561b84eda283a9df233e2a3a0ed42621.zip
Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is to cope queueing single (non-compounded) SMB2 requests to put some code inside the stubs. Jeremy.
Diffstat (limited to 'source3/smbd/open.c')
-rw-r--r--source3/smbd/open.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0834e6d3d3..1e98e88388 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -25,8 +25,8 @@
extern const struct generic_mapping file_generic_mapping;
struct deferred_open_record {
- bool delayed_for_oplocks;
- struct file_id id;
+ bool delayed_for_oplocks;
+ struct file_id id;
};
static NTSTATUS create_file_unixpath(connection_struct *conn,
@@ -1082,9 +1082,9 @@ static void defer_open(struct share_mode_lock *lck,
(unsigned int)request_time.tv_usec,
(unsigned int)req->mid));
- if (!push_deferred_smb_message(req, request_time, timeout,
+ if (!push_deferred_open_message_smb(req, request_time, timeout,
(char *)state, sizeof(*state))) {
- exit_server("push_deferred_smb_message failed");
+ exit_server("push_deferred_open_message_smb failed");
}
add_deferred_open(lck, req->mid, request_time, state->id);
}
@@ -1477,7 +1477,6 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
mode_t unx_mode = (mode_t)0;
int info;
uint32 existing_dos_attributes = 0;
- struct pending_message_list *pml = NULL;
struct timeval request_time = timeval_zero();
struct share_mode_lock *lck = NULL;
uint32 open_access_mask = access_mask;
@@ -1543,29 +1542,30 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
* Only non-internal opens can be deferred at all
*/
- if ((req != NULL)
- && ((pml = get_open_deferred_message(req->mid)) != NULL)) {
- struct deferred_open_record *state =
- (struct deferred_open_record *)pml->private_data.data;
-
- /* Remember the absolute time of the original
- request with this mid. We'll use it later to
- see if this has timed out. */
-
- request_time = pml->request_time;
+ if (req) {
+ void *ptr;
+ if (get_deferred_open_message_state(req->mid,
+ &request_time,
+ &ptr)) {
+
+ struct deferred_open_record *state = (struct deferred_open_record *)ptr;
+ /* Remember the absolute time of the original
+ request with this mid. We'll use it later to
+ see if this has timed out. */
+
+ /* Remove the deferred open entry under lock. */
+ lck = get_share_mode_lock(talloc_tos(), state->id,
+ NULL, NULL, NULL);
+ if (lck == NULL) {
+ DEBUG(0, ("could not get share mode lock\n"));
+ } else {
+ del_deferred_open_entry(lck, req->mid);
+ TALLOC_FREE(lck);
+ }
- /* Remove the deferred open entry under lock. */
- lck = get_share_mode_lock(talloc_tos(), state->id, NULL, NULL,
- NULL);
- if (lck == NULL) {
- DEBUG(0, ("could not get share mode lock\n"));
- } else {
- del_deferred_open_entry(lck, req->mid);
- TALLOC_FREE(lck);
+ /* Ensure we don't reprocess this message. */
+ remove_deferred_open_message_smb(req->mid);
}
-
- /* Ensure we don't reprocess this message. */
- remove_deferred_open_smb_message(req->mid);
}
status = check_name(conn, smb_fname->base_name);