FreeBSD kernel kern code
uipc_mqueue.c File Reference
#include <sys/cdefs.h>
#include "opt_capsicum.h"
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
#include <sys/limits.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/capsicum.h>
#include <sys/dirent.h>
#include <sys/event.h>
#include <sys/eventhandler.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/jail.h>
#include <sys/lock.h>
#include <sys/module.h>
#include <sys/mount.h>
#include <sys/mqueue.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/posix4.h>
#include <sys/poll.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/sysproto.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/unistd.h>
#include <sys/user.h>
#include <sys/vnode.h>
#include <machine/atomic.h>
#include <security/audit/audit.h>
Include dependency graph for uipc_mqueue.c:

Go to the source code of this file.

Data Structures

struct  mqfs_info
 
struct  mqfs_vdata
 
struct  mqfs_node
 
struct  mqueue_notifier
 
struct  mqueue
 
struct  mqueue_msg
 

Macros

#define MQFS_NAMELEN   NAME_MAX
 
#define MQFS_DELEN   (8 + MQFS_NAMELEN)
 
#define VTON(vp)   (((struct mqfs_vdata *)((vp)->v_data))->mv_node)
 
#define VTOMQ(vp)   ((struct mqueue *)(VTON(vp)->mn_data))
 
#define VFSTOMQFS(m)   ((struct mqfs_info *)((m)->mnt_data))
 
#define FPTOMQ(fp)
 
#define MQ_RSEL   0x01
 
#define MQ_WSEL   0x02
 

Typedefs

typedef int(* _fgetf) (struct thread *, int, cap_rights_t *, struct file **)
 

Enumerations

enum  mqfs_type_t {
  mqfstype_none = 0 , mqfstype_root , mqfstype_dir , mqfstype_this ,
  mqfstype_parent , mqfstype_file , mqfstype_symlink
}
 

Functions

 __FBSDID ("$FreeBSD$")
 
 FEATURE (p1003_1b_mqueue, "POSIX P1003.1B message queues support")
 
 TAILQ_HEAD (msgq, mqueue_msg)
 
static SYSCTL_NODE (_kern, OID_AUTO, mqueue, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "POSIX real time message queue")
 
 SYSCTL_INT (_kern_mqueue, OID_AUTO, maxmsg, CTLFLAG_RW, &maxmsg, 0, "Default maximum messages in queue")
 
 SYSCTL_INT (_kern_mqueue, OID_AUTO, maxmsgsize, CTLFLAG_RW, &maxmsgsize, 0, "Default maximum message size")
 
 SYSCTL_INT (_kern_mqueue, OID_AUTO, maxmq, CTLFLAG_RW, &maxmq, 0, "maximum message queues")
 
 SYSCTL_INT (_kern_mqueue, OID_AUTO, curmq, CTLFLAG_RW, &curmq, 0, "current message queue number")
 
static MALLOC_DEFINE (M_MQUEUEDATA, "mqdata", "mqueue data")
 
static struct mqfs_nodemqfs_create_file (struct mqfs_node *parent, const char *name, int namelen, struct ucred *cred, int mode)
 
static int mqfs_destroy (struct mqfs_node *mn)
 
static void mqfs_fileno_alloc (struct mqfs_info *mi, struct mqfs_node *mn)
 
static void mqfs_fileno_free (struct mqfs_info *mi, struct mqfs_node *mn)
 
static int mqfs_allocv (struct mount *mp, struct vnode **vpp, struct mqfs_node *pn)
 
static int mqfs_prison_remove (void *obj, void *data)
 
static struct mqueuemqueue_alloc (const struct mq_attr *attr)
 
static void mqueue_free (struct mqueue *mq)
 
static int mqueue_send (struct mqueue *mq, const char *msg_ptr, size_t msg_len, unsigned msg_prio, int waitok, const struct timespec *abs_timeout)
 
static int mqueue_receive (struct mqueue *mq, char *msg_ptr, size_t msg_len, unsigned *msg_prio, int waitok, const struct timespec *abs_timeout)
 
static int _mqueue_send (struct mqueue *mq, struct mqueue_msg *msg, int timo)
 
static int _mqueue_recv (struct mqueue *mq, struct mqueue_msg **msg, int timo)
 
static void mqueue_send_notification (struct mqueue *mq)
 
static void mqueue_fdclose (struct thread *td, int fd, struct file *fp)
 
static void mq_proc_exit (void *arg, struct proc *p)
 
static void filt_mqdetach (struct knote *kn)
 
static int filt_mqread (struct knote *kn, long hint)
 
static int filt_mqwrite (struct knote *kn, long hint)
 
static void mqfs_fileno_init (struct mqfs_info *mi)
 
static void mqfs_fileno_uninit (struct mqfs_info *mi)
 
static __inline struct mqfs_nodemqnode_alloc (void)
 
static __inline void mqnode_free (struct mqfs_node *node)
 
static __inline void mqnode_addref (struct mqfs_node *node)
 
static __inline void mqnode_release (struct mqfs_node *node)
 
static int mqfs_add_node (struct mqfs_node *parent, struct mqfs_node *node)
 
static struct mqfs_nodemqfs_create_node (const char *name, int namelen, struct ucred *cred, int mode, int nodetype)
 
static int mqfs_fixup_dir (struct mqfs_node *parent)
 
static int mqfs_mount (struct mount *mp)
 
static int mqfs_unmount (struct mount *mp, int mntflags)
 
static int mqfs_root (struct mount *mp, int flags, struct vnode **vpp)
 
static int mqfs_statfs (struct mount *mp, struct statfs *sbp)
 
static int mqfs_init (struct vfsconf *vfc)
 
static int mqfs_uninit (struct vfsconf *vfc)
 
static void do_recycle (void *context, int pending __unused)
 
static struct mqfs_nodemqfs_search (struct mqfs_node *pd, const char *name, int len, struct ucred *cred)
 
static int mqfs_lookupx (struct vop_cachedlookup_args *ap)
 
static int mqfs_lookup (struct vop_cachedlookup_args *ap)
 
static int mqfs_create (struct vop_create_args *ap)
 
static int do_unlink (struct mqfs_node *pn, struct ucred *ucred)
 
static int mqfs_remove (struct vop_remove_args *ap)
 
static int mqfs_inactive (struct vop_inactive_args *ap)
 
static int mqfs_reclaim (struct vop_reclaim_args *ap)
 
