aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2006-06-01 15:41:23 -0400
committerSteve French <sfrench@us.ibm.com>2006-06-01 15:41:23 -0400
commit273d81d6ada951ba99f10b755d6f849dbb352730 (patch)
treecfb22593741e71b5f311c4180c542d63f7bcc4df /fs/cifs/readdir.c
parent3856a9d443ee24248683c415e535f7a2b0fed0f3 (diff)
[CIFS] Do not overwrite aops
cifs should not be overwriting an element of the aops structure, since the structure is shared by all cifs inodes. Instead define a separate aops structure to suit each purpose. I also took the liberty of replacing a hard-coded 4096 with PAGE_CACHE_SIZE Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steven French <sfrench@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
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