diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/mqueue.c | 17 | ||||
-rw-r--r-- | ipc/msgutil.c | 5 |
2 files changed, 7 insertions, 15 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 2e0ecfcc881d..9a142a290749 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -108,7 +108,7 @@ static struct ipc_namespace *get_ns_from_inode(struct inode *inode) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static struct inode *mqueue_get_inode(struct super_block *sb, | 110 | static struct inode *mqueue_get_inode(struct super_block *sb, |
111 | struct ipc_namespace *ipc_ns, int mode, | 111 | struct ipc_namespace *ipc_ns, umode_t mode, |
112 | struct mq_attr *attr) | 112 | struct mq_attr *attr) |
113 | { | 113 | { |
114 | struct user_struct *u = current_user(); | 114 | struct user_struct *u = current_user(); |
@@ -243,7 +243,6 @@ static struct inode *mqueue_alloc_inode(struct super_block *sb) | |||
243 | static void mqueue_i_callback(struct rcu_head *head) | 243 | static void mqueue_i_callback(struct rcu_head *head) |
244 | { | 244 | { |
245 | struct inode *inode = container_of(head, struct inode, i_rcu); | 245 | struct inode *inode = container_of(head, struct inode, i_rcu); |
246 | INIT_LIST_HEAD(&inode->i_dentry); | ||
247 | kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); | 246 | kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); |
248 | } | 247 | } |
249 | 248 | ||
@@ -296,7 +295,7 @@ static void mqueue_evict_inode(struct inode *inode) | |||
296 | } | 295 | } |
297 | 296 | ||
298 | static int mqueue_create(struct inode *dir, struct dentry *dentry, | 297 | static int mqueue_create(struct inode *dir, struct dentry *dentry, |
299 | int mode, struct nameidata *nd) | 298 | umode_t mode, struct nameidata *nd) |
300 | { | 299 | { |
301 | struct inode *inode; | 300 | struct inode *inode; |
302 | struct mq_attr *attr = dentry->d_fsdata; | 301 | struct mq_attr *attr = dentry->d_fsdata; |
@@ -611,7 +610,7 @@ static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr) | |||
611 | * Invoked when creating a new queue via sys_mq_open | 610 | * Invoked when creating a new queue via sys_mq_open |
612 | */ | 611 | */ |
613 | static struct file *do_create(struct ipc_namespace *ipc_ns, struct dentry *dir, | 612 | static struct file *do_create(struct ipc_namespace *ipc_ns, struct dentry *dir, |
614 | struct dentry *dentry, int oflag, mode_t mode, | 613 | struct dentry *dentry, int oflag, umode_t mode, |
615 | struct mq_attr *attr) | 614 | struct mq_attr *attr) |
616 | { | 615 | { |
617 | const struct cred *cred = current_cred(); | 616 | const struct cred *cred = current_cred(); |
@@ -680,7 +679,7 @@ err: | |||
680 | return ERR_PTR(ret); | 679 | return ERR_PTR(ret); |
681 | } | 680 | } |
682 | 681 | ||
683 | SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, | 682 | SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode, |
684 | struct mq_attr __user *, u_attr) | 683 | struct mq_attr __user *, u_attr) |
685 | { | 684 | { |
686 | struct dentry *dentry; | 685 | struct dentry *dentry; |
@@ -1269,7 +1268,7 @@ void mq_clear_sbinfo(struct ipc_namespace *ns) | |||
1269 | 1268 | ||
1270 | void mq_put_mnt(struct ipc_namespace *ns) | 1269 | void mq_put_mnt(struct ipc_namespace *ns) |
1271 | { | 1270 | { |
1272 | mntput(ns->mq_mnt); | 1271 | kern_unmount(ns->mq_mnt); |
1273 | } | 1272 | } |
1274 | 1273 | ||
1275 | static int __init init_mqueue_fs(void) | 1274 | static int __init init_mqueue_fs(void) |
@@ -1291,11 +1290,9 @@ static int __init init_mqueue_fs(void) | |||
1291 | 1290 | ||
1292 | spin_lock_init(&mq_lock); | 1291 | spin_lock_init(&mq_lock); |
1293 | 1292 | ||
1294 | init_ipc_ns.mq_mnt = kern_mount_data(&mqueue_fs_type, &init_ipc_ns); | 1293 | error = mq_init_ns(&init_ipc_ns); |
1295 | if (IS_ERR(init_ipc_ns.mq_mnt)) { | 1294 | if (error) |
1296 | error = PTR_ERR(init_ipc_ns.mq_mnt); | ||
1297 | goto out_filesystem; | 1295 | goto out_filesystem; |
1298 | } | ||
1299 | 1296 | ||
1300 | return 0; | 1297 | return 0; |
1301 | 1298 | ||
diff --git a/ipc/msgutil.c b/ipc/msgutil.c index 8b5ce5d3f3ef..5652101cdac0 100644 --- a/ipc/msgutil.c +++ b/ipc/msgutil.c | |||
@@ -27,11 +27,6 @@ DEFINE_SPINLOCK(mq_lock); | |||
27 | */ | 27 | */ |
28 | struct ipc_namespace init_ipc_ns = { | 28 | struct ipc_namespace init_ipc_ns = { |
29 | .count = ATOMIC_INIT(1), | 29 | .count = ATOMIC_INIT(1), |
30 | #ifdef CONFIG_POSIX_MQUEUE | ||
31 | .mq_queues_max = DFLT_QUEUESMAX, | ||
32 | .mq_msg_max = DFLT_MSGMAX, | ||
33 | .mq_msgsize_max = DFLT_MSGSIZEMAX, | ||
34 | #endif | ||
35 | .user_ns = &init_user_ns, | 30 | .user_ns = &init_user_ns, |
36 | }; | 31 | }; |
37 | 32 | ||