static int mqfs_open (struct vop_open_args *ap)
 
static int mqfs_close (struct vop_close_args *ap)
 
static int mqfs_access (struct vop_access_args *ap)
 
static int mqfs_getattr (struct vop_getattr_args *ap)
 
static int mqfs_setattr (struct vop_setattr_args *ap)
 
static int mqfs_read (struct vop_read_args *ap)
 
static int mqfs_readdir (struct vop_readdir_args *ap)
 
static int mqfs_prison_remove (void *obj, void *data __unused)
 
static struct mqueue_msgmqueue_loadmsg (const char *msg_ptr, size_t msg_size, int msg_prio)
 
static int mqueue_savemsg (struct mqueue_msg *msg, char *msg_ptr, int *msg_prio)
 
static __inline void mqueue_freemsg (struct mqueue_msg *msg)
 
static __inline struct mqueue_notifiernotifier_alloc (void)
 
static __inline void notifier_free (struct mqueue_notifier *p)
 
static struct mqueue_notifiernotifier_search (struct proc *p, int fd)
 
static __inline void notifier_insert (struct proc *p, struct mqueue_notifier *nt)
 
static __inline void notifier_delete (struct proc *p, struct mqueue_notifier *nt)
 
static void notifier_remove (struct proc *p, struct mqueue *mq, int fd)
 
static int kern_kmq_open (struct thread *td, const char *upath, int flags, mode_t mode, const struct mq_attr *attr)
 
int sys_kmq_open (struct thread *td, struct kmq_open_args *uap)
 
int sys_kmq_unlink (struct thread *td, struct kmq_unlink_args *uap)
 
static int _getmq (struct thread *td, int fd, cap_rights_t *rightsp, _fgetf func, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq)
 
static __inline int getmq (struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq)
 
static __inline int getmq_read (struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq)
 
static __inline int getmq_write (struct thread *td, int fd, struct file **fpp, struct mqfs_node **ppn, struct mqueue **pmq)
 
static int kern_kmq_setattr (struct thread *td, int mqd, const struct mq_attr *attr, struct mq_attr *oattr)
 
int sys_kmq_setattr (struct thread *td, struct kmq_setattr_args *uap)
 
int sys_kmq_timedreceive (struct thread *td, struct kmq_timedreceive_args *uap)
 
int sys_kmq_timedsend (struct thread *td, struct kmq_timedsend_args *uap)
 
static int kern_kmq_notify (struct thread *td, int mqd, struct sigevent *sigev)
 
int sys_kmq_notify (struct thread *td, struct kmq_notify_args *uap)
 
static void mq_proc_exit (void *arg __unused, struct proc *p)
 
static int mqf_poll (struct file *fp, int events, struct ucred *active_cred, struct thread *td)
 
static int mqf_close (struct file *fp, struct thread *td)
 
static int mqf_stat (struct file *fp, struct stat *st, struct ucred *active_cred)
 
static int mqf_chmod (struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td)
 
static int mqf_chown (struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, struct thread *td)
 
static int mqf_kqfilter (struct file *fp, struct knote *kn)
 
