diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-06-01 15:41:23 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-06-01 15:41:23 -0400 |
commit | 273d81d6ada951ba99f10b755d6f849dbb352730 (patch) | |
tree | cfb22593741e71b5f311c4180c542d63f7bcc4df /fs/cifs/inode.c | |
parent | 3856a9d443ee24248683c415e535f7a2b0fed0f3 (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/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a609d2668032..b88147c1dc27 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -180,11 +180,12 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
180 | else /* not direct, send byte range locks */ | 180 | else /* not direct, send byte range locks */ |
181 | inode->i_fop = &cifs_file_ops; | 181 | inode->i_fop = &cifs_file_ops; |
182 | 182 | ||
183 | inode->i_data.a_ops = &cifs_addr_ops; | ||
184 | /* check if server can support readpages */ | 183 | /* check if server can support readpages */ |
185 | if(pTcon->ses->server->maxBuf < | 184 | if(pTcon->ses->server->maxBuf < |
186 | 4096 + MAX_CIFS_HDR_SIZE) | 185 | PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE) |
187 | inode->i_data.a_ops->readpages = NULL; | 186 | inode->i_data.a_ops = &cifs_addr_ops_smallbuf; |
187 | else | ||
188 | inode->i_data.a_ops = &cifs_addr_ops; | ||
188 | } else if (S_ISDIR(inode->i_mode)) { | 189 | } else if (S_ISDIR(inode->i_mode)) { |
189 | cFYI(1, ("Directory inode")); | 190 | cFYI(1, ("Directory inode")); |
190 | inode->i_op = &cifs_dir_inode_ops; | 191 | inode->i_op = &cifs_dir_inode_ops; |
@@ -519,10 +520,11 @@ int cifs_get_inode_info(struct inode **pinode, | |||
519 | else /* not direct, send byte range locks */ | 520 | else /* not direct, send byte range locks */ |
520 | inode->i_fop = &cifs_file_ops; | 521 | inode->i_fop = &cifs_file_ops; |
521 | 522 | ||
522 | inode->i_data.a_ops = &cifs_addr_ops; | ||
523 | if(pTcon->ses->server->maxBuf < | 523 | if(pTcon->ses->server->maxBuf < |
524 | 4096 + MAX_CIFS_HDR_SIZE) | 524 | PAGE_CACHE_SIZE + MAX_CIFS_HDR_SIZE) |
525 | inode->i_data.a_ops->readpages = NULL; | 525 | inode->i_data.a_ops = &cifs_addr_ops_smallbuf; |
526 | else | ||
527 | inode->i_data.a_ops = &cifs_addr_ops; | ||
526 | } else if (S_ISDIR(inode->i_mode)) { | 528 | } else if (S_ISDIR(inode->i_mode)) { |
527 | cFYI(1, ("Directory inode")); | 529 | cFYI(1, ("Directory inode")); |
528 | inode->i_op = &cifs_dir_inode_ops; | 530 | inode->i_op = &cifs_dir_inode_ops; |