aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-18 23:49:57 -0400
committerSteve French <sfrench@us.ibm.com>2005-08-18 23:49:57 -0400
commitc46fa8acdc533e8084359ea11c79d56eb98313fb (patch)
treed9455c92f58c99e342856995668739236bdd09e3
parent8d0d50948b276b46b75b1b5855d3f9fab1e0fd92 (diff)
[CIFS] Add mount option for disabling sending byte range lock requests
over the wire (to help the case when applications break with cifs mandatory lock behavior. Add part one of mount option for requesting case insensitive path name matching. Signed-off-by: Steve French (sfrench@us.ibm.com)
-rw-r--r--fs/cifs/CHANGES8
-rw-r--r--fs/cifs/README7
-rw-r--r--fs/cifs/cifs_fs_sb.h2
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/connect.c14
-rw-r--r--fs/cifs/inode.c4
-rw-r--r--fs/cifs/readdir.c10
7 files changed, 39 insertions, 8 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 3196d4c4eed3..b0429ea524fb 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,3 +1,11 @@
1Version 1.36
2------------
3Add mount option for disabling the default behavior of sending byte range lock
4requests to the server (necessary for certain applications which break with
5mandatory lock behavior such as Evolution), and also mount option for
6requesting case insensitive matching for path based requests (requesting
7case sensitive is the default).
8
1Version 1.35 9Version 1.35
2------------ 10------------
3Add writepage performance improvements. Fix path name conversions 11Add writepage performance improvements. Fix path name conversions
diff --git a/fs/cifs/README b/fs/cifs/README
index 34b0cf7111f3..3b610d08dc1e 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -407,6 +407,13 @@ A partial list of the supported mount options follows:
407 This has no effect if the server does not support 407 This has no effect if the server does not support
408 Unicode on the wire. 408 Unicode on the wire.
409 nomapchars Do not translate any of these seven characters (default). 409 nomapchars Do not translate any of these seven characters (default).
410 nocase Request case insensitive path name matching (case
411 sensitive is the default if the server suports it).
412 nobrl Do not send byte range lock requests to the server.
413 This is necessary for certain applications that break
414 with cifs style mandatory byte range locks (and most
415 cifs servers do not yet support requesting advisory
416 byte range locks).
410 remount remount the share (often used to change from ro to rw mounts 417 remount remount the share (often used to change from ro to rw mounts
411 or vice versa) 418 or vice versa)
412 419
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 6b93587c490e..5fb695f1e50b 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -26,6 +26,8 @@
26#define CIFS_MOUNT_MAP_SPECIAL_CHR 0x20 /* remap illegal chars in filenames */ 26#define CIFS_MOUNT_MAP_SPECIAL_CHR 0x20 /* remap illegal chars in filenames */
27#define CIFS_MOUNT_POSIX_PATHS 0x40 /* Negotiate posix pathnames if possible. */ 27#define CIFS_MOUNT_POSIX_PATHS 0x40 /* Negotiate posix pathnames if possible. */
28#define CIFS_MOUNT_UNX_EMUL 0x80 /* Network compat with SFUnix emulation */ 28#define CIFS_MOUNT_UNX_EMUL 0x80 /* Network compat with SFUnix emulation */
29#define CIFS_MOUNT_CASE_INSENS 0x100 /* Request case insenstive searches */
30#define CIFS_MOUNT_NO_BRL 0x200 /* No sending byte range locks to srv */
29 31
30struct cifs_sb_info { 32struct cifs_sb_info {
31 struct cifsTconInfo *tcon; /* primary mount */ 33 struct cifsTconInfo *tcon; /* primary mount */
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 78af5850c558..cf45ca359dba 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -96,5 +96,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
96extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); 96extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
97extern int cifs_ioctl (struct inode * inode, struct file * filep, 97extern int cifs_ioctl (struct inode * inode, struct file * filep,
98 unsigned int command, unsigned long arg); 98 unsigned int command, unsigned long arg);
99#define CIFS_VERSION "1.35" 99#define CIFS_VERSION "1.36"
100#endif /* _CIFSFS_H */ 100#endif /* _CIFSFS_H */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index ef0432c44482..6b21f6aa9f60 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -79,6 +79,8 @@ struct smb_vol {
79 unsigned remap:1; /* set to remap seven reserved chars in filenames */ 79 unsigned remap:1; /* set to remap seven reserved chars in filenames */
80 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ 80 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */
81 unsigned sfu_emul:1; 81 unsigned sfu_emul:1;
82 unsigned nocase; /* request case insensitive filenames */
83 unsigned nobrl; /* disable sending byte range locks to srv */
82 unsigned int rsize; 84 unsigned int rsize;
83 unsigned int wsize; 85 unsigned int wsize;
84 unsigned int sockopt; 86 unsigned int sockopt;
@@ -1040,6 +1042,12 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
1040 vol->posix_paths = 1; 1042 vol->posix_paths = 1;
1041 } else if (strnicmp(data, "noposixpaths", 12) == 0) { 1043 } else if (strnicmp(data, "noposixpaths", 12) == 0) {
1042 vol->posix_paths = 0; 1044 vol->posix_paths = 0;
1045 } else if (strnicmp(data, "nocase", 6) == 0) {
1046 vol->nocase = 1;
1047 } else if (strnicmp(data, "brl", 3) == 0) {
1048 vol->nobrl = 0;
1049 } else if (strnicmp(data, "nobrl", 5) == 0) {
1050 vol->nobrl = 1;
1043 } else if (strnicmp(data, "setuids", 7) == 0) { 1051 } else if (strnicmp(data, "setuids", 7) == 0) {
1044 vol->setuids = 1; 1052 vol->setuids = 1;
1045 } else if (strnicmp(data, "nosetuids", 9) == 0) { 1053 } else if (strnicmp(data, "nosetuids", 9) == 0) {
@@ -1699,9 +1707,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1699 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; 1707 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR;
1700 if(volume_info.sfu_emul) 1708 if(volume_info.sfu_emul)
1701 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL; 1709 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL;
1710 if(volume_info.nocase)
1711 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_CASE_INSENS;
1712 if(volume_info.nobrl)
1713 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_BRL;
1702 1714
1703 if(volume_info.direct_io) { 1715 if(volume_info.direct_io) {
1704 cERROR(1,("mounting share using direct i/o")); 1716 cFYI(1,("mounting share using direct i/o"));
1705 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; 1717 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
1706 } 1718 }
1707 1719
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 628aa1a9fe64..ed3e9207d92e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -166,6 +166,8 @@ int cifs_get_inode_info_unix(struct inode **pinode,
166 inode->i_fop = &cifs_file_direct_ops; 166 inode->i_fop = &cifs_file_direct_ops;
167 else 167 else
168 inode->i_fop = &cifs_file_ops; 168 inode->i_fop = &cifs_file_ops;
169 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
170 inode->i_fop->lock = NULL;
169 inode->i_data.a_ops = &cifs_addr_ops; 171 inode->i_data.a_ops = &cifs_addr_ops;
170 } else if (S_ISDIR(inode->i_mode)) { 172 } else if (S_ISDIR(inode->i_mode)) {
171 cFYI(1, (" Directory inode")); 173 cFYI(1, (" Directory inode"));
@@ -369,6 +371,8 @@ int cifs_get_inode_info(struct inode **pinode,
369 inode->i_fop = &cifs_file_direct_ops; 371 inode->i_fop = &cifs_file_direct_ops;
370 else 372 else
371 inode->i_fop = &cifs_file_ops; 373 inode->i_fop = &cifs_file_ops;
374 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
375 inode->i_fop->lock = NULL;
372 inode->i_data.a_ops = &cifs_addr_ops; 376 inode->i_data.a_ops = &cifs_addr_ops;
373 } else if (S_ISDIR(inode->i_mode)) { 377 } else if (S_ISDIR(inode->i_mode)) {
374 cFYI(1, (" Directory inode ")); 378 cFYI(1, (" Directory inode "));
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index dec3c9dd04d7..ef5eb804ce82 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -194,6 +194,8 @@ static void fill_in_inode(struct inode *tmp_inode,
194 tmp_inode->i_fop = &cifs_file_direct_ops; 194 tmp_inode->i_fop = &cifs_file_direct_ops;
195 else 195 else
196 tmp_inode->i_fop = &cifs_file_ops; 196 tmp_inode->i_fop = &cifs_file_ops;
197 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
198 tmp_inode->i_fop->lock = NULL;
197 tmp_inode->i_data.a_ops = &cifs_addr_ops; 199 tmp_inode->i_data.a_ops = &cifs_addr_ops;
198 200
199 if(isNewInode) 201 if(isNewInode)
@@ -298,6 +300,8 @@ static void unix_fill_in_inode(struct inode *tmp_inode,
298 tmp_inode->i_fop = &cifs_file_direct_ops; 300 tmp_inode->i_fop = &cifs_file_direct_ops;
299 else 301 else
300 tmp_inode->i_fop = &cifs_file_ops; 302 tmp_inode->i_fop = &cifs_file_ops;
303 if(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_BRL)
304 tmp_inode->i_fop->lock = NULL;
301 tmp_inode->i_data.a_ops = &cifs_addr_ops; 305 tmp_inode->i_data.a_ops = &cifs_addr_ops;
302 306
303 if(isNewInode) 307 if(isNewInode)
@@ -557,7 +561,6 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
557 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start + 561 char * end_of_smb = cifsFile->srch_inf.ntwrk_buf_start +
558 smbCalcSize((struct smb_hdr *) 562 smbCalcSize((struct smb_hdr *)
559 cifsFile->srch_inf.ntwrk_buf_start); 563 cifsFile->srch_inf.ntwrk_buf_start);
560/* dump_cifs_file_struct(file,"found entry in fce "); */
561 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry 564 first_entry_in_buffer = cifsFile->srch_inf.index_of_last_entry
562 - cifsFile->srch_inf.entries_in_buffer; 565 - cifsFile->srch_inf.entries_in_buffer;
563 pos_in_buf = index_to_find - first_entry_in_buffer; 566 pos_in_buf = index_to_find - first_entry_in_buffer;
@@ -595,7 +598,6 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
595 *num_to_ret = 0; 598 *num_to_ret = 0;
596 } else 599 } else
597 *num_to_ret = cifsFile->srch_inf.entries_in_buffer - pos_in_buf; 600 *num_to_ret = cifsFile->srch_inf.entries_in_buffer - pos_in_buf;
598/* dump_cifs_file_struct(file, "end fce ");*/
599 601
600 return rc; 602 return rc;
601} 603}
@@ -815,14 +817,12 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
815 FreeXid(xid); 817 FreeXid(xid);
816 return -EIO; 818 return -EIO;
817 } 819 }
818/* dump_cifs_file_struct(file, "Begin rdir "); */
819 820
820 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 821 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
821 pTcon = cifs_sb->tcon; 822 pTcon = cifs_sb->tcon;
822 if(pTcon == NULL) 823 if(pTcon == NULL)
823 return -EINVAL; 824 return -EINVAL;
824 825
825/* cFYI(1,("readdir2 pos: %lld",file->f_pos)); */
826 826
827 switch ((int) file->f_pos) { 827 switch ((int) file->f_pos) {
828 case 0: 828 case 0:
@@ -876,7 +876,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
876 cifsFile->search_resume_name = NULL; */ 876 cifsFile->search_resume_name = NULL; */
877 877
878 /* BB account for . and .. in f_pos as special case */ 878 /* BB account for . and .. in f_pos as special case */
879 /* dump_cifs_file_struct(file, "rdir after default ");*/
880 879
881 rc = find_cifs_entry(xid,pTcon, file, 880 rc = find_cifs_entry(xid,pTcon, file,
882 &current_entry,&num_to_fill); 881 &current_entry,&num_to_fill);
@@ -924,7 +923,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
924 } /* end switch */ 923 } /* end switch */
925 924
926rddir2_exit: 925rddir2_exit:
927 /* dump_cifs_file_struct(file, "end rdir "); */
928 FreeXid(xid); 926 FreeXid(xid);
929 return rc; 927 return rc;
930} 928}