static int mqf_fill_kinfo (struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
 
 VFS_VOP_VECTOR_REGISTER (mqfs_vnodeops)
 
static int mqinit (void)
 
static int mqunload (void)
 
static int mq_modload (struct module *module, int cmd, void *arg)
 
 DECLARE_MODULE (mqueuefs, mqueuefs_mod, SI_SUB_VFS, SI_ORDER_MIDDLE)
 
 MODULE_VERSION (mqueuefs, 1)
 

Variables

static int default_maxmsg = 10
 
static int default_msgsize = 1024
 
static int maxmsg = 100
 
static int maxmsgsize = 16384
 
static int maxmq = 100
 
static int curmq = 0
 
static int unloadable = 0
 
static eventhandler_tag exit_tag
 
static struct mqfs_info mqfs_data
 
static uma_zone_t mqnode_zone
 
static uma_zone_t mqueue_zone
 
static uma_zone_t mvdata_zone
 
static uma_zone_t mqnoti_zone
 
static struct vop_vector mqfs_vnodeops
 
static struct fileops mqueueops
 
static unsigned mqfs_osd_jail_slot
 
struct filterops mq_rfiltops
 
struct filterops mq_wfiltops
 
static struct vfsops mqfs_vfsops
 
static struct vfsconf mqueuefs_vfsconf
 
static struct syscall_helper_data mq_syscalls []
 
static moduledata_t mqueuefs_mod
 

Macro Definition Documentation

◆ FPTOMQ

#define FPTOMQ (   fp)
Value:
((struct mqueue *)(((struct mqfs_node *) \
(fp)->f_data)->mn_data))

Definition at line 163 of file uipc_mqueue.c.

◆ MQ_RSEL

#define MQ_RSEL   0x01

Definition at line 192 of file uipc_mqueue.c.

◆ MQ_WSEL

#define MQ_WSEL   0x02

Definition at line 193 of file uipc_mqueue.c.

◆ MQFS_DELEN

#define MQFS_DELEN   (8 + MQFS_NAMELEN)

Definition at line 104 of file uipc_mqueue.c.

◆ MQFS_NAMELEN

#define MQFS_NAMELEN   NAME_MAX

Definition at line 103 of file uipc_mqueue.c.

◆ VFSTOMQFS

#define VFSTOMQFS (   m)    ((struct mqfs_info *)((m)->mnt_data))

Definition at line 162 of file uipc_mqueue.c.

◆ VTOMQ

#define VTOMQ (   vp)    ((struct mqueue *)(VTON(vp)->mn_data))

Definition at line 161 of file uipc_mqueue.c.

◆ VTON

#define VTON (   vp)    (((struct mqfs_vdata *)((vp)->v_data))->mv_node)

Definition at line 160 of file uipc_mqueue.c.

Typedef Documentation

◆ _fgetf

typedef int(* _fgetf) (struct thread *, int, cap_rights_t *, struct file **)

Definition at line 2165 of file uipc_mqueue.c.

Enumeration Type Documentation

◆ mqfs_type_t

Enumerator
mqfstype_none 
mqfstype_root 
mqfstype_dir 
mqfstype_this 
mqfstype_parent 
mqfstype_file 
mqfstype_symlink 

Definition at line 107 of file uipc_mqueue.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ _getmq()

static int _getmq ( struct thread *  td,
int  fd,
cap_rights_t *  rightsp,
_fgetf  func,
struct file **  fpp,
struct mqfs_node **  ppn,
struct mqueue **  pmq 
)
static

Definition at line 2171 of file uipc_mqueue.c.

References fd, and mqueueops.

Referenced by getmq(), getmq_read(), and getmq_write().

Here is the caller graph for this function:

◆ _mqueue_recv()

static int _mqueue_recv ( struct mqueue mq,
struct mqueue_msg **  msg,
int  timo 
)
static

Definition at line 1917 of file uipc_mqueue.c.

References mqueue::mq_curmsgs, mqueue::mq_flags, mqueue::mq_msgq, mqueue::mq_mutex, mqueue::mq_notifier, mqueue::mq_receivers, mqueue::mq_senders, mqueue::mq_totalbytes, mqueue::mq_wsel, MQ_WSEL, mqueue_send_notification(), selwakeup(), and wakeup_one().

Referenced by mqueue_receive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _mqueue_send()

static int _mqueue_send ( struct mqueue mq,
struct mqueue_msg msg,
int  timo 
)
static

Definition at line 1760 of file uipc_mqueue.c.

References mqueue::mq_curmsgs, mqueue::mq_flags, mqueue::mq_maxmsg, mqueue::mq_msgq, mqueue::mq_mutex, mqueue::mq_notifier, mqueue::mq_receivers, mqueue::mq_rsel, MQ_RSEL, mqueue::mq_senders, mqueue::mq_totalbytes, mqueue_send_notification(), selwakeup(), and wakeup_one().

Referenced by mqueue_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DECLARE_MODULE()

DECLARE_MODULE ( mqueuefs  ,
mqueuefs_mod  ,
SI_SUB_VFS  ,
SI_ORDER_MIDDLE   
)

◆ do_recycle()

static void do_recycle ( void *  context,
int pending  __unused 
)
static

Definition at line 722 of file uipc_mqueue.c.

References vdrop(), and vrecycle().

Referenced by mqfs_allocv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ do_unlink()

static int do_unlink ( struct mqfs_node pn,
struct ucred *  ucred 
)
static

Definition at line 1026 of file uipc_mqueue.c.

References cache_purge(), mqfs_info::mi_lock, mqfs_node::mn_info, mqfs_node::mn_parent, mqnode_release(), parent, priv_check_cred(), taskqueue_enqueue(), and vhold().

Referenced by mqfs_prison_remove(), mqfs_remove(), and sys_kmq_unlink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FEATURE()

FEATURE ( p1003_1b_mqueue  ,
"POSIX P1003.1B message queues support"   
)

◆ filt_mqdetach()

static void filt_mqdetach ( struct knote kn)
static

Definition at line 2620 of file uipc_mqueue.c.

References FPTOMQ, knlist_remove(), mqueue::mq_rsel, mqueue::mq_wsel, and panic().

Here is the call graph for this function:

◆ filt_mqread()

static int filt_mqread ( struct knote kn,
long  hint 
)
static

Definition at line 2633 of file uipc_mqueue.c.

References FPTOMQ, mqueue::mq_curmsgs, and mqueue::mq_mutex.

◆ filt_mqwrite()

static int filt_mqwrite ( struct knote kn,
long  hint 
)
static

Definition at line 2642 of file uipc_mqueue.c.

References FPTOMQ, mqueue::mq_curmsgs, mqueue::mq_maxmsg, and mqueue::mq_mutex.

◆ getmq()

static __inline int getmq ( struct thread *  td,
int  fd,
struct file **  fpp,
struct mqfs_node **  ppn,
struct mqueue **  pmq 
)
static

Definition at line 2193 of file uipc_mqueue.c.

References _getmq(), cap_event_rights, fd, and fget().

Referenced by kern_kmq_notify(), and kern_kmq_setattr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getmq_read()

static __inline int getmq_read ( struct thread *  td,
int  fd,
struct file **  fpp,
struct mqfs_node **  ppn,
struct mqueue **  pmq 
)
static

Definition at line 2202 of file uipc_mqueue.c.

References _getmq(), cap_read_rights, fd, and fget_read().

Referenced by sys_kmq_timedreceive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getmq_write()

static __inline int getmq_write ( struct thread *  td,
int  fd,
struct file **  fpp,
struct mqfs_node **  ppn,
struct mqueue **  pmq 
)
static

Definition at line 2211 of file uipc_mqueue.c.

References _getmq(), cap_write_rights, fd, and fget_write().

Referenced by sys_kmq_timedsend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_kmq_notify()

static int kern_kmq_notify ( struct thread *  td,
int  mqd,
struct sigevent *  sigev 
)
static

Definition at line 2326 of file uipc_mqueue.c.

References cap_event_rights, getmq(), mqueue::mq_msgq, mqueue::mq_mutex, mqueue::mq_notifier, mqueue::mq_receivers, mqueue_send_notification(), notifier_alloc(), notifier_free(), notifier_insert(), notifier_remove(), notifier_search(), and sigqueue_take().

Referenced by sys_kmq_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_kmq_open()

static int kern_kmq_open ( struct thread *  td,
const char *  upath,
int  flags,
mode_t  mode,
const struct mq_attr *  attr 
)
static

Definition at line 2010 of file uipc_mqueue.c.

References accmode, fd, fdclose(), finit(), flags, maxmsg, maxmsgsize, mqfs_info::mi_lock, mqfs_info::mi_root, mode, mqfs_create_file(), mqfs_data, MQFS_NAMELEN, mqfs_search(), mqnode_addref(), mqueue_alloc(), mqueue_free(), mqueueops, path, and vaccess().

Referenced by sys_kmq_open().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kern_kmq_setattr()

static int kern_kmq_setattr ( struct thread *  td,
int  mqd,
const struct mq_attr *  attr,
struct mq_attr *  oattr 
)
static

Definition at line 2220 of file uipc_mqueue.c.

References flag, getmq(), mqueue::mq_curmsgs, mqueue::mq_maxmsg, and mqueue::mq_msgsize.

Referenced by sys_kmq_setattr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_MQUEUEDATA  ,
"mqdata"  ,
"mqueue data  
)
static

◆ MODULE_VERSION()

MODULE_VERSION ( mqueuefs  ,
 
)

◆ mq_modload()

static int mq_modload ( struct module module,
int  cmd,
void *  arg 
)
static

