Lines Matching refs:attr
81 struct mq_attr attr; member
167 info->attr.mq_curmsgs++; in msg_insert()
203 if (info->attr.mq_curmsgs) { in msg_get()
207 info->attr.mq_curmsgs = 0; in msg_get()
226 info->attr.mq_curmsgs--; in msg_get()
233 struct mq_attr *attr) in mqueue_get_inode() argument
268 memset(&info->attr, 0, sizeof(info->attr)); in mqueue_get_inode()
269 info->attr.mq_maxmsg = min(ipc_ns->mq_msg_max, in mqueue_get_inode()
271 info->attr.mq_msgsize = min(ipc_ns->mq_msgsize_max, in mqueue_get_inode()
273 if (attr) { in mqueue_get_inode()
274 info->attr.mq_maxmsg = attr->mq_maxmsg; in mqueue_get_inode()
275 info->attr.mq_msgsize = attr->mq_msgsize; in mqueue_get_inode()
292 if (info->attr.mq_maxmsg <= 0 || info->attr.mq_msgsize <= 0) in mqueue_get_inode()
295 if (info->attr.mq_maxmsg > HARD_MSGMAX || in mqueue_get_inode()
296 info->attr.mq_msgsize > HARD_MSGSIZEMAX) in mqueue_get_inode()
299 if (info->attr.mq_maxmsg > ipc_ns->mq_msg_max || in mqueue_get_inode()
300 info->attr.mq_msgsize > ipc_ns->mq_msgsize_max) in mqueue_get_inode()
305 if (info->attr.mq_msgsize > ULONG_MAX/info->attr.mq_maxmsg) in mqueue_get_inode()
307 mq_treesize = info->attr.mq_maxmsg * sizeof(struct msg_msg) + in mqueue_get_inode()
308 min_t(unsigned int, info->attr.mq_maxmsg, MQ_PRIO_MAX) * in mqueue_get_inode()
310 mq_bytes = info->attr.mq_maxmsg * info->attr.mq_msgsize; in mqueue_get_inode()
468 mq_treesize = info->attr.mq_maxmsg * sizeof(struct msg_msg) + in mqueue_evict_inode()
469 min_t(unsigned int, info->attr.mq_maxmsg, MQ_PRIO_MAX) * in mqueue_evict_inode()
472 mq_bytes = mq_treesize + (info->attr.mq_maxmsg * in mqueue_evict_inode()
473 info->attr.mq_msgsize); in mqueue_evict_inode()
496 struct mq_attr *attr = arg; in mqueue_create_attr() local
515 inode = mqueue_get_inode(dir->i_sb, ipc_ns, mode, attr); in mqueue_create_attr()
609 if (info->attr.mq_curmsgs) in mqueue_poll_file()
612 if (info->attr.mq_curmsgs < info->attr.mq_maxmsg) in mqueue_poll_file()
711 info->attr.mq_curmsgs == 1) { in __do_notify()
773 struct mq_attr *attr) in prepare_open() argument
786 mqueue_create_attr, attr); in prepare_open()
799 struct mq_attr *attr) in do_mq_open() argument
808 audit_mq_open(oflag, mode, attr); in do_mq_open()
825 error = prepare_open(path.mnt, path.dentry, oflag, ro, mode, name, attr); in do_mq_open()
850 struct mq_attr attr; in SYSCALL_DEFINE4() local
851 if (u_attr && copy_from_user(&attr, u_attr, sizeof(struct mq_attr))) in SYSCALL_DEFINE4()
854 return do_mq_open(u_name, oflag, mode, u_attr ? &attr : NULL); in SYSCALL_DEFINE4()
1007 if (unlikely(msg_len > info->attr.mq_msgsize)) { in do_mq_timedsend()
1041 if (info->attr.mq_curmsgs == info->attr.mq_maxmsg) { in do_mq_timedsend()
1121 if (unlikely(msg_len < info->attr.mq_msgsize)) { in do_mq_timedreceive()
1144 if (info->attr.mq_curmsgs == 0) { in do_mq_timedreceive()
1374 *old = info->attr; in do_mq_getsetattr()
1429 static inline int get_compat_mq_attr(struct mq_attr *attr, in get_compat_mq_attr() argument
1437 memset(attr, 0, sizeof(*attr)); in get_compat_mq_attr()
1438 attr->mq_flags = v.mq_flags; in get_compat_mq_attr()
1439 attr->mq_maxmsg = v.mq_maxmsg; in get_compat_mq_attr()
1440 attr->mq_msgsize = v.mq_msgsize; in get_compat_mq_attr()
1441 attr->mq_curmsgs = v.mq_curmsgs; in get_compat_mq_attr()
1445 static inline int put_compat_mq_attr(const struct mq_attr *attr, in put_compat_mq_attr() argument
1451 v.mq_flags = attr->mq_flags; in put_compat_mq_attr()
1452 v.mq_maxmsg = attr->mq_maxmsg; in put_compat_mq_attr()
1453 v.mq_msgsize = attr->mq_msgsize; in put_compat_mq_attr()
1454 v.mq_curmsgs = attr->mq_curmsgs; in put_compat_mq_attr()
1464 struct mq_attr attr, *p = NULL; in COMPAT_SYSCALL_DEFINE4() local
1466 p = &attr; in COMPAT_SYSCALL_DEFINE4()
1467 if (get_compat_mq_attr(&attr, u_attr)) in COMPAT_SYSCALL_DEFINE4()