aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_iops.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 59ba1dc65fa6..9c4d99709705 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -271,7 +271,6 @@ xfs_vn_mknod(
271 dev_t rdev) 271 dev_t rdev)
272{ 272{
273 struct inode *ip; 273 struct inode *ip;
274 bhv_vattr_t vattr = { 0 };
275 bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir); 274 bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
276 xfs_acl_t *default_acl = NULL; 275 xfs_acl_t *default_acl = NULL;
277 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; 276 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
@@ -297,19 +296,14 @@ xfs_vn_mknod(
297 if (IS_POSIXACL(dir) && !default_acl && xfs_has_fs_struct(current)) 296 if (IS_POSIXACL(dir) && !default_acl && xfs_has_fs_struct(current))
298 mode &= ~current->fs->umask; 297 mode &= ~current->fs->umask;
299 298
300 vattr.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
301 vattr.va_mode = mode;
302
303 switch (mode & S_IFMT) { 299 switch (mode & S_IFMT) {
304 case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK: 300 case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK:
305 vattr.va_rdev = sysv_encode_dev(rdev); 301 rdev = sysv_encode_dev(rdev);
306 vattr.va_mask |= XFS_AT_RDEV;
307 /*FALLTHROUGH*/
308 case S_IFREG: 302 case S_IFREG:
309 error = xfs_create(XFS_I(dir), dentry, &vattr, &vp, NULL); 303 error = xfs_create(XFS_I(dir), dentry, mode, rdev, &vp, NULL);
310 break; 304 break;
311 case S_IFDIR: 305 case S_IFDIR:
312 error = xfs_mkdir(XFS_I(dir), dentry, &vattr, &vp, NULL); 306 error = xfs_mkdir(XFS_I(dir), dentry, mode, &vp, NULL);
313 break; 307 break;
314 default: 308 default:
315 error = EINVAL; 309 error = EINVAL;
@@ -324,7 +318,7 @@ xfs_vn_mknod(
324 318
325 if (unlikely(default_acl)) { 319 if (unlikely(default_acl)) {
326 if (!error) { 320 if (!error) {
327 error = _ACL_INHERIT(vp, &vattr, default_acl); 321 error = _ACL_INHERIT(vp, mode, default_acl);
328 if (!error) 322 if (!error)
329 xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED); 323 xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED);
330 else 324 else
@@ -441,18 +435,17 @@ xfs_vn_symlink(
441 const char *symname) 435 const char *symname)
442{ 436{
443 struct inode *ip; 437 struct inode *ip;
444 bhv_vattr_t va = { 0 };
445 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */ 438 bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */
446 int error; 439 int error;
440 mode_t mode;
447 441
448 cvp = NULL; 442 cvp = NULL;
449 443
450 va.va_mode = S_IFLNK | 444 mode = S_IFLNK |
451 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); 445 (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
452 va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
453 446
454 error = xfs_symlink(XFS_I(dir), dentry, &va, 447 error = xfs_symlink(XFS_I(dir), dentry, (char *)symname, mode,
455 (char *)symname, &cvp, NULL); 448 &cvp, NULL);
456 if (likely(!error && cvp)) { 449 if (likely(!error && cvp)) {
457 error = xfs_init_security(cvp, dir); 450 error = xfs_init_security(cvp, dir);
458 if (likely(!error)) { 451 if (likely(!error)) {