Definition at line 2915 of file uipc_mqueue.c.

References mqinit(), mqunload(), and vfs_modevent().

Here is the call graph for this function:

◆ mq_proc_exit() [1/2]

static void mq_proc_exit ( void *arg  __unused,
struct proc *  p 
)
static

Definition at line 2475 of file uipc_mqueue.c.

References FPTOMQ, mqueue::mq_mutex, mqueueops, and notifier_remove().

Here is the call graph for this function:

◆ mq_proc_exit() [2/2]

static void mq_proc_exit ( void *  arg,
struct proc *  p 
)
static

Referenced by mqfs_init().

Here is the caller graph for this function:

◆ mqf_chmod()

static int mqf_chmod ( struct file *  fp,
mode_t  mode,
struct ucred *  active_cred,
struct thread *  td 
)
static

Definition at line 2558 of file uipc_mqueue.c.

References mqfs_info::mi_lock, mode, mqfs_data, and vaccess().

Here is the call graph for this function:

◆ mqf_chown()

static int mqf_chown ( struct file *  fp,
uid_t  uid,
gid_t  gid,
struct ucred *  active_cred,
struct thread *  td 
)
static

Definition at line 2578 of file uipc_mqueue.c.

References groupmember(), mqfs_info::mi_lock, mqfs_data, and priv_check_cred().

Here is the call graph for this function:

◆ mqf_close()

static int mqf_close ( struct file *  fp,
struct thread *  td 
)
static

Definition at line 2526 of file uipc_mqueue.c.

References badfileops, mqfs_info::mi_lock, mqfs_data, and mqnode_release().

Here is the call graph for this function:

◆ mqf_fill_kinfo()

static int mqf_fill_kinfo ( struct file *  fp,
struct kinfo_file *  kif,
struct filedesc *  fdp 
)
static

Definition at line 2651 of file uipc_mqueue.c.

◆ mqf_kqfilter()

static int mqf_kqfilter ( struct file *  fp,
struct knote kn 
)
static

Definition at line 2603 of file uipc_mqueue.c.

References FPTOMQ, knlist_add(), mq_rfiltops, mqueue::mq_rsel, mq_wfiltops, and mqueue::mq_wsel.

Here is the call graph for this function:

◆ mqf_poll()

static int mqf_poll ( struct file *  fp,
int  events,
struct ucred *  active_cred,
struct thread *  td 
)
static

Definition at line 2498 of file uipc_mqueue.c.

References FPTOMQ, mqueue::mq_curmsgs, mqueue::mq_flags, mqueue::mq_maxmsg, mqueue::mq_mutex, mqueue::mq_rsel, MQ_RSEL, mqueue::mq_wsel, MQ_WSEL, and selrecord().

Here is the call graph for this function:

◆ mqf_stat()

static int mqf_stat ( struct file *  fp,
struct stat *  st,
struct ucred *  active_cred 
)
static

Definition at line 2540 of file uipc_mqueue.c.

References mqfs_info::mi_lock, mqfs_data, and st.

◆ mqfs_access()

static int mqfs_access ( struct vop_access_args *  ap)
static

Definition at line 1171 of file uipc_mqueue.c.

References vaccess().

Here is the call graph for this function:

◆ mqfs_add_node()

static int mqfs_add_node ( struct mqfs_node parent,
struct mqfs_node node 
)
static

Definition at line 426 of file uipc_mqueue.c.

References mqfs_node::mn_info, mqfs_node::mn_parent, mqfstype_dir, mqfstype_root, mqnode_addref(), and parent.

Referenced by mqfs_create_file(), and mqfs_fixup_dir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_allocv()

static int mqfs_allocv ( struct mount *  mp,
struct vnode **  vpp,
struct mqfs_node pn 
)
static

◆ mqfs_close()

static int mqfs_close ( struct vop_close_args *  ap)
static

Definition at line 1152 of file uipc_mqueue.c.

◆ mqfs_create()

static int mqfs_create ( struct vop_create_args *  ap)
static

◆ mqfs_create_file()

static struct mqfs_node * mqfs_create_file ( struct mqfs_node parent,
const char *  name,
int  namelen,
struct ucred *  cred,
int  mode 
)
static

Definition at line 468 of file uipc_mqueue.c.

References mode, mqfs_add_node(), mqfs_create_node(), mqfstype_file, mqnode_free(), name, and parent.

Referenced by kern_kmq_open(), and mqfs_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_create_node()

static struct mqfs_node * mqfs_create_node ( const char *  name,
int  namelen,
struct ucred *  cred,
int  mode,
int  nodetype 
)
static

Definition at line 445 of file uipc_mqueue.c.

References mqfs_node::mn_name, mode, mqnode_alloc(), name, and vfs_timestamp().

Referenced by mqfs_create_file(), and mqfs_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_destroy()

static int mqfs_destroy ( struct mqfs_node mn)
static

Definition at line 558 of file uipc_mqueue.c.

References mqfs_node::mn_info, mqfs_node::mn_parent, mqfs_destroy(), mqfs_fileno_free(), mqfstype_dir, mqfstype_root, mqnode_free(), mqueue_free(), and parent.

Referenced by mqfs_create(), mqfs_destroy(), mqfs_uninit(), and mqnode_release().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_fileno_alloc()

static void mqfs_fileno_alloc ( struct mqfs_info mi,
struct mqfs_node mn 
)
static

Definition at line 319 of file uipc_mqueue.c.

References alloc_unr(), mqfs_info::mi_root, mqfs_info::mi_unrhdr, mqfs_node::mn_parent, mqfs_fileno_alloc(), mqfstype_dir, mqfstype_file, mqfstype_parent, mqfstype_root, mqfstype_symlink, and mqfstype_this.

Referenced by mqfs_fileno_alloc(), mqfs_init(), and mqfs_readdir().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_fileno_free()

static void mqfs_fileno_free ( struct mqfs_info mi,
struct mqfs_node mn 
)
static

Definition at line 360 of file uipc_mqueue.c.

References free_unr(), mqfs_info::mi_unrhdr, mqfstype_dir, mqfstype_file, mqfstype_parent, mqfstype_root, mqfstype_symlink, and mqfstype_this.

Referenced by mqfs_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_fileno_init()

static void mqfs_fileno_init ( struct mqfs_info mi)
static

Definition at line 294 of file uipc_mqueue.c.

