cifs: convert cifs_writepages to use async writes
authorJeff Layton <jlayton@redhat.com>
Thu, 19 May 2011 20:22:57 +0000 (16:22 -0400)
committerSteve French <sfrench@us.ibm.com>
Wed, 25 May 2011 20:05:03 +0000 (20:05 +0000)
commitc3d17b63e5eafcaf2678c11de801c189468631c8
treece9edbb87abc452bf7ae1a3b33e2b5cac42ab023
parentb2e5cd33b598fb496b9366c445bd77c801efabb8
cifs: convert cifs_writepages to use async writes

Have cifs_writepages issue asynchronous writes instead of waiting on
each write call to complete before issuing another. This also allows us
to return more quickly from writepages. It can just send out all of the
I/Os and not wait around for the replies.

In the WB_SYNC_ALL case, if the write completes with a retryable error,
then the completion workqueue job will resend the write.

This also changes the page locking semantics a little bit. Instead of
holding the page lock until the response is received, release it after
doing the send. This will reduce contention for the page lock and should
prevent processes that have the file mmap'ed from being blocked
unnecessarily.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-and-Tested-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/file.c