diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-05-19 16:22:53 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-22 22:58:26 -0400 |
commit | fcc31cb6f1ae6c4e64a463b124d3c2e9cbd7dd70 (patch) | |
tree | cf4b73bc9d8d5e71e71b76d69550a70f58fb8278 /fs/cifs/transport.c | |
parent | 2c8f981d93f830c167c811f046b5107cc24b6e1b (diff) |
cifs: make cifs_send_async take a kvec array
We'll need this for async writes, so convert the call to take a kvec
array. CIFSSMBEcho is changed to put a kvec on the stack and pass
in the SMB buffer using that.
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 43633a79942a..67f59c7b5d79 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -342,11 +342,12 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) | |||
342 | * the result. Caller is responsible for dealing with timeouts. | 342 | * the result. Caller is responsible for dealing with timeouts. |
343 | */ | 343 | */ |
344 | int | 344 | int |
345 | cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, | 345 | cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, |
346 | mid_callback_t *callback, void *cbdata) | 346 | unsigned int nvec, mid_callback_t *callback, void *cbdata) |
347 | { | 347 | { |
348 | int rc; | 348 | int rc; |
349 | struct mid_q_entry *mid; | 349 | struct mid_q_entry *mid; |
350 | struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base; | ||
350 | 351 | ||
351 | rc = wait_for_free_request(server, CIFS_ASYNC_OP); | 352 | rc = wait_for_free_request(server, CIFS_ASYNC_OP); |
352 | if (rc) | 353 | if (rc) |
@@ -354,10 +355,10 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, | |||
354 | 355 | ||
355 | /* enable signing if server requires it */ | 356 | /* enable signing if server requires it */ |
356 | if (server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | 357 | if (server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) |
357 | in_buf->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; | 358 | hdr->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; |
358 | 359 | ||
359 | mutex_lock(&server->srv_mutex); | 360 | mutex_lock(&server->srv_mutex); |
360 | mid = AllocMidQEntry(in_buf, server); | 361 | mid = AllocMidQEntry(hdr, server); |
361 | if (mid == NULL) { | 362 | if (mid == NULL) { |
362 | mutex_unlock(&server->srv_mutex); | 363 | mutex_unlock(&server->srv_mutex); |
363 | return -ENOMEM; | 364 | return -ENOMEM; |
@@ -368,7 +369,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, | |||
368 | list_add_tail(&mid->qhead, &server->pending_mid_q); | 369 | list_add_tail(&mid->qhead, &server->pending_mid_q); |
369 | spin_unlock(&GlobalMid_Lock); | 370 | spin_unlock(&GlobalMid_Lock); |
370 | 371 | ||
371 | rc = cifs_sign_smb(in_buf, server, &mid->sequence_number); | 372 | rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number); |
372 | if (rc) { | 373 | if (rc) { |
373 | mutex_unlock(&server->srv_mutex); | 374 | mutex_unlock(&server->srv_mutex); |
374 | goto out_err; | 375 | goto out_err; |
@@ -380,7 +381,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_hdr *in_buf, | |||
380 | #ifdef CONFIG_CIFS_STATS2 | 381 | #ifdef CONFIG_CIFS_STATS2 |
381 | atomic_inc(&server->inSend); | 382 | atomic_inc(&server->inSend); |
382 | #endif | 383 | #endif |
383 | rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); | 384 | rc = smb_sendv(server, iov, nvec); |
384 | #ifdef CONFIG_CIFS_STATS2 | 385 | #ifdef CONFIG_CIFS_STATS2 |
385 | atomic_dec(&server->inSend); | 386 | atomic_dec(&server->inSend); |
386 | mid->when_sent = jiffies; | 387 | mid->when_sent = jiffies; |