References mqfs_info::mi_unrhdr, and new_unrhdr().

Referenced by mqfs_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_fileno_uninit()

static void mqfs_fileno_uninit ( struct mqfs_info mi)
static

Definition at line 306 of file uipc_mqueue.c.

References delete_unrhdr(), and mqfs_info::mi_unrhdr.

Referenced by mqfs_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_fixup_dir()

static int mqfs_fixup_dir ( struct mqfs_node parent)
static

Definition at line 485 of file uipc_mqueue.c.

References mqfs_node::mn_name, mqfs_add_node(), mqfstype_parent, mqfstype_this, mqnode_alloc(), mqnode_free(), and parent.

Referenced by mqfs_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_getattr()

static int mqfs_getattr ( struct vop_getattr_args *  ap)
static

Definition at line 1198 of file uipc_mqueue.c.

References VTON.

◆ mqfs_inactive()

static int mqfs_inactive ( struct vop_inactive_args *  ap)
static

Definition at line 1089 of file uipc_mqueue.c.

References vrecycle(), and VTON.

Here is the call graph for this function:

◆ mqfs_init()

◆ mqfs_lookup()

static int mqfs_lookup ( struct vop_cachedlookup_args *  ap)
static

Definition at line 963 of file uipc_mqueue.c.

References mqfs_lookupx().

Here is the call graph for this function:

◆ mqfs_lookupx()

static int mqfs_lookupx ( struct vop_cachedlookup_args *  ap)
static

Definition at line 845 of file uipc_mqueue.c.

References flags, mqfs_info::mi_lock, mqfs_node::mn_info, mqfs_node::mn_parent, mqfs_allocv(), MQFS_NAMELEN, mqfs_search(), mqnode_addref(), mqnode_release(), and VTON.

Referenced by mqfs_lookup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqfs_mount()

static int mqfs_mount ( struct mount *  mp)
static

Definition at line 591 of file uipc_mqueue.c.

References mqfs_data, vfs_getnewfsid(), and vfs_mountedfrom().

Here is the call graph for this function:

◆ mqfs_open()

static int mqfs_open ( struct vop_open_args *  ap)
static

Definition at line 1136 of file uipc_mqueue.c.

◆ mqfs_prison_remove() [1/2]

static int mqfs_prison_remove ( void *  obj,
void *data  __unused 
)
static

Definition at line 1562 of file uipc_mqueue.c.

References allprison, do_unlink(), mqfs_info::mi_lock, mqfs_info::mi_root, mqfs_data, and pr.

Here is the call graph for this function:

◆ mqfs_prison_remove() [2/2]

static int mqfs_prison_remove ( void *  obj,
void *  data 
)
static

Referenced by mqfs_init().

Here is the caller graph for this function:

◆ mqfs_read()

static int mqfs_read ( struct vop_read_args *  ap)
static

Definition at line 1340 of file uipc_mqueue.c.

References buf, mqueue::mq_curmsgs, mqueue::mq_maxmsg, mqueue::mq_msgsize, mqueue::mq_totalbytes, snprintf(), uiomove_frombuf(), and VTOMQ.

Here is the call graph for this function:

◆ mqfs_readdir()

static int mqfs_readdir ( struct vop_readdir_args *  ap)
static

◆ mqfs_reclaim()

static int mqfs_reclaim ( struct vop_reclaim_args *  ap)
static

Definition at line 1106 of file uipc_mqueue.c.

References mqfs_info::mi_lock, mqnode_release(), mvdata_zone, and VFSTOMQFS.

Here is the call graph for this function:

◆ mqfs_remove()

static int mqfs_remove ( struct vop_remove_args *  ap)
static

Definition at line 1066 of file uipc_mqueue.c.

References do_unlink(), mqfs_info::mi_lock, VFSTOMQFS, and VTON.

Here is the call graph for this function:

◆ mqfs_root()

static int mqfs_root ( struct mount *  mp,
int  flags,
struct vnode **  vpp 
)
static

Definition at line 633 of file uipc_mqueue.c.

References mqfs_info::mi_root, mqfs_allocv(), and VFSTOMQFS.

Here is the call graph for this function:

◆ mqfs_search()

static struct mqfs_node * mqfs_search ( struct mqfs_node pd,
const char *  name,
int  len,
struct ucred *  cred 
)
static

Definition at line 824 of file uipc_mqueue.c.

References mqfs_info::mi_lock, mqfs_node::mn_info, mqfs_node::mn_name, and name.

Referenced by kern_kmq_open(), mqfs_lookupx(), and sys_kmq_unlink().

Here is the caller graph for this function:

◆ mqfs_setattr()

static int mqfs_setattr ( struct vop_setattr_args *  ap)
static

Definition at line 1239 of file uipc_mqueue.c.

References groupmember(), priv_check(), vfs_timestamp(), and VTON.

Here is the call graph for this function:

◆ mqfs_statfs()

static int mqfs_statfs ( struct mount *  mp,
struct statfs *  sbp 
)
static

Definition at line 647 of file uipc_mqueue.c.

◆ mqfs_uninit()

static int mqfs_uninit ( struct vfsconf vfc)
static

◆ mqfs_unmount()

static int mqfs_unmount ( struct mount *  mp,
int  mntflags 
)
static

Definition at line 620 of file uipc_mqueue.c.

References vflush().

Here is the call graph for this function:

◆ mqinit()

static int mqinit ( void  )
static

Definition at line 2888 of file uipc_mqueue.c.

References mq_syscalls, and syscall_helper_register().

Referenced by mq_modload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqnode_addref()

static __inline void mqnode_addref ( struct mqfs_node node)
static

Definition at line 394 of file uipc_mqueue.c.

Referenced by kern_kmq_open(), mqfs_add_node(), mqfs_allocv(), mqfs_create(), and mqfs_lookupx().

Here is the caller graph for this function:

◆ mqnode_alloc()

static __inline struct mqfs_node * mqnode_alloc ( void  )
static

Definition at line 382 of file uipc_mqueue.c.

References mqnode_zone.

Referenced by mqfs_create_node(), and mqfs_fixup_dir().

Here is the caller graph for this function:

◆ mqnode_free()

static __inline void mqnode_free ( struct mqfs_node node)
static

Definition at line 388 of file uipc_mqueue.c.

References mqnode_zone.

Referenced by mqfs_create_file(), mqfs_destroy(), and mqfs_fixup_dir().

