diff options
author | Steve French <sfrench@us.ibm.com> | 2005-10-03 16:37:24 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-10-03 16:37:24 -0400 |
commit | 3e84469d0101456caceffc6b22218a49017fcd3f (patch) | |
tree | 2e52687ade7f3e52b5621142997ca6e7b38df70a /fs/cifs/file.c | |
parent | 70ca734a14366b634224a1e4586d43b36b65ab67 (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.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 3766db2bb7f2..941108352547 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, | |||
849 | /* BB FIXME We can not sign across two buffers yet */ | 849 | /* BB FIXME We can not sign across two buffers yet */ |
850 | if((experimEnabled) && ((pTcon->ses->server->secMode & | 850 | if((experimEnabled) && ((pTcon->ses->server->secMode & |
851 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) { | 851 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0)) { |
852 | struct kvec iov[2]; | ||
853 | unsigned int len; | ||
854 | |||
855 | len = min(cifs_sb->wsize, | ||
856 | write_size - total_written); | ||
857 | /* iov[0] is reserved for smb header */ | ||
858 | iov[1].iov_base = (char *)write_data + | ||
859 | total_written; | ||
860 | iov[1].iov_len = len; | ||
852 | rc = CIFSSMBWrite2(xid, pTcon, | 861 | rc = CIFSSMBWrite2(xid, pTcon, |
853 | open_file->netfid, | 862 | open_file->netfid, len, |
854 | min_t(const int, cifs_sb->wsize, | ||
855 | write_size - total_written), | ||
856 | *poffset, &bytes_written, | 863 | *poffset, &bytes_written, |
857 | write_data + total_written, | 864 | iov, 1, long_op); |
858 | long_op); | ||
859 | } else | 865 | } else |
860 | /* BB FIXME fixup indentation of line below */ | 866 | /* BB FIXME fixup indentation of line below */ |
861 | #endif | 867 | #endif |