summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-10-03 13:37:24 -0700
committerSteve French <sfrench@us.ibm.com>2005-10-03 13:37:24 -0700
commit3e84469d0101456caceffc6b22218a49017fcd3f (patch)
tree2e52687ade7f3e52b5621142997ca6e7b38df70a /fs/cifs/file.c
parent70ca734a14366b634224a1e4586d43b36b65ab67 (diff)
[CIFS] Add writepages support to shrink memory usage on writes,
eliminate the double copy, and improve cifs write performance and help the server by upping the typical write size from 4K to 16K (or even larger if wsize set explicitly) for servers which support this. Part 1 of 2 Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 3766db2bb7f..94110835254 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -849,13 +849,19 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
/* BB FIXME We can not sign across two buffers yet */
if((experimEnabled) && ((pTcon->ses->server->secMode &
(SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) {
+ struct kvec iov[2];
+ unsigned int len;
+
+ len = min(cifs_sb->wsize,
+ write_size - total_written);
+ /* iov[0] is reserved for smb header */
+ iov[1].iov_base = (char *)write_data +
+ total_written;
+ iov[1].iov_len = len;
rc = CIFSSMBWrite2(xid, pTcon,
- open_file->netfid,
- min_t(const int, cifs_sb->wsize,
- write_size - total_written),
+ open_file->netfid, len,
*poffset, &bytes_written,
- write_data + total_written,
- long_op);
+ iov, 1, long_op);
} else
/* BB FIXME fixup indentation of line below */
#endif