/* * POSIX message queues filesystem for Linux. * * Copyright (C) 2003,2004 Krzysztof Benedyczak (golbi@mat.uni.torun.pl) * Michal Wronski (michal.wronski@gmail.com) * * Spinlocks: Mohamed Abbas (abbas.mohamed@intel.com) * Lockless receive & send, fd based notify: * Manfred Spraul (manfred@colorfullife.com) * * Audit: George Wilson (ltcgcw@us.ibm.com) * * This file is released under the GPL. */#include<linux/capability.h>#include<linux/init.h>#include<linux/pagemap.h>#include<linux/file.h>#include<linux/mount.h>#include<linux/namei.h>#include<linux/sysctl.h>#include<linux/poll.h>#include<linux/mqueue.h>#include<linux/msg.h>#include<linux/skbuff.h>#include<linux/vmalloc.h>#include<linux/netlink.h>#include<linux/syscalls.h>#include<linux/audit.h>#include<linux/signal.h>#include<linux/mutex.h>#include<linux/nsproxy.h>#include<linux/pid.h>#include<linux/ipc_namespace.h>#include<linux/user_namespace.h>#include<linux/slab.h>#include<net/sock.h>#include"util.h"#define MQUEUE_MAGIC 0x19800202#define DIRENT_SIZE 20#define FILENT_SIZE 80#define SEND 0#define RECV 1#define STATE_NONE 0#define STATE_PENDING 1#define STATE_READY 2structposix_msg_tree_node{structrb_noderb_node;structlist_headmsg_list;intpriority;};structext_wait_queue{/* queue of sleeping tasks */structtask_struct*task;structlist_headlist;structmsg_msg*msg;/* ptr of loaded message */intstate;/* one of STATE_* values */};structmqueue_inode_info{spinlock_tlock;structinodevfs_inode;wait_queue_head_twait_q;structrb_rootmsg_tree;structmq_attrattr;structsigeventnotify;structpid*notify_owner;structuser_namespace*notify_user_ns;structuser_struct*user;/* user who created, for accounting */structsock*notify_sock;structsk_buff*not