diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 923d071163b2..941b247fceb0 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -155,34 +155,39 @@ int cifs_get_inode_info_unix(struct inode **pinode, | |||
155 | } | 155 | } |
156 | 156 | ||
157 | if (num_of_bytes < end_of_file) | 157 | if (num_of_bytes < end_of_file) |
158 | cFYI(1, ("allocation size less than end of file ")); | 158 | cFYI(1, ("allocation size less than end of file")); |
159 | cFYI(1, | 159 | cFYI(1, |
160 | ("Size %ld and blocks %ld", | 160 | ("Size %ld and blocks %ld", |
161 | (unsigned long) inode->i_size, inode->i_blocks)); | 161 | (unsigned long) inode->i_size, inode->i_blocks)); |
162 | if (S_ISREG(inode->i_mode)) { | 162 | if (S_ISREG(inode->i_mode)) { |
163 | cFYI(1, (" File inode ")); | 163 | cFYI(1, ("File inode")); |
164 | inode->i_op = &cifs_file_inode_ops; | 164 | inode->i_op = &cifs_file_inode_ops; |
165 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) | 165 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { |
166 | inode->i_fop = &cifs_file_direct_ops; | 166 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) |
167 | else | 167 | inode->i_fop = |
168 | &cifs_file_direct_nobrl_ops; | ||
169 | else | ||
170 | inode->i_fop = &cifs_file_direct_ops; | ||
171 | } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | ||
172 | inode->i_fop = &cifs_file_nobrl_ops; | ||
173 | else /* not direct, send byte range locks */ | ||
168 | inode->i_fop = &cifs_file_ops; | 174 | inode->i_fop = &cifs_file_ops; |
169 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | 175 | |
170 | inode->i_fop->lock = NULL; | ||
171 | inode->i_data.a_ops = &cifs_addr_ops; | 176 | inode->i_data.a_ops = &cifs_addr_ops; |
172 | /* check if server can support readpages */ | 177 | /* check if server can support readpages */ |
173 | if(pTcon->ses->server->maxBuf < | 178 | if(pTcon->ses->server->maxBuf < |
174 | 4096 + MAX_CIFS_HDR_SIZE) | 179 | 4096 + MAX_CIFS_HDR_SIZE) |
175 | inode->i_data.a_ops->readpages = NULL; | 180 | inode->i_data.a_ops->readpages = NULL; |
176 | } else if (S_ISDIR(inode->i_mode)) { | 181 | } else if (S_ISDIR(inode->i_mode)) { |
177 | cFYI(1, (" Directory inode")); | 182 | cFYI(1, ("Directory inode")); |
178 | inode->i_op = &cifs_dir_inode_ops; | 183 | inode->i_op = &cifs_dir_inode_ops; |
179 | inode->i_fop = &cifs_dir_ops; | 184 | inode->i_fop = &cifs_dir_ops; |
180 | } else if (S_ISLNK(inode->i_mode)) { | 185 | } else if (S_ISLNK(inode->i_mode)) { |
181 | cFYI(1, (" Symbolic Link inode ")); | 186 | cFYI(1, ("Symbolic Link inode")); |
182 | inode->i_op = &cifs_symlink_inode_ops; | 187 | inode->i_op = &cifs_symlink_inode_ops; |
183 | /* tmp_inode->i_fop = */ /* do not need to set to anything */ | 188 | /* tmp_inode->i_fop = */ /* do not need to set to anything */ |
184 | } else { | 189 | } else { |
185 | cFYI(1, (" Init special inode ")); | 190 | cFYI(1, ("Init special inode")); |
186 | init_special_inode(inode, inode->i_mode, | 191 | init_special_inode(inode, inode->i_mode, |
187 | inode->i_rdev); | 192 | inode->i_rdev); |
188 | } | 193 | } |
@@ -379,12 +384,17 @@ int cifs_get_inode_info(struct inode **pinode, | |||
379 | if (S_ISREG(inode->i_mode)) { | 384 | if (S_ISREG(inode->i_mode)) { |
380 | cFYI(1, (" File inode ")); | 385 | cFYI(1, (" File inode ")); |
381 | inode->i_op = &cifs_file_inode_ops; | 386 | inode->i_op = &cifs_file_inode_ops; |
382 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) | 387 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { |
383 | inode->i_fop = &cifs_file_direct_ops; | 388 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) |
384 | else | 389 | inode->i_fop = |
390 | &cifs_file_direct_nobrl_ops; | ||
391 | else | ||
392 | inode->i_fop = &cifs_file_direct_ops; | ||
393 | } else if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | ||
394 | inode->i_fop = &cifs_file_nobrl_ops; | ||
395 | else /* not direct, send byte range locks */ | ||
385 | inode->i_fop = &cifs_file_ops; | 396 | inode->i_fop = &cifs_file_ops; |
386 | if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL) | 397 | |
387 | inode->i_fop->lock = NULL; | ||
388 | inode->i_data.a_ops = &cifs_addr_ops; | 398 | inode->i_data.a_ops = &cifs_addr_ops; |
389 | if(pTcon->ses->server->maxBuf < | 399 | if(pTcon->ses->server->maxBuf < |
390 | 4096 + MAX_CIFS_HDR_SIZE) | 400 | 4096 + MAX_CIFS_HDR_SIZE) |