aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e568cc47a7f9..36f78596c81a 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -74,6 +74,8 @@ struct smb_vol {
74 unsigned server_ino:1; /* use inode numbers from server ie UniqueId */ 74 unsigned server_ino:1; /* use inode numbers from server ie UniqueId */
75 unsigned direct_io:1; 75 unsigned direct_io:1;
76 unsigned remap:1; /* set to remap seven reserved chars in filenames */ 76 unsigned remap:1; /* set to remap seven reserved chars in filenames */
77 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */
78 unsigned sfu_emul:1;
77 unsigned int rsize; 79 unsigned int rsize;
78 unsigned int wsize; 80 unsigned int wsize;
79 unsigned int sockopt; 81 unsigned int sockopt;
@@ -745,6 +747,9 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
745 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ 747 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
746 vol->rw = TRUE; 748 vol->rw = TRUE;
747 749
750 /* default is always to request posix paths. */
751 vol->posix_paths = 1;
752
748 if (!options) 753 if (!options)
749 return 1; 754 return 1;
750 755
@@ -1023,6 +1028,14 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
1023 vol->remap = 1; 1028 vol->remap = 1;
1024 } else if (strnicmp(data, "nomapchars", 10) == 0) { 1029 } else if (strnicmp(data, "nomapchars", 10) == 0) {
1025 vol->remap = 0; 1030 vol->remap = 0;
1031 } else if (strnicmp(data, "sfu", 3) == 0) {
1032 vol->sfu_emul = 1;
1033 } else if (strnicmp(data, "nosfu", 5) == 0) {
1034 vol->sfu_emul = 0;
1035 } else if (strnicmp(data, "posixpaths", 10) == 0) {
1036 vol->posix_paths = 1;
1037 } else if (strnicmp(data, "noposixpaths", 12) == 0) {
1038 vol->posix_paths = 0;
1026 } else if (strnicmp(data, "setuids", 7) == 0) { 1039 } else if (strnicmp(data, "setuids", 7) == 0) {
1027 vol->setuids = 1; 1040 vol->setuids = 1;
1028 } else if (strnicmp(data, "nosetuids", 9) == 0) { 1041 } else if (strnicmp(data, "nosetuids", 9) == 0) {
@@ -1679,6 +1692,9 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1679 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; 1692 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR;
1680 if(volume_info.no_xattr) 1693 if(volume_info.no_xattr)
1681 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR; 1694 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_XATTR;
1695 if(volume_info.sfu_emul)
1696 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL;
1697
1682 if(volume_info.direct_io) { 1698 if(volume_info.direct_io) {
1683 cERROR(1,("mounting share using direct i/o")); 1699 cERROR(1,("mounting share using direct i/o"));
1684 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; 1700 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;
@@ -1781,6 +1797,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1781 cFYI(1,("server negotiated posix acl support")); 1797 cFYI(1,("server negotiated posix acl support"));
1782 sb->s_flags |= MS_POSIXACL; 1798 sb->s_flags |= MS_POSIXACL;
1783 } 1799 }
1800
1801 /* Try and negotiate POSIX pathnames if we can. */
1802 if (volume_info.posix_paths && (CIFS_UNIX_POSIX_PATHNAMES_CAP &
1803 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
1804 if (!CIFSSMBSetFSUnixInfo(xid, tcon, CIFS_UNIX_POSIX_PATHNAMES_CAP)) {
1805 cFYI(1,("negotiated posix pathnames support"));
1806 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS;
1807 } else {
1808 cFYI(1,("posix pathnames support requested but not supported"));
1809 }
1810 }
1784 } 1811 }
1785 } 1812 }
1786 } 1813 }