summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-12-01 23:26:05 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2018-01-05 17:54:33 +0100
commiteecec19d9e705cb670a387d18973feeffd412970 (patch)
tree6e8c97fde46449921c819c8c8ecd1588bbec4ae6 /ipc
parentbpf_obj_do_pin(): switch to vfs_mkobj(), quit abusing ->mknod() (diff)
downloadlinux-eecec19d9e705cb670a387d18973feeffd412970.tar.xz
linux-eecec19d9e705cb670a387d18973feeffd412970.zip
mqueue: switch to vfs_mkobj(), quit abusing ->d_fsdata
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 9649ecd8a73a..e011ccd4c798 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -416,11 +416,11 @@ static void mqueue_evict_inode(struct inode *inode)
put_ipc_ns(ipc_ns);
}
-static int mqueue_create(struct inode *dir, struct dentry *dentry,
- umode_t mode, bool excl)
+static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg)
{
+ struct inode *dir = dentry->d_parent->d_inode;
struct inode *inode;
- struct mq_attr *attr = dentry->d_fsdata;
+ struct mq_attr *attr = arg;
int error;
struct ipc_namespace *ipc_ns;
@@ -461,6 +461,12 @@ out_unlock:
return error;
}
+static int mqueue_create(struct inode *dir, struct dentry *dentry,
+ umode_t mode, bool excl)
+{
+ return mqueue_create_attr(dentry, mode, NULL);
+}
+
static int mqueue_unlink(struct inode *dir, struct dentry *dentry)
{
struct inode *inode = d_inode(dentry);
@@ -732,8 +738,6 @@ static struct file *do_create(struct ipc_namespace *ipc_ns, struct inode *dir,
ret = mq_attr_ok(ipc_ns, attr);
if (ret)
return ERR_PTR(ret);
- /* store for use during create */
- path->dentry->d_fsdata = attr;
} else {
struct mq_attr def_attr;
@@ -746,9 +750,8 @@ static struct file *do_create(struct ipc_namespace *ipc_ns, struct inode *dir,
return ERR_PTR(ret);
}
- mode &= ~current_umask();
- ret = vfs_create(dir, path->dentry, mode, true);
- path->dentry->d_fsdata = NULL;
+ ret = vfs_mkobj(path->dentry, mode & ~current_umask(),
+ mqueue_create_attr, attr);
if (ret)
return ERR_PTR(ret);
return dentry_open(path, oflag, cred);