aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 53903a27f786..e3e762d774df 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -21,6 +21,7 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */ 22 */
23#include <linux/fs.h> 23#include <linux/fs.h>
24#include <linux/pagemap.h>
24#include <linux/stat.h> 25#include <linux/stat.h>
25#include <linux/smp_lock.h> 26#include <linux/smp_lock.h>
26#include "cifspdu.h" 27#include "cifspdu.h"
@@ -216,11 +217,13 @@ static void fill_in_inode(struct inode *tmp_inode,
216 else 217 else
217 tmp_inode->i_fop = &cifs_file_ops; 218 tmp_inode->i_fop = &cifs_file_ops;
218 219
219 tmp_inode->i_data.a_ops = &cifs_addr_ops;
220 if((cifs_sb->tcon) && (cifs_sb->tcon->ses) && 220 if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
221 (cifs_sb->tcon->ses->server->maxBuf < 221 (cifs_sb->tcon->ses->server->maxBuf <
222 4096 + MAX_CIFS_HDR_SIZE)) 222 PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
223 tmp_inode->i_data.a_ops->readpages = NULL; 223 tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
224 else
225 tmp_inode->i_data.a_ops = &cifs_addr_ops;
226
224 if(isNewInode) 227 if(isNewInode)
225 return; /* No sense invalidating pages for new inode 228 return; /* No sense invalidating pages for new inode
226 since have not started caching readahead file 229 since have not started caching readahead file
@@ -339,11 +342,12 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
339 else 342 else
340 tmp_inode->i_fop = &cifs_file_ops; 343 tmp_inode->i_fop = &cifs_file_ops;
341 344
342 tmp_inode->i_data.a_ops = &cifs_addr_ops;
343 if((cifs_sb->tcon) && (cifs_sb->tcon->ses) && 345 if((cifs_sb->tcon) && (cifs_sb->tcon->ses) &&
344 (cifs_sb->tcon->ses->server->maxBuf < 346 (cifs_sb->tcon->ses->server->maxBuf <
345 4096 + MAX_CIFS_HDR_SIZE)) 347 PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE))
346 tmp_inode->i_data.a_ops->readpages = NULL; 348 tmp_inode->i_data.a_ops = &cifs_addr_ops_smallbuf;
349 else
350 tmp_inode->i_data.a_ops = &cifs_addr_ops;
347 351
348 if(isNewInode) 352 if(isNewInode)
349 return; /* No sense invalidating pages for new inode since we 353 return; /* No sense invalidating pages for new inode since we