diff options
author | Steve French <sfrench@us.ibm.com> | 2005-07-14 19:25:12 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-07-14 19:25:12 -0400 |
commit | d7245c2ccf14cde2023273c1ec246732d96e2c27 (patch) | |
tree | 657d7b5c9431b6117659f9638f4121ac237d4c5f /fs/cifs | |
parent | 4887c61811c2283162684d7f9075b7676ef6a9bf (diff) |
[CIFS] Add compat with SFU (part 1)
This should help the case of creating fifos and other special files to
servers which do not support the Unix extensions.
Signed-off-by: Steve French (sfrench@us.ibm.com)
Thanks to Martin Koeppe for his suggestions and good analysis
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifs_fs_sb.h | 1 | ||||
-rw-r--r-- | fs/cifs/connect.c | 7 | ||||
-rw-r--r-- | fs/cifs/dir.c | 12 |
3 files changed, 19 insertions, 1 deletions
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index 5dc5fe6b486d..6b93587c490e 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define CIFS_MOUNT_NO_XATTR 0x10 /* if set - disable xattr support */ | 25 | #define CIFS_MOUNT_NO_XATTR 0x10 /* if set - disable xattr support */ |
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 | 29 | ||
29 | struct cifs_sb_info { | 30 | struct cifs_sb_info { |
30 | struct cifsTconInfo *tcon; /* primary mount */ | 31 | struct cifsTconInfo *tcon; /* primary mount */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f6d2a7974fc1..36f78596c81a 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -75,6 +75,7 @@ struct smb_vol { | |||
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. */ | 77 | unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ |
78 | unsigned sfu_emul:1; | ||
78 | unsigned int rsize; | 79 | unsigned int rsize; |
79 | unsigned int wsize; | 80 | unsigned int wsize; |
80 | unsigned int sockopt; | 81 | unsigned int sockopt; |
@@ -1027,6 +1028,10 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol) | |||
1027 | vol->remap = 1; | 1028 | vol->remap = 1; |
1028 | } else if (strnicmp(data, "nomapchars", 10) == 0) { | 1029 | } else if (strnicmp(data, "nomapchars", 10) == 0) { |
1029 | 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; | ||
1030 | } else if (strnicmp(data, "posixpaths", 10) == 0) { | 1035 | } else if (strnicmp(data, "posixpaths", 10) == 0) { |
1031 | vol->posix_paths = 1; | 1036 | vol->posix_paths = 1; |
1032 | } else if (strnicmp(data, "noposixpaths", 12) == 0) { | 1037 | } else if (strnicmp(data, "noposixpaths", 12) == 0) { |
@@ -1687,6 +1692,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, | |||
1687 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; | 1692 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_MAP_SPECIAL_CHR; |
1688 | if(volume_info.no_xattr) | 1693 | if(volume_info.no_xattr) |
1689 | 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; | ||
1690 | 1697 | ||
1691 | if(volume_info.direct_io) { | 1698 | if(volume_info.direct_io) { |
1692 | cERROR(1,("mounting share using direct i/o")); | 1699 | cERROR(1,("mounting share using direct i/o")); |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 9360d8fb9ef7..0d5e27fec92b 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -209,7 +209,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
209 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 209 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
210 | } | 210 | } |
211 | else { | 211 | else { |
212 | /* BB implement via Windows security descriptors */ | 212 | /* BB implement mode setting via Windows security descriptors */ |
213 | /* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/ | 213 | /* eg CIFSSMBWinSetPerms(xid,pTcon,full_path,mode,-1,-1,local_nls);*/ |
214 | /* could set r/o dos attribute if mode & 0222 == 0 */ | 214 | /* could set r/o dos attribute if mode & 0222 == 0 */ |
215 | } | 215 | } |
@@ -326,6 +326,16 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev | |||
326 | if(rc == 0) | 326 | if(rc == 0) |
327 | d_instantiate(direntry, newinode); | 327 | d_instantiate(direntry, newinode); |
328 | } | 328 | } |
329 | } else { | ||
330 | if((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) && | ||
331 | (special_file(mode))) { | ||
332 | |||
333 | cFYI(1,("sfu compat create special file")); | ||
334 | /* Attributes = cpu_to_le32(ATTR_SYSTEM); | ||
335 | rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, ...); */ | ||
336 | |||
337 | /* add code here to set EAs */ | ||
338 | } | ||
329 | } | 339 | } |
330 | 340 | ||
331 | kfree(full_path); | 341 | kfree(full_path); |