diff options
author | Steve French <sfrench@us.ibm.com> | 2007-02-02 04:21:57 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-02-02 04:21:57 +0000 |
commit | 9a0c8230e84898ed27f790408805e33fa482b2f9 (patch) | |
tree | 785eb8b75b4bac6a48f58d8593aa40c2f345d762 /fs/cifs/file.c | |
parent | 030e9d8147491a9d2fe1b67882a3720fcf8b95f7 (diff) | |
download | op-kernel-dev-9a0c8230e84898ed27f790408805e33fa482b2f9.zip op-kernel-dev-9a0c8230e84898ed27f790408805e33fa482b2f9.tar.gz |
[CIFS] Reduce cifs stack space usage
The two cifs functions that used the most stack according
to "make checkstack" have been changed to use less stack.
Thanks to jra and Shaggy for helpful ideas
Signed-off-by: Steve French <sfrench@us.ibm.com>
cc: jra@samba.org
cc: shaggy@us.ibm.com
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8a49b2e..e9dcf5e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1146,7 +1146,7 @@ static int cifs_writepages(struct address_space *mapping, pgoff_t end; pgoff_t index; int range_whole = 0; - struct kvec iov[32]; + struct kvec * iov; int len; int n_iov = 0; pgoff_t next; @@ -1171,15 +1171,21 @@ static int cifs_writepages(struct address_space *mapping, if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) if(cifs_sb->tcon->ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) - if(!experimEnabled) + if(!experimEnabled) return generic_writepages(mapping, wbc); + iov = kmalloc(32 * sizeof(struct kvec), GFP_KERNEL); + if(iov == NULL) + return generic_writepages(mapping, wbc); + + /* * BB: Is this meaningful for a non-block-device file system? * If it is, we should test it again after we do I/O */ if (wbc->nonblocking && bdi_write_congested(bdi)) { wbc->encountered_congestion = 1; + kfree(iov); return 0; } @@ -1345,7 +1351,7 @@ retry: mapping->writeback_index = index; FreeXid(xid); - + kfree(iov); return rc; } |