diff options
author | Steve French <sfrench@us.ibm.com> | 2005-10-05 18:14:33 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-10-05 18:14:33 -0400 |
commit | 4a77118cd5018fec11bf86f6f8d659352ad9a92b (patch) | |
tree | eab48dadfdf7398815b2bba5de93ff2332727386 /fs/cifs | |
parent | 37c0eb4677f733a773df6287b0f73f00274402e3 (diff) |
CIFS: Allow wsize to exceed CIFSMaxBufSize
This allows cifs_writepages to send data in larger chunks from the page
cache, without requiring larger memory allocations in other cases.
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/connect.c | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 8 | ||||
-rw-r--r-- | fs/cifs/transport.c | 16 |
3 files changed, 10 insertions, 16 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f05d9e2016d5..31eb9a3bf627 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -1740,7 +1740,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1740 | cifs_sb->rsize = volume_info.rsize; | 1740 | cifs_sb->rsize = volume_info.rsize; |
1741 | else | 1741 | else |
1742 | cifs_sb->rsize = srvTcp->maxBuf - MAX_CIFS_HDR_SIZE; /* default */ | 1742 | cifs_sb->rsize = srvTcp->maxBuf - MAX_CIFS_HDR_SIZE; /* default */ |
1743 | if((volume_info.wsize) && (volume_info.wsize <= CIFSMaxBufSize)) | 1743 | if(volume_info.wsize) |
1744 | cifs_sb->wsize = volume_info.wsize; | 1744 | cifs_sb->wsize = volume_info.wsize; |
1745 | else | 1745 | else |
1746 | cifs_sb->wsize = CIFSMaxBufSize; /* default */ | 1746 | cifs_sb->wsize = CIFSMaxBufSize; /* default */ |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0473b221f643..0f66ae5b694b 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -925,6 +925,7 @@ static struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode) | |||
925 | /* if it fails, try another handle - might be */ | 925 | /* if it fails, try another handle - might be */ |
926 | /* dangerous to hold up writepages with retry */ | 926 | /* dangerous to hold up writepages with retry */ |
927 | if(rc) { | 927 | if(rc) { |
928 | cFYI(1,("failed on reopen file in wp")); | ||
928 | read_lock(&GlobalSMBSeslock); | 929 | read_lock(&GlobalSMBSeslock); |
929 | continue; | 930 | continue; |
930 | } | 931 | } |
@@ -1028,6 +1029,13 @@ static int cifs_writepages(struct address_space *mapping, | |||
1028 | if (cifs_sb->wsize < PAGE_CACHE_SIZE) | 1029 | if (cifs_sb->wsize < PAGE_CACHE_SIZE) |
1029 | return generic_writepages(mapping, wbc); | 1030 | return generic_writepages(mapping, wbc); |
1030 | 1031 | ||
1032 | /* BB FIXME we do not have code to sign across multiple buffers yet, | ||
1033 | so go to older writepage style write which we can sign if needed */ | ||
1034 | if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) | ||
1035 | if(cifs_sb->tcon->ses->server->secMode & | ||
1036 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | ||
1037 | return generic_writepages(mapping, wbc); | ||
1038 | |||
1031 | /* | 1039 | /* |
1032 | * BB: Is this meaningful for a non-block-device file system? | 1040 | * BB: Is this meaningful for a non-block-device file system? |
1033 | * If it is, we should test it again after we do I/O | 1041 | * If it is, we should test it again after we do I/O |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index e104c1ad2da3..c86b7077b92f 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -361,22 +361,8 @@ SendReceive2(const unsigned int xid, struct cifsSesInfo *ses, | |||
361 | return -ENOMEM; | 361 | return -ENOMEM; |
362 | } | 362 | } |
363 | 363 | ||
364 | if (in_buf->smb_buf_length > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { | ||
365 | up(&ses->server->tcpSem); | ||
366 | cERROR(1, | ||
367 | ("Illegal length, greater than maximum frame, %d ", | ||
368 | in_buf->smb_buf_length)); | ||
369 | DeleteMidQEntry(midQ); | ||
370 | /* If not lock req, update # of requests on wire to server */ | ||
371 | if(long_op < 3) { | ||
372 | atomic_dec(&ses->server->inFlight); | ||
373 | wake_up(&ses->server->request_q); | ||
374 | } | ||
375 | return -EIO; | ||
376 | } | ||
377 | |||
378 | /* BB FIXME */ | 364 | /* BB FIXME */ |
379 | /* rc = cifs_sign_smb2(in_buf, data, ses->server, &midQ->sequence_number); */ | 365 | /* rc = cifs_sign_smb2(iov, n_vec, ses->server, &midQ->sequence_number); */ |
380 | 366 | ||
381 | midQ->midState = MID_REQUEST_SUBMITTED; | 367 | midQ->midState = MID_REQUEST_SUBMITTED; |
382 | rc = smb_send2(ses->server->ssocket, iov, n_vec, | 368 | rc = smb_send2(ses->server->ssocket, iov, n_vec, |