diff options
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 4e6558df54b8..acde2c5725bf 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -221,10 +221,10 @@ nfs_calc_block_size(u64 tsize) | |||
221 | static inline unsigned long | 221 | static inline unsigned long |
222 | nfs_block_size(unsigned long bsize, unsigned char *nrbitsp) | 222 | nfs_block_size(unsigned long bsize, unsigned char *nrbitsp) |
223 | { | 223 | { |
224 | if (bsize < 1024) | 224 | if (bsize < NFS_MIN_FILE_IO_SIZE) |
225 | bsize = NFS_DEF_FILE_IO_BUFFER_SIZE; | 225 | bsize = NFS_DEF_FILE_IO_SIZE; |
226 | else if (bsize >= NFS_MAX_FILE_IO_BUFFER_SIZE) | 226 | else if (bsize >= NFS_MAX_FILE_IO_SIZE) |
227 | bsize = NFS_MAX_FILE_IO_BUFFER_SIZE; | 227 | bsize = NFS_MAX_FILE_IO_SIZE; |
228 | 228 | ||
229 | return nfs_block_bits(bsize, nrbitsp); | 229 | return nfs_block_bits(bsize, nrbitsp); |
230 | } | 230 | } |
@@ -307,20 +307,15 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor) | |||
307 | max_rpc_payload = nfs_block_size(rpc_max_payload(server->client), NULL); | 307 | max_rpc_payload = nfs_block_size(rpc_max_payload(server->client), NULL); |
308 | if (server->rsize > max_rpc_payload) | 308 | if (server->rsize > max_rpc_payload) |
309 | server->rsize = max_rpc_payload; | 309 | server->rsize = max_rpc_payload; |
310 | if (server->wsize > max_rpc_payload) | 310 | if (server->rsize > NFS_MAX_FILE_IO_SIZE) |
311 | server->wsize = max_rpc_payload; | 311 | server->rsize = NFS_MAX_FILE_IO_SIZE; |
312 | |||
313 | server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 312 | server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
314 | if (server->rpages > NFS_READ_MAXIOV) { | ||
315 | server->rpages = NFS_READ_MAXIOV; | ||
316 | server->rsize = server->rpages << PAGE_CACHE_SHIFT; | ||
317 | } | ||
318 | 313 | ||
314 | if (server->wsize > max_rpc_payload) | ||
315 | server->wsize = max_rpc_payload; | ||
316 | if (server->wsize > NFS_MAX_FILE_IO_SIZE) | ||
317 | server->wsize = NFS_MAX_FILE_IO_SIZE; | ||
319 | server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; | 318 | server->wpages = (server->wsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; |
320 | if (server->wpages > NFS_WRITE_MAXIOV) { | ||
321 | server->wpages = NFS_WRITE_MAXIOV; | ||
322 | server->wsize = server->wpages << PAGE_CACHE_SHIFT; | ||
323 | } | ||
324 | 319 | ||
325 | if (sb->s_blocksize == 0) | 320 | if (sb->s_blocksize == 0) |
326 | sb->s_blocksize = nfs_block_bits(server->wsize, | 321 | sb->s_blocksize = nfs_block_bits(server->wsize, |