Showing the changes to ipc/mqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -416,11 +416,11 @@ static void mqueue_evict_inode(struct inode *inode) · 415 unmodified lines | ||
| 416 | 416 | put_ipc_ns(ipc_ns); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | −static int mqueue_create(struct inode *dir, struct dentry *dentry, | |
| 420 | − umode_t mode, bool excl) | |
| 419 | +static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg) | |
| 421 | 420 | { |
| 421 | + struct inode *dir = dentry->d_parent->d_inode; | |
| 422 | 422 | struct inode *inode; |
| 423 | − struct mq_attr *attr = dentry->d_fsdata; | |
| 423 | + struct mq_attr *attr = arg; | |
| 424 | 424 | int error; |
| 425 | 425 | struct ipc_namespace *ipc_ns; |
| 426 | 426 | |
| @@ -461,6 +461,12 @@ out_unlock: · 34 unmodified lines | ||
| 461 | 461 | return error; |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | +static int mqueue_create(struct inode *dir, struct dentry *dentry, | |
| 465 | + umode_t mode, bool excl) | |
| 466 | +{ | |
| 467 | + return mqueue_create_attr(dentry, mode, NULL); | |
| 468 | +} | |
| 469 | + | |
| 464 | 470 | static int mqueue_unlink(struct inode *dir, struct dentry *dentry) |
| 465 | 471 | { |
| 466 | 472 | struct inode *inode = d_inode(dentry); |
| @@ -732,8 +738,6 @@ static struct file *do_create(struct ipc_namespace *ipc_ns, struct inode *dir, · 265 unmodified lines | ||
| 732 | 738 | ret = mq_attr_ok(ipc_ns, attr); |
| 733 | 739 | if (ret) |
| 734 | 740 | return ERR_PTR(ret); |
| 735 | − /* store for use during create */ | |
| 736 | − path->dentry->d_fsdata = attr; | |
| 737 | 741 | } else { |
| 738 | 742 | struct mq_attr def_attr; |
| 739 | 743 | |
| @@ -746,9 +750,8 @@ static struct file *do_create(struct ipc_namespace *ipc_ns, struct inode *dir, · 6 unmodified lines | ||
| 746 | 750 | return ERR_PTR(ret); |
| 747 | 751 | } |
| 748 | 752 | |
| 749 | − mode &= ~current_umask(); | |
| 750 | − ret = vfs_create(dir, path->dentry, mode, true); | |
| 751 | − path->dentry->d_fsdata = NULL; | |
| 753 | + ret = vfs_mkobj(path->dentry, mode & ~current_umask(), | |
| 754 | + mqueue_create_attr, attr); | |
| 752 | 755 | if (ret) |
| 753 | 756 | return ERR_PTR(ret); |
| 754 | 757 | return dentry_open(path, oflag, cred); |