diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-03-17 04:41:12 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-27 16:17:40 -0400 |
commit | f436720e94ac53413e20c48b02d16e2ef180e166 (patch) | |
tree | fa831b67f689a847fcdb0942ad624c6d060594de /fs/cifs/inode.c | |
parent | ff691e969433a54e26fb6502a6613e02c680e8ee (diff) |
CIFS: Separate protocol specific part from mkdir
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index e9ba1a150fe3..d7e74b1268cb 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1272,24 +1272,11 @@ cifs_mkdir_qinfo(struct inode *inode, struct dentry *dentry, umode_t mode, | |||
1272 | cifs_sb->mnt_cifs_flags & | 1272 | cifs_sb->mnt_cifs_flags & |
1273 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 1273 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
1274 | } else { | 1274 | } else { |
1275 | struct TCP_Server_Info *server = tcon->ses->server; | ||
1275 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && | 1276 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && |
1276 | (mode & S_IWUGO) == 0) { | 1277 | (mode & S_IWUGO) == 0 && server->ops->mkdir_setinfo) |
1277 | FILE_BASIC_INFO info; | 1278 | server->ops->mkdir_setinfo(newinode, full_path, cifs_sb, |
1278 | struct cifsInodeInfo *cifsInode; | 1279 | tcon, xid); |
1279 | u32 dosattrs; | ||
1280 | int tmprc; | ||
1281 | |||
1282 | memset(&info, 0, sizeof(info)); | ||
1283 | cifsInode = CIFS_I(newinode); | ||
1284 | dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; | ||
1285 | info.Attributes = cpu_to_le32(dosattrs); | ||
1286 | tmprc = CIFSSMBSetPathInfo(xid, tcon, full_path, &info, | ||
1287 | cifs_sb->local_nls, | ||
1288 | cifs_sb->mnt_cifs_flags & | ||
1289 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
1290 | if (tmprc == 0) | ||
1291 | cifsInode->cifsAttrs = dosattrs; | ||
1292 | } | ||
1293 | if (dentry->d_inode) { | 1280 | if (dentry->d_inode) { |
1294 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) | 1281 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) |
1295 | dentry->d_inode->i_mode = (mode | S_IFDIR); | 1282 | dentry->d_inode->i_mode = (mode | S_IFDIR); |
@@ -1377,6 +1364,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1377 | struct cifs_sb_info *cifs_sb; | 1364 | struct cifs_sb_info *cifs_sb; |
1378 | struct tcon_link *tlink; | 1365 | struct tcon_link *tlink; |
1379 | struct cifs_tcon *tcon; | 1366 | struct cifs_tcon *tcon; |
1367 | struct TCP_Server_Info *server; | ||
1380 | char *full_path; | 1368 | char *full_path; |
1381 | 1369 | ||
1382 | cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode); | 1370 | cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode); |
@@ -1403,9 +1391,15 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) | |||
1403 | goto mkdir_out; | 1391 | goto mkdir_out; |
1404 | } | 1392 | } |
1405 | 1393 | ||
1394 | server = tcon->ses->server; | ||
1395 | |||
1396 | if (!server->ops->mkdir) { | ||
1397 | rc = -ENOSYS; | ||
1398 | goto mkdir_out; | ||
1399 | } | ||
1400 | |||
1406 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ | 1401 | /* BB add setting the equivalent of mode via CreateX w/ACLs */ |
1407 | rc = CIFSSMBMkDir(xid, tcon, full_path, cifs_sb->local_nls, | 1402 | rc = server->ops->mkdir(xid, tcon, full_path, cifs_sb); |
1408 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
1409 | if (rc) { | 1403 | if (rc) { |
1410 | cFYI(1, "cifs_mkdir returned 0x%x", rc); | 1404 | cFYI(1, "cifs_mkdir returned 0x%x", rc); |
1411 | d_drop(direntry); | 1405 | d_drop(direntry); |