Here is the caller graph for this function:

◆ mqnode_release()

static __inline void mqnode_release ( struct mqfs_node node)
static

Definition at line 400 of file uipc_mqueue.c.

References mqfs_info::mi_lock, mqfs_node::mn_info, mqfs_destroy(), mqfstype_dir, and mqfstype_root.

Referenced by do_unlink(), mqf_close(), mqfs_create(), mqfs_lookupx(), and mqfs_reclaim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_alloc()

static struct mqueue * mqueue_alloc ( const struct mq_attr *  attr)
static

Definition at line 1594 of file uipc_mqueue.c.

References curmq, default_maxmsg, default_msgsize, knlist_init_mtx(), maxmq, mqueue::mq_maxmsg, mqueue::mq_msgq, mqueue::mq_msgsize, mqueue::mq_mutex, mqueue::mq_rsel, mqueue::mq_wsel, and mqueue_zone.

Referenced by kern_kmq_open(), and mqfs_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_fdclose()

static void mqueue_fdclose ( struct thread *  td,
int  fd,
struct file *  fp 
)
static

Definition at line 2446 of file uipc_mqueue.c.

References fd, FPTOMQ, mqueue::mq_flags, mqueue::mq_mutex, mqueue::mq_rsel, MQ_RSEL, mqueue::mq_wsel, MQ_WSEL, mqueueops, notifier_remove(), and selwakeup().

Referenced by mqfs_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_free()

static void mqueue_free ( struct mqueue mq)
static

Definition at line 1620 of file uipc_mqueue.c.

References curmq, free(), knlist_destroy(), mqueue::mq_msgq, mqueue::mq_mutex, mqueue::mq_rsel, mqueue::mq_wsel, mqueue_zone, and seldrain().

Referenced by kern_kmq_open(), mqfs_create(), and mqfs_destroy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_freemsg()

static __inline void mqueue_freemsg ( struct mqueue_msg msg)
static

Definition at line 1681 of file uipc_mqueue.c.

References free().

Referenced by mqueue_receive(), and mqueue_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_loadmsg()

static struct mqueue_msg * mqueue_loadmsg ( const char *  msg_ptr,
size_t  msg_size,
int  msg_prio 
)
static

Definition at line 1642 of file uipc_mqueue.c.

References free(), and malloc().

Referenced by mqueue_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_receive()

int mqueue_receive ( struct mqueue mq,
char *  msg_ptr,
size_t  msg_len,
unsigned *  msg_prio,
int  waitok,
const struct timespec *  abs_timeout 
)
static

Definition at line 1847 of file uipc_mqueue.c.

References _mqueue_recv(), getnanotime(), mqueue_freemsg(), mqueue_savemsg(), ts, and tvtohz().

Referenced by sys_kmq_timedreceive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_savemsg()

static int mqueue_savemsg ( struct mqueue_msg msg,
char *  msg_ptr,
int *  msg_prio 
)
static

Definition at line 1666 of file uipc_mqueue.c.

Referenced by mqueue_receive().

Here is the caller graph for this function:

◆ mqueue_send()

int mqueue_send ( struct mqueue mq,
const char *  msg_ptr,
size_t  msg_len,
unsigned  msg_prio,
int  waitok,
const struct timespec *  abs_timeout 
)
static

Definition at line 1692 of file uipc_mqueue.c.

References _mqueue_send(), getnanotime(), mqueue::mq_msgsize, mqueue_freemsg(), mqueue_loadmsg(), ts, and tvtohz().

Referenced by sys_kmq_timedsend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqueue_send_notification()

static void mqueue_send_notification ( struct mqueue mq)
static

Definition at line 1816 of file uipc_mqueue.c.

References mqueue::mq_mutex, mqueue::mq_notifier, sigev_findtd(), and tdsendsignal().

Referenced by _mqueue_recv(), _mqueue_send(), and kern_kmq_notify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mqunload()

static int mqunload ( void  )
static

Definition at line 2904 of file uipc_mqueue.c.

References mq_syscalls, and syscall_helper_unregister().

Referenced by mq_modload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notifier_alloc()

static __inline struct mqueue_notifier * notifier_alloc ( void  )
static

Definition at line 1956 of file uipc_mqueue.c.

References mqnoti_zone.

Referenced by kern_kmq_notify().

Here is the caller graph for this function:

◆ notifier_delete()

static __inline void notifier_delete ( struct proc *  p,
struct mqueue_notifier nt 
)
static

Definition at line 1986 of file uipc_mqueue.c.

References notifier_free().

Referenced by notifier_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notifier_free()

static __inline void notifier_free ( struct mqueue_notifier p)
static

Definition at line 1962 of file uipc_mqueue.c.

References mqnoti_zone.

Referenced by kern_kmq_notify(), and notifier_delete().

Here is the caller graph for this function:

◆ notifier_insert()

static __inline void notifier_insert ( struct proc *  p,
struct mqueue_notifier nt 
)
static

Definition at line 1980 of file uipc_mqueue.c.

Referenced by kern_kmq_notify().

Here is the caller graph for this function:

◆ notifier_remove()

static void notifier_remove ( struct proc *  p,
struct mqueue mq,
int  fd 
)
static

Definition at line 1993 of file uipc_mqueue.c.

References fd, mqueue::mq_mutex, mqueue::mq_notifier, notifier_delete(), notifier_search(), and sigqueue_take().

Referenced by kern_kmq_notify(), mq_proc_exit(), and mqueue_fdclose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ notifier_search()

static struct mqueue_notifier * notifier_search ( struct proc *  p,
int  fd 
)
static

Definition at line 1968 of file uipc_mqueue.c.

References fd.

Referenced by kern_kmq_notify(), and notifier_remove().

Here is the caller graph for this function:

◆ sys_kmq_notify()

int sys_kmq_notify ( struct thread *  td,
struct kmq_notify_args *  uap 
)

Definition at line 2429 of file uipc_mqueue.c.

References ev, and kern_kmq_notify().

Here is the call graph for this function:

◆ sys_kmq_open()

int sys_kmq_open ( struct thread *  td,
struct kmq_open_args *  uap 
)

Definition at line 2117 of file uipc_mqueue.c.

References flags, and kern_kmq_open().

Here is the call graph for this function:

◆ sys_kmq_setattr()

int sys_kmq_setattr ( struct thread *  td,
struct kmq_setattr_args *  uap 
)

