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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
diff --git a/libpager/demuxer.c b/libpager/demuxer.c
index 79c0ddc..9a847fb 100644
--- a/libpager/demuxer.c
+++ b/libpager/demuxer.c
@@ -19,22 +19,25 @@
#include "memory_object_S.h"
#include "notify_S.h"
+#include "memory_object_S.h"
+#include "notify_S.h"
+
/* Demultiplex a single message directed at a pager port; INP is the
message received; fill OUTP with the reply. */
int
pager_demuxer (mach_msg_header_t *inp,
mach_msg_header_t *outp)
{
- extern int _pager_seqnos_memory_object_server (mach_msg_header_t *inp,
- mach_msg_header_t *outp);
- extern int _pager_seqnos_notify_server (mach_msg_header_t *inp,
- mach_msg_header_t *outp);
+ mig_routine_t routine;
+ if ((routine = _pager_seqnos_memory_object_server_routine (inp)) ||
+ (routine = _pager_seqnos_notify_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
+ return TRUE;
+ }
- int result = _pager_seqnos_memory_object_server (inp, outp)
- || _pager_seqnos_notify_server (inp, outp);
- if (!result)
- /* Synchronize our bookkeeping of the port's seqno with the one consumed by
- this bogus message. */
- _pager_update_seqno (inp->msgh_local_port, inp->msgh_seqno);
- return result;
+ /* Synchronize our bookkeeping of the port's seqno with the one
+ consumed by this bogus message. */
+ _pager_update_seqno (inp->msgh_local_port, inp->msgh_seqno);
+ return FALSE;
}
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c
index 66b8587..0977a5d 100644
--- a/mach-defpager/default_pager.c
+++ b/mach-defpager/default_pager.c
@@ -54,7 +54,10 @@
#include <file_io.h>
+#include "memory_object_S.h"
+#include "memory_object_default_S.h"
#include "default_pager_S.h"
+#include "exc_S.h"
#define debug 0
@@ -2921,13 +2924,13 @@ seqnos_memory_object_lock_completed (memory_object_t pager,
kern_return_t
seqnos_memory_object_data_unlock(pager, seqno, pager_request,
- offset, addr, data_cnt)
+ offset, length, protection_required)
memory_object_t pager;
mach_port_seqno_t seqno;
mach_port_t pager_request;
vm_offset_t offset;
- pointer_t addr;
- vm_size_t data_cnt;
+ vm_size_t length;
+ vm_prot_t protection_required;
{
panic("%sdata_unlock",my_name);
return(KERN_FAILURE);
@@ -3019,7 +3022,6 @@ boolean_t default_pager_notify_server(in, out)
return TRUE;
}
-extern boolean_t seqnos_memory_object_server();
extern boolean_t seqnos_memory_object_default_server();
extern boolean_t default_pager_server();
extern boolean_t exc_server();
@@ -3028,6 +3030,37 @@ extern void bootstrap_compat();
mach_msg_size_t default_pager_msg_size_object = 128;
+/* Fill in default response. */
+static void
+mig_reply_setup (
+ const mach_msg_header_t *in,
+ mach_msg_header_t *out)
+{
+ static const mach_msg_type_t RetCodeType = {
+ /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32,
+ /* msgt_size = */ 32,
+ /* msgt_number = */ 1,
+ /* msgt_inline = */ TRUE,
+ /* msgt_longform = */ FALSE,
+ /* msgt_deallocate = */ FALSE,
+ /* msgt_unused = */ 0
+ };
+
+#define InP (in)
+#define OutP ((mig_reply_header_t *) out)
+ OutP->Head.msgh_bits =
+ MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(InP->msgh_bits), 0);
+ OutP->Head.msgh_size = sizeof *OutP;
+ OutP->Head.msgh_remote_port = InP->msgh_remote_port;
+ OutP->Head.msgh_local_port = MACH_PORT_NULL;
+ OutP->Head.msgh_seqno = 0;
+ OutP->Head.msgh_id = InP->msgh_id + 100;
+ OutP->RetCodeType = RetCodeType;
+ OutP->RetCode = MIG_BAD_ID;
+#undef InP
+#undef OutP
+}
+
boolean_t
default_pager_demux_object(in, out)
mach_msg_header_t *in;
@@ -3038,15 +3071,23 @@ default_pager_demux_object(in, out)
* the memory_object_default interface.
*/
-int rval;
-ddprintf ("DPAGER DEMUX OBJECT <%p>: %d\n", in, in->msgh_id);
-rval =
- (seqnos_memory_object_server(in, out) ||
- seqnos_memory_object_default_server(in, out) ||
- default_pager_notify_server(in, out) ||
- default_pager_server(in, out));
-ddprintf ("DPAGER DEMUX OBJECT DONE <%p>: %d\n", in, in->msgh_id);
-return rval;
+ int rval = FALSE;
+ ddprintf ("DPAGER DEMUX OBJECT <%p>: %d\n", in, in->msgh_id);
+ mig_reply_setup (in, out);
+
+ mig_routine_t routine;
+ if ((routine = seqnos_memory_object_server_routine (in)) ||
+ (routine = seqnos_memory_object_default_server_routine (in)) ||
+ (routine = NULL, default_pager_notify_server (in, out)) ||
+ (routine = default_pager_server_routine (in)))
+ {
+ if (routine)
+ (*routine) (in, out);
+ rval = TRUE;
+ }
+
+ ddprintf ("DPAGER DEMUX OBJECT DONE <%p>: %d\n", in, in->msgh_id);
+ return rval;
}
mach_msg_size_t default_pager_msg_size_default = 8 * 1024;
diff --git a/utils/umount.c b/utils/umount.c
index 26d2b56..7901da6 100644
--- a/utils/umount.c
+++ b/utils/umount.c
@@ -40,7 +40,7 @@ static char *targets;
static size_t targets_len;
static int readonly;
static int verbose;
-static int passive_flags = FS_TRANS_SET;
+static int passive_flags;
static int active_flags = FS_TRANS_SET;
static int goaway_flags;
static int source_goaway;
@@ -139,7 +139,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
return 0;
}
-static const char doc[] = "Stop active and remove passive translators";
+static const char doc[] = "Stop active filesystem translators";
static const char args_doc[] = "DEVICE|DIRECTORY [DEVICE|DIRECTORY ...]";
static struct argp fstab_argp_mtab; /* Slightly modified version. */
|