summaryrefslogtreecommitdiff
path: root/source3/modules/onefs_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/modules/onefs_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/modules/onefs_open.c')
-rw-r--r--source3/modules/onefs_open.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 378d9f69f7..eb22584772 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -371,9 +371,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);
}
@@ -457,7 +457,6 @@ NTSTATUS onefs_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;
@@ -542,39 +541,40 @@ NTSTATUS onefs_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;
-
- /* 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);
- }
+ 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);
+ }
- /* Ensure we don't reprocess this message. */
- remove_deferred_open_smb_message(req->mid);
+ /* Ensure we don't reprocess this message. */
+ remove_deferred_open_message_smb(req->mid);
- /*
- * When receiving a semlock_async_failure message, the
- * deferred open will be marked as "failed". Returning
- * INTERNAL_ERROR.
- */
- if (state->failed) {
- DEBUG(0, ("onefs_open_file_ntcreate: "
- "semlock_async_failure detected!\n"));
- return NT_STATUS_INTERNAL_ERROR;
+ /*
+ * When receiving a semlock_async_failure message, the
+ * deferred open will be marked as "failed". Returning
+ * INTERNAL_ERROR.
+ */
+ if (state->failed) {
+ DEBUG(0, ("onefs_open_file_ntcreate: "
+ "semlock_async_failure detected!\n"));
+ return NT_STATUS_INTERNAL_ERROR;
+ }
}
}