Definition at line 2251 of file uipc_mqueue.c.

References kern_kmq_setattr().

Here is the call graph for this function:

◆ sys_kmq_timedreceive()

int sys_kmq_timedreceive ( struct thread *  td,
struct kmq_timedreceive_args *  uap 
)

Definition at line 2271 of file uipc_mqueue.c.

References getmq_read(), and mqueue_receive().

Here is the call graph for this function:

◆ sys_kmq_timedsend()

int sys_kmq_timedsend ( struct thread *  td,
struct kmq_timedsend_args *  uap 
)

Definition at line 2299 of file uipc_mqueue.c.

References getmq_write(), and mqueue_send().

Here is the call graph for this function:

◆ sys_kmq_unlink()

int sys_kmq_unlink ( struct thread *  td,
struct kmq_unlink_args *  uap 
)

Definition at line 2138 of file uipc_mqueue.c.

References do_unlink(), mqfs_info::mi_lock, mqfs_info::mi_root, mqfs_data, MQFS_NAMELEN, mqfs_search(), and path.

Here is the call graph for this function:

◆ SYSCTL_INT() [1/4]

SYSCTL_INT ( _kern_mqueue  ,
OID_AUTO  ,
curmq  ,
CTLFLAG_RW  ,
curmq,
,
"current message queue number"   
)

◆ SYSCTL_INT() [2/4]

SYSCTL_INT ( _kern_mqueue  ,
OID_AUTO  ,
maxmq  ,
CTLFLAG_RW  ,
maxmq,
,
"maximum message queues"   
)

◆ SYSCTL_INT() [3/4]

SYSCTL_INT ( _kern_mqueue  ,
OID_AUTO  ,
maxmsg  ,
CTLFLAG_RW  ,
maxmsg,
,
"Default maximum messages in queue"   
)

◆ SYSCTL_INT() [4/4]

SYSCTL_INT ( _kern_mqueue  ,
OID_AUTO  ,
maxmsgsize  ,
CTLFLAG_RW  ,
maxmsgsize,
,
"Default maximum message size"   
)

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _kern  ,
OID_AUTO  ,
mqueue  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"POSIX real time message queue"   
)
static

◆ TAILQ_HEAD()

TAILQ_HEAD ( msgq  ,
mqueue_msg   
)

◆ VFS_VOP_VECTOR_REGISTER()

VFS_VOP_VECTOR_REGISTER ( mqfs_vnodeops  )

Variable Documentation

◆ curmq

int curmq = 0
static

Definition at line 217 of file uipc_mqueue.c.

Referenced by mqueue_alloc(), and mqueue_free().

◆ default_maxmsg

int default_maxmsg = 10
static

Definition at line 205 of file uipc_mqueue.c.

Referenced by mqueue_alloc().

◆ default_msgsize

int default_msgsize = 1024
static

Definition at line 206 of file uipc_mqueue.c.

Referenced by mqueue_alloc().

◆ exit_tag

eventhandler_tag exit_tag
static

Definition at line 223 of file uipc_mqueue.c.

Referenced by mqfs_init(), and mqfs_uninit().

◆ maxmq

int maxmq = 100
static

Definition at line 214 of file uipc_mqueue.c.

Referenced by mqueue_alloc().

◆ maxmsg

int maxmsg = 100
static

Definition at line 208 of file uipc_mqueue.c.

Referenced by kern_kmq_open().

◆ maxmsgsize

int maxmsgsize = 16384
static

Definition at line 211 of file uipc_mqueue.c.

Referenced by kern_kmq_open().

◆ mq_rfiltops

struct filterops mq_rfiltops
Initial value:
= {
.f_isfd = 1,
.f_detach = filt_mqdetach,
.f_event = filt_mqread,
}
static int filt_mqread(struct knote *kn, long hint)
Definition: uipc_mqueue.c:2633
static void filt_mqdetach(struct knote *kn)
Definition: uipc_mqueue.c:2620

Definition at line 279 of file uipc_mqueue.c.

Referenced by mqf_kqfilter().

◆ mq_syscalls

struct syscall_helper_data mq_syscalls[]
static
Initial value:
= {
SYSCALL_INIT_HELPER(kmq_open),
SYSCALL_INIT_HELPER_F(kmq_setattr, SYF_CAPENABLED),
SYSCALL_INIT_HELPER_F(kmq_timedsend, SYF_CAPENABLED),
SYSCALL_INIT_HELPER_F(kmq_timedreceive, SYF_CAPENABLED),
SYSCALL_INIT_HELPER_F(kmq_notify, SYF_CAPENABLED),
SYSCALL_INIT_HELPER(kmq_unlink),
SYSCALL_INIT_LAST
}

Definition at line 2712 of file uipc_mqueue.c.

Referenced by mqinit(), and mqunload().

◆ mq_wfiltops

struct filterops mq_wfiltops
Initial value:
= {
.f_isfd = 1,
.f_detach = filt_mqdetach,
.f_event = filt_mqwrite,
}
static int filt_mqwrite(struct knote *kn, long hint)
Definition: uipc_mqueue.c:2642

Definition at line 284 of file uipc_mqueue.c.

Referenced by mqf_kqfilter().

◆ mqfs_data

◆ mqfs_osd_jail_slot

unsigned mqfs_osd_jail_slot
static

Definition at line 233 of file uipc_mqueue.c.

Referenced by mqfs_init(), and mqfs_uninit().

◆ mqfs_vfsops

struct vfsops mqfs_vfsops
static
Initial value:
= {
.vfs_init = mqfs_init,
.vfs_uninit = mqfs_uninit,
.vfs_mount = mqfs_mount,
.vfs_unmount = mqfs_unmount,
.vfs_root = mqfs_root,
.vfs_statfs = mqfs_statfs,
}
static int mqfs_init(struct vfsconf *vfc)
Definition: uipc_mqueue.c:657
static int mqfs_mount(struct mount *mp)
Definition: uipc_mqueue.c:591
static int mqfs_unmount(struct mount *mp, int mntflags)
Definition: uipc_mqueue.c:620
static int mqfs_uninit(struct vfsconf *vfc)
Definition: uipc_mqueue.c:698
static int mqfs_statfs(struct mount *mp, struct statfs *sbp)
Definition: uipc_mqueue.c:647
static int mqfs_root(struct mount *mp, int flags, struct vnode **vpp)
Definition: uipc_mqueue.c:633

