33 #include <sys/vfs_opreg.h>
34 #include <sys/kmem.h>
35 #include <fs/fs_subr.h>
36 #include <sys/proc.h>
37 #include <sys/kstat.h>
38 #include <sys/port_impl.h>
39
40 /* local functions */
41 static int port_open(struct vnode **, int, cred_t *, caller_context_t *);
42 static int port_close(struct vnode *, int, int, offset_t, cred_t *,
43 caller_context_t *);
44 static int port_getattr(struct vnode *, struct vattr *, int, cred_t *,
45 caller_context_t *);
46 static int port_access(struct vnode *, int, int, cred_t *, caller_context_t *);
47 static int port_realvp(vnode_t *, vnode_t **, caller_context_t *);
48 static int port_poll(vnode_t *, short, int, short *, struct pollhead **,
49 caller_context_t *);
50 static void port_inactive(struct vnode *, cred_t *, caller_context_t *);
51
52 const fs_operation_def_t port_vnodeops_template[] = {
53 VOPNAME_OPEN, { .vop_open = port_open },
54 VOPNAME_CLOSE, { .vop_close = port_close },
55 VOPNAME_GETATTR, { .vop_getattr = port_getattr },
56 VOPNAME_ACCESS, { .vop_access = port_access },
57 VOPNAME_INACTIVE, { .vop_inactive = port_inactive },
58 VOPNAME_FRLOCK, { .error = fs_error },
59 VOPNAME_REALVP, { .vop_realvp = port_realvp },
60 VOPNAME_POLL, { .vop_poll = port_poll },
61 VOPNAME_PATHCONF, { .error = fs_error },
62 VOPNAME_DISPOSE, { .error = fs_error },
63 VOPNAME_GETSECATTR, { .error = fs_error },
64 VOPNAME_SHRLOCK, { .error = fs_error },
65 NULL, NULL
66 };
67
68 /* ARGSUSED */
69 static int
70 port_open(struct vnode **vpp, int flag, cred_t *cr, caller_context_t *ct)
71 {
72 return (0);
73 }
74
75 /*
76 * port_discard_events() scans the port event queue for events owned
77 * by current proc. Non-shareable events will be discarded, all other
78 * events remain in the event queue.
79 */
80 void
81 port_discard_events(port_queue_t *portq)
82 {
83 port_kevent_t *kevp;
84 pid_t pid = curproc->p_pid;
85
|
33 #include <sys/vfs_opreg.h>
34 #include <sys/kmem.h>
35 #include <fs/fs_subr.h>
36 #include <sys/proc.h>
37 #include <sys/kstat.h>
38 #include <sys/port_impl.h>
39
40 /* local functions */
41 static int port_open(struct vnode **, int, cred_t *, caller_context_t *);
42 static int port_close(struct vnode *, int, int, offset_t, cred_t *,
43 caller_context_t *);
44 static int port_getattr(struct vnode *, struct vattr *, int, cred_t *,
45 caller_context_t *);
46 static int port_access(struct vnode *, int, int, cred_t *, caller_context_t *);
47 static int port_realvp(vnode_t *, vnode_t **, caller_context_t *);
48 static int port_poll(vnode_t *, short, int, short *, struct pollhead **,
49 caller_context_t *);
50 static void port_inactive(struct vnode *, cred_t *, caller_context_t *);
51
52 const fs_operation_def_t port_vnodeops_template[] = {
53 { VOPNAME_OPEN, { .vop_open = port_open } },
54 { VOPNAME_CLOSE, { .vop_close = port_close } },
55 { VOPNAME_GETATTR, { .vop_getattr = port_getattr } },
56 { VOPNAME_ACCESS, { .vop_access = port_access } },
57 { VOPNAME_INACTIVE, { .vop_inactive = port_inactive } },
58 { VOPNAME_FRLOCK, { .error = fs_error } },
59 { VOPNAME_REALVP, { .vop_realvp = port_realvp } },
60 { VOPNAME_POLL, { .vop_poll = port_poll } },
61 { VOPNAME_PATHCONF, { .error = fs_error } },
62 { VOPNAME_DISPOSE, { .error = fs_error } },
63 { VOPNAME_GETSECATTR, { .error = fs_error } },
64 { VOPNAME_SHRLOCK, { .error = fs_error } },
65 { NULL, { NULL } }
66 };
67
68 /* ARGSUSED */
69 static int
70 port_open(struct vnode **vpp, int flag, cred_t *cr, caller_context_t *ct)
71 {
72 return (0);
73 }
74
75 /*
76 * port_discard_events() scans the port event queue for events owned
77 * by current proc. Non-shareable events will be discarded, all other
78 * events remain in the event queue.
79 */
80 void
81 port_discard_events(port_queue_t *portq)
82 {
83 port_kevent_t *kevp;
84 pid_t pid = curproc->p_pid;
85
|