Lines Matching refs:ipc_ns
111 struct ipc_namespace *ipc_ns, int mode,
142 info->attr.mq_maxmsg = ipc_ns->mq_msg_max;
143 info->attr.mq_msgsize = ipc_ns->mq_msgsize_max;
218 data = current->nsproxy->ipc_ns;
250 struct ipc_namespace *ipc_ns;
257 ipc_ns = get_ns_from_inode(inode);
274 * (ipc_ns = sb->s_fs_info) is either a valid ipc_ns
278 if (ipc_ns)
279 ipc_ns->mq_queues_count--;
283 if (ipc_ns)
284 put_ipc_ns(ipc_ns);
293 struct ipc_namespace *ipc_ns;
296 ipc_ns = __get_ns_from_inode(dir);
297 if (!ipc_ns) {
301 if (ipc_ns->mq_queues_count >= ipc_ns->mq_queues_max &&
306 ipc_ns->mq_queues_count++;
309 inode = mqueue_get_inode(dir->i_sb, ipc_ns, mode, attr);
313 ipc_ns->mq_queues_count--;
317 put_ipc_ns(ipc_ns);
326 if (ipc_ns)
327 put_ipc_ns(ipc_ns);
577 static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr)
585 if (attr->mq_maxmsg > ipc_ns->mq_msg_max ||
586 attr->mq_msgsize > ipc_ns->mq_msgsize_max)
602 static struct file *do_create(struct ipc_namespace *ipc_ns, struct dentry *dir,
611 if (!mq_attr_ok(ipc_ns, attr)) {
620 ret = mnt_want_write(ipc_ns->mq_mnt);
628 result = dentry_open(dentry, ipc_ns->mq_mnt, oflag, cred);
633 mnt_drop_write(ipc_ns->mq_mnt);
637 mnt_drop_write(ipc_ns->mq_mnt);
640 mntput(ipc_ns->mq_mnt);
645 static struct file *do_open(struct ipc_namespace *ipc_ns,
664 return dentry_open(dentry, ipc_ns->mq_mnt, oflag, cred);
668 mntput(ipc_ns->mq_mnt);
680 struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns;
694 mutex_lock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex);
695 dentry = lookup_one_len(name, ipc_ns->mq_mnt->mnt_root, strlen(name));
700 mntget(ipc_ns->mq_mnt);
709 filp = do_open(ipc_ns, dentry, oflag);
711 filp = do_create(ipc_ns, ipc_ns->mq_mnt->mnt_root,
721 filp = do_open(ipc_ns, dentry, oflag);
734 mntput(ipc_ns->mq_mnt);
739 mutex_unlock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex);
751 struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns;
757 mutex_lock_nested(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex,
759 dentry = lookup_one_len(name, ipc_ns->mq_mnt->mnt_root, strlen(name));
773 err = mnt_want_write(ipc_ns->mq_mnt);
777 mnt_drop_write(ipc_ns->mq_mnt);
782 mutex_unlock(&ipc_ns->mq_mnt->mnt_root->d_inode->i_mutex);