Definition at line 2695 of file uipc_mqueue.c.

◆ mqfs_vnodeops

static struct vop_vector mqfs_vnodeops
static
Initial value:
= {
.vop_default = &default_vnodeops,
.vop_access = mqfs_access,
.vop_cachedlookup = mqfs_lookup,
.vop_lookup = vfs_cache_lookup,
.vop_reclaim = mqfs_reclaim,
.vop_create = mqfs_create,
.vop_remove = mqfs_remove,
.vop_inactive = mqfs_inactive,
.vop_open = mqfs_open,
.vop_close = mqfs_close,
.vop_getattr = mqfs_getattr,
.vop_setattr = mqfs_setattr,
.vop_read = mqfs_read,
.vop_write = VOP_EOPNOTSUPP,
.vop_readdir = mqfs_readdir,
.vop_mkdir = VOP_EOPNOTSUPP,
.vop_rmdir = VOP_EOPNOTSUPP
}
static int mqfs_open(struct vop_open_args *ap)
Definition: uipc_mqueue.c:1136
static int mqfs_getattr(struct vop_getattr_args *ap)
Definition: uipc_mqueue.c:1198
static int mqfs_readdir(struct vop_readdir_args *ap)
Definition: uipc_mqueue.c:1380
static int mqfs_close(struct vop_close_args *ap)
Definition: uipc_mqueue.c:1152
static int mqfs_reclaim(struct vop_reclaim_args *ap)
Definition: uipc_mqueue.c:1106
static int mqfs_inactive(struct vop_inactive_args *ap)
Definition: uipc_mqueue.c:1089
static int mqfs_lookup(struct vop_cachedlookup_args *ap)
Definition: uipc_mqueue.c:963
static int mqfs_read(struct vop_read_args *ap)
Definition: uipc_mqueue.c:1340
static int mqfs_setattr(struct vop_setattr_args *ap)
Definition: uipc_mqueue.c:1239
static int mqfs_create(struct vop_create_args *ap)
Definition: uipc_mqueue.c:984
static int mqfs_remove(struct vop_remove_args *ap)
Definition: uipc_mqueue.c:1066
static int mqfs_access(struct vop_access_args *ap)
Definition: uipc_mqueue.c:1171
int vfs_cache_lookup(struct vop_lookup_args *ap)
Definition: vfs_cache.c:3045
struct vop_vector default_vnodeops
Definition: vfs_default.c:109

Definition at line 231 of file uipc_mqueue.c.

Referenced by mqfs_allocv().

◆ mqnode_zone

uma_zone_t mqnode_zone
static

Definition at line 227 of file uipc_mqueue.c.

Referenced by mqfs_init(), mqfs_uninit(), mqnode_alloc(), and mqnode_free().

◆ mqnoti_zone

uma_zone_t mqnoti_zone
static

Definition at line 230 of file uipc_mqueue.c.

Referenced by mqfs_init(), mqfs_uninit(), notifier_alloc(), and notifier_free().

◆ mqueue_zone

uma_zone_t mqueue_zone
static

Definition at line 228 of file uipc_mqueue.c.

Referenced by mqfs_init(), mqfs_uninit(), mqueue_alloc(), and mqueue_free().

◆ mqueuefs_mod

moduledata_t mqueuefs_mod
static
Initial value:
= {
"mqueuefs",
}
static int mq_modload(struct module *module, int cmd, void *arg)
Definition: uipc_mqueue.c:2915
static struct vfsconf mqueuefs_vfsconf
Definition: uipc_mqueue.c:2704

Definition at line 2938 of file uipc_mqueue.c.

◆ mqueuefs_vfsconf

struct vfsconf mqueuefs_vfsconf
static
Initial value:
= {
.vfc_version = VFS_VERSION,
.vfc_name = "mqueuefs",
.vfc_vfsops = &mqfs_vfsops,
.vfc_typenum = -1,
.vfc_flags = VFCF_SYNTHETIC
}
static struct vfsops mqfs_vfsops
Definition: uipc_mqueue.c:2695

Definition at line 2704 of file uipc_mqueue.c.

◆ mqueueops

static struct fileops mqueueops
static
Initial value:
= {
.fo_read = invfo_rdwr,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,
.fo_ioctl = invfo_ioctl,
.fo_poll = mqf_poll,
.fo_kqfilter = mqf_kqfilter,
.fo_stat = mqf_stat,
.fo_close = mqf_close,
.fo_chmod = mqf_chmod,
.fo_chown = mqf_chown,
.fo_sendfile = invfo_sendfile,
.fo_fill_kinfo = mqf_fill_kinfo,
.fo_flags = DFLAG_PASSABLE,
}
int invfo_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td)
int invfo_truncate(struct file *fp, off_t length, struct ucred *active_cred, struct thread *td)
int invfo_sendfile(struct file *fp, int sockfd, struct uio *hdr_uio, struct uio *trl_uio, off_t offset, size_t nbytes, off_t *sent, int flags, struct thread *td)
int invfo_rdwr(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td)
static int mqf_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
Definition: uipc_mqueue.c:2651
static int mqf_poll(struct file *fp, int events, struct ucred *active_cred, struct thread *td)
Definition: uipc_mqueue.c:2498
static int mqf_kqfilter(struct file *fp, struct knote *kn)
Definition: uipc_mqueue.c:2603
static int mqf_close(struct file *fp, struct thread *td)
Definition: uipc_mqueue.c:2526
static int mqf_chown(struct file *fp, uid_t uid, gid_t gid, struct ucred *active_cred, struct thread *td)
Definition: uipc_mqueue.c:2578
static int mqf_stat(struct file *fp, struct stat *st, struct ucred *active_cred)
Definition: uipc_mqueue.c:2540
static int mqf_chmod(struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td)
Definition: uipc_mqueue.c:2558

Definition at line 232 of file uipc_mqueue.c.

Referenced by _getmq(), kern_kmq_open(), mq_proc_exit(), and mqueue_fdclose().

◆ mvdata_zone

uma_zone_t mvdata_zone
static

Definition at line 229 of file uipc_mqueue.c.

Referenced by mqfs_allocv(), mqfs_init(), mqfs_reclaim(), and mqfs_uninit().

◆ unloadable

int unloadable = 0
static

Definition at line 220 of file uipc_mqueue.c.

Referenced by accept_filt_generic_mod_event(), and mqfs_uninit().