diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index def10064fe9d..35cb6a374a45 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1149,9 +1149,8 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) | |||
1149 | goto unlink_out; | 1149 | goto unlink_out; |
1150 | } | 1150 | } |
1151 | 1151 | ||
1152 | if ((tcon->ses->capabilities & CAP_UNIX) && | 1152 | if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP & |
1153 | (CIFS_UNIX_POSIX_PATH_OPS_CAP & | 1153 | le64_to_cpu(tcon->fsUnixInfo.Capability))) { |
1154 | le64_to_cpu(tcon->fsUnixInfo.Capability))) { | ||
1155 | rc = CIFSPOSIXDelFile(xid, tcon, full_path, | 1154 | rc = CIFSPOSIXDelFile(xid, tcon, full_path, |
1156 | SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, | 1155 | SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, |
1157 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 1156 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -1226,7 +1225,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1226 | unsigned int xid; | 1225 | unsigned int xid; |
1227 | struct cifs_sb_info *cifs_sb; | 1226 | struct cifs_sb_info *cifs_sb; |
1228 | struct tcon_link *tlink; | 1227 | struct tcon_link *tlink; |
1229 | struct cifs_tcon *pTcon; | 1228 | struct cifs_tcon *tcon; |
1230 | char *full_path = NULL; | 1229 | char *full_path = NULL; |
1231 | struct inode *newinode = NULL; | 1230 | struct inode *newinode = NULL; |
1232 | struct cifs_fattr fattr; | 1231 | struct cifs_fattr fattr; |
@@ -1237,7 +1236,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1237 | tlink = cifs_sb_tlink(cifs_sb); | 1236 | tlink = cifs_sb_tlink(cifs_sb); |
1238 | if (IS_ERR(tlink)) | 1237 | if (IS_ERR(tlink)) |
1239 | return PTR_ERR(tlink); | 1238 | return PTR_ERR(tlink); |
1240 | pTcon = tlink_tcon(tlink); | 1239 | tcon = tlink_tcon(tlink); |
1241 | 1240 | ||
1242 | xid = get_xid(); | 1241 | xid = get_xid(); |
1243 | 1242 | ||
@@ -1247,9 +1246,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1247 | goto mkdir_out; | 1246 | goto mkdir_out; |
1248 | } | 1247 | } |
1249 | 1248 | ||
1250 | if ((pTcon->ses->capabilities & CAP_UNIX) && | 1249 | if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP & |
1251 | (CIFS_UNIX_POSIX_PATH_OPS_CAP & | 1250 | le64_to_cpu(tcon->fsUnixInfo.Capability))) { |
1252 | le64_to_cpu(pTcon->fsUnixInfo.Capability))) { | ||
1253 | u32 oplock = 0; | 1251 | u32 oplock = 0; |
1254 | FILE_UNIX_BASIC_INFO *pInfo = | 1252 | FILE_UNIX_BASIC_INFO *pInfo = |
1255 | kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); | 1253 | kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); |
@@ -1259,7 +1257,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1259 | } | 1257 | } |
1260 | 1258 | ||
1261 | mode &= ~current_umask(); | 1259 | mode &= ~current_umask(); |
1262 | rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT, | 1260 | rc = CIFSPOSIXCreate(xid, tcon, SMB_O_DIRECTORY | SMB_O_CREAT, |
1263 | mode, NULL /* netfid */, pInfo, &oplock, | 1261 | mode, NULL /* netfid */, pInfo, &oplock, |
1264 | full_path, cifs_sb->local_nls, | 1262 | full_path, cifs_sb->local_nls, |
1265 | cifs_sb->mnt_cifs_flags & | 1263 | cifs_sb->mnt_cifs_flags & |
@@ -1303,14 +1301,14 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1303 | } | 1301 | } |
1304 | mkdir_retry_old: | 1302 | mkdir_retry_old: |
1305 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ | 1303 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ |
1306 | rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, | 1304 | rc = CIFSSMBMkDir(xid, tcon, full_path, cifs_sb->local_nls, |
1307 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 1305 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
1308 | if (rc) { | 1306 | if (rc) { |
1309 | cFYI(1, "cifs_mkdir returned 0x%x", rc); | 1307 | cFYI(1, "cifs_mkdir returned 0x%x", rc); |
1310 | d_drop(direntry); | 1308 | d_drop(direntry); |
1311 | } else { | 1309 | } else { |
1312 | mkdir_get_info: | 1310 | mkdir_get_info: |
1313 | if (pTcon->unix_ext) | 1311 | if (tcon->unix_ext) |
1314 | rc = cifs_get_inode_info_unix(&newinode, full_path, | 1312 | rc = cifs_get_inode_info_unix(&newinode, full_path, |
1315 | inode->i_sb, xid); | 1313 | inode->i_sb, xid); |
1316 | else | 1314 | else |
@@ -1328,7 +1326,7 @@ mkdir_get_info: | |||
1328 | if (inode->i_mode & S_ISGID) | 1326 | if (inode->i_mode & S_ISGID) |
1329 | mode |= S_ISGID; | 1327 | mode |= S_ISGID; |
1330 | 1328 | ||
1331 | if (pTcon->unix_ext) { | 1329 | if (tcon->unix_ext) { |
1332 | struct cifs_unix_set_info_args args = { | 1330 | struct cifs_unix_set_info_args args = { |
1333 | .mode = mode, | 1331 | .mode = mode, |
1334 | .ctime = NO_CHANGE_64, | 1332 | .ctime = NO_CHANGE_64, |
@@ -1346,7 +1344,7 @@ mkdir_get_info: | |||
1346 | args.uid = NO_CHANGE_64; | 1344 | args.uid = NO_CHANGE_64; |
1347 | args.gid = NO_CHANGE_64; | 1345 | args.gid = NO_CHANGE_64; |
1348 | } | 1346 | } |
1349 | CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, &args, | 1347 | CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args, |
1350 | cifs_sb->local_nls, | 1348 | cifs_sb->local_nls, |
1351 | cifs_sb->mnt_cifs_flags & | 1349 | cifs_sb->mnt_cifs_flags & |
1352 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 1350 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
@@ -1361,7 +1359,7 @@ mkdir_get_info: | |||
1361 | cifsInode = CIFS_I(newinode); | 1359 | cifsInode = CIFS_I(newinode); |
1362 | dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; | 1360 | dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; |
1363 | pInfo.Attributes = cpu_to_le32(dosattrs); | 1361 | pInfo.Attributes = cpu_to_le32(dosattrs); |
1364 | tmprc = CIFSSMBSetPathInfo(xid, pTcon, | 1362 | tmprc = CIFSSMBSetPathInfo(xid, tcon, |
1365 | full_path, &pInfo, | 1363 | full_path, &pInfo, |
1366 | cifs_sb->local_nls, | 1364 | cifs_sb->local_nls, |
1367 | cifs_sb->mnt_cifs_flags & | 1365 | cifs_sb->mnt_cifs_flags & |