> Your code does nothing to either translator setting, but just sends an
> fsys_goaway to the active translator. This leaves it up to the translator
> to die or not as it chooses. The file_set_translator RPC that will be made
> by "settrans -a FILE" to the parent filesystem will do the same fsys_goaway
> call to the translator. So you haven't really added anything new.
>
> The intent of that TODO item is more like the opposite of the direction you
> seem to be thinking. If you follow the code path on the server side, you
> will see that it will always call fsys_goaway on the active translator if
> there is one, and if that server returns some error code, the parent
> filesystem will just propagate the error and refuse to reset the active
> translator. So, a truly reticent filesystem server can't be "unmounted"
> from a node by any means in the filesystem protocols. You have to just
> kill the process.
>
> So, what "without using goaway" means in this TODO item is having a way in
> the file_set_translator protocol to detach the old translator without
> regard for its feelings on the subject. Add a flag bit to the ACTIVE_FLAGS
> argument that tells the server to skip the fsys_goaway call and just reset
> its port. Then settrans would get a new option to use this flag bit.
Done. A sample run:
Script started on Fri May 11 16:44:19 2001
neal@hurd:~/temp (0)$ settrans -ac hello /hurd/hello
neal@hurd:~/temp (0)$ cat hello
Hello, world!
neal@hurd:~/temp (0)$ settrans -g hello
neal@hurd:~/temp (0)$ cat hello
neal@hurd:~/temp (0)$ ps -A | grep hello
neal 118 p1 S 0:00.01 grep hello
neal@hurd:~/temp (0)$ settrans -ac hello /hurd/hello
neal@hurd:~/temp (0)$ cat hello
Hello, world!
neal@hurd:~/temp (0)$ ps -A | grep hello
neal 121 - So 0:00.00 /hurd/hello
neal 124 p1 S 0:00.01 grep hello
neal@hurd:~/temp (0)$ settrans -agd hello
neal@hurd:~/temp (0)$ cat hello
neal@hurd:~/temp (0)$ ps -A | grep hello
neal 121 - So 0:00.00 /hurd/hello
neal 129 p1 S 0:00.00 grep hello
neal@hurd:~/temp (0)$ kill 121
neal@hurd:~/temp (0)$ exit
Script done on Fri May 11 16:45:39 2001
And the patch:
Index: hurd/ChangeLog
===================================================================
RCS file: /home/neal/shared/CVS/hurd/hurd/ChangeLog,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 ChangeLog
--- hurd/ChangeLog 2001/05/07 18:25:10 1.1.1.2
+++ hurd/ChangeLog 2001/05/11 14:56:32
@@ -1,3 +1,7 @@
+2001-05-10 Neal H Walfield <[EMAIL PROTECTED]>
+
+ * hurd_types.h: FSYS_GOAWAY_DISCONNECT new macro.
+
2001-05-01 Neal H Walfield <[EMAIL PROTECTED]>
* hurd_types.defs (startup_t): Fix typo.
Index: hurd/hurd_types.h
===================================================================
RCS file: /home/neal/shared/CVS/hurd/hurd/hurd_types.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 hurd_types.h
--- hurd/hurd_types.h 2001/04/19 12:40:42 1.1.1.1
+++ hurd/hurd_types.h 2001/05/06 08:58:50
@@ -141,6 +141,8 @@
#define FSYS_GOAWAY_FORCE 0x00000004 /* Go away despite current users. */
#define FSYS_GOAWAY_UNLINK 0x00000008 /* Go away only if non-directory. */
#define FSYS_GOAWAY_RECURSE 0x00000010 /* Shutdown children too. */
+#define FSYS_GOAWAY_DISCONNECT 0x0000020 /* Disconnect from the filesystem (and
+ do NOT send a fsys_goaway). */
/* Types of ports the terminal driver can run on top of;
used in term.defs:term_get_bottom_type. */
Index: libdiskfs/ChangeLog
===================================================================
RCS file: /home/neal/shared/CVS/hurd/libdiskfs/ChangeLog,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 ChangeLog
--- libdiskfs/ChangeLog 2001/05/07 18:25:49 1.1.1.3
+++ libdiskfs/ChangeLog 2001/05/11 14:58:40
@@ -1,3 +1,9 @@
+2001-05-10 Neal H Walfield <[EMAIL PROTECTED]>
+
+ * file-set-trans.c (diskfs_S_file_set_translator): If
+ FSYS_GOAWAY_DISCONNECT is set, do not ask the active translator
+ to go away, just disconnect it.
+
2001-04-22 Neal H Walfield <[EMAIL PROTECTED]>
* Makefile (OTHERSRCS): Add extern-inline.c.
Index: libdiskfs/file-set-trans.c
===================================================================
RCS file: /home/neal/shared/CVS/hurd/libdiskfs/file-set-trans.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 file-set-trans.c
--- libdiskfs/file-set-trans.c 2001/04/19 12:40:51 1.1.1.1
+++ libdiskfs/file-set-trans.c 2001/05/09 12:15:24
@@ -57,7 +57,8 @@
return error;
}
- if (active_flags & FS_TRANS_SET)
+ if (active_flags & FS_TRANS_SET
+ && ! (killtrans_flags & FSYS_GOAWAY_DISCONNECT))
{
error = fshelp_fetch_control (&np->transbox, &control);
if (error)
Index: utils/ChangeLog
===================================================================
RCS file: /home/neal/shared/CVS/hurd/utils/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ChangeLog
--- utils/ChangeLog 2001/04/19 12:42:48 1.1.1.1
+++ utils/ChangeLog 2001/05/11 14:50:43
@@ -1,3 +1,9 @@
+2001-05-10 Neal H Walfield <[EMAIL PROTECTED]>
+
+ * settrans.c (options): New option `--disconnect'.
+ (parse_opt): Add FSYS_GOAWAY_DISCONNECT to GOAWAY_FLAGS if
+ `--disconnect' is specified.
+
2001-03-31 Roland McGrath <[EMAIL PROTECTED]>
* pids.h: Fix obsolescent #endif syntax.
Index: utils/settrans.c
===================================================================
RCS file: /home/neal/shared/CVS/hurd/utils/settrans.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 settrans.c
--- utils/settrans.c 2001/04/19 12:42:52 1.1.1.1
+++ utils/settrans.c 2001/05/11 14:47:28
@@ -59,6 +59,8 @@
{"recursive", 'R', 0, 0, "Shutdown its children too"},
{"force", 'f', 0, 0, "If it doesn't want to die, force it"},
{"nosync", 'S', 0, 0, "Don't sync it before killing it"},
+ {"disconnect", 'd', 0, 0, "Disconnect the translator from the filesystem "
+ "(do not ask it to go away)"},
{0, 0}
};
@@ -91,7 +93,8 @@
int goaway_flags = 0;
/* Various option flags. */
- int passive = 0, active = 0, keep_active = 0, pause = 0, kill_active = 0;
+ int passive = 0, active = 0, keep_active = 0, pause = 0, kill_active = 0,
+ disconnect = 0;
int excl = 0;
int timeout = DEFAULT_TIMEOUT * 1000; /* ms */
@@ -130,6 +133,7 @@
case 'R': goaway_flags |= FSYS_GOAWAY_RECURSE; break;
case 'S': goaway_flags |= FSYS_GOAWAY_NOSYNC; break;
case 'f': goaway_flags |= FSYS_GOAWAY_FORCE; break;
+ case 'd': goaway_flags |= FSYS_GOAWAY_DISCONNECT; break;
/* Use atof so the user can specifiy fractional timeouts. */
case 't': timeout = atof (arg) * 1000.0; break;
PGP signature