1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 #ifndef _xfs_dev_h
37 #define _xfs_dev_h
38
39
40
41
42
43
44
45
46 struct xfs_link {
47 struct xfs_link *prev, *next;
48 struct xfs_message_header *message;
49 u_int error_or_size;
50
51 };
52
53 struct xfs_channel {
54 struct xfs_link messageq;
55 struct xfs_link sleepq;
56 u_int nsequence;
57 #ifdef __osf__
58 sel_queue_t sel_q;
59 #else
60 struct selinfo selinfo;
61 #endif
62 struct xfs_message_header *message_buffer;
63 int status;
64 #define CHANNEL_OPENED 0x1
65 #define CHANNEL_WAITING 0x2
66 d_thread_t *proc;
67 };
68
69 extern struct xfs_channel xfs_channel[NNNPFS];
70
71
72
73
74
75 void xfs_select_wakeup(struct xfs_channel *);
76
77 int xfs_install_device(void);
78 int xfs_uninstall_device(void);
79
80 int xfs_install_filesys(void);
81 int xfs_may_uninstall_filesys(void);
82 int xfs_uninstall_filesys(void);
83
84 int xfs_stat_filesys(void);
85 int xfs_stat_device(void);
86
87
88
89
90
91 void
92 xfs_initq(struct xfs_link *q);
93
94 int
95 xfs_emptyq(const struct xfs_link *q);
96
97 int
98 xfs_onq(const struct xfs_link *link);
99
100 void
101 xfs_appendq(struct xfs_link *q, struct xfs_link *p);
102
103 void
104 xfs_outq(struct xfs_link *p);
105
106 int
107 xfs_devopen_common(dev_t dev);
108
109 #ifndef __osf__
110 int xfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc);
111 int xfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *proc);
112 int xfs_devioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
113 d_thread_t *p);
114 #ifdef HAVE_THREE_ARGUMENT_SELRECORD
115 int xfs_devselect(dev_t dev, int which, void *wql, d_thread_t *p);
116 #else
117 int xfs_devselect(dev_t dev, int which, d_thread_t *p);
118 #endif
119 int xfs_devpoll(dev_t dev, int events, d_thread_t *p);
120 #endif
121
122 int
123 xfs_devclose_common(dev_t dev, d_thread_t *p);
124
125 int
126 xfs_devread(dev_t dev, struct uio * uiop, int ioflag);
127
128 int
129 xfs_devwrite(dev_t dev, struct uio *uiop, int ioflag);
130
131 int
132 xfs_message_send(int fd, struct xfs_message_header * message, u_int size);
133
134 int
135 xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size,
136 d_thread_t *p);
137
138 int
139 xfs_message_receive(int fd,
140 struct xfs_message_header *message,
141 u_int size,
142 d_thread_t *p);
143
144 int
145 xfs_message_wakeup(int fd,
146 struct xfs_message_wakeup *message,
147 u_int size,
148 d_thread_t *p);
149
150 int
151 xfs_message_wakeup_data(int fd,
152 struct xfs_message_wakeup_data * message,
153 u_int size,
154 d_thread_t *p);
155
156 int
157 xfs_uprintf_device(void);
158
159 int
160 xfs_is_xfs_dev (dev_t dev);
161
162 #endif