From eb9c9ab8718da822705ac5c93ae7b2f17d000c16 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 18 Aug 2009 11:10:48 +0200 Subject: Import the current [hurd]/hurd/fsys.defs. --- hurd/interface/fsys/00.mdwn | 23 +++++++++++++++++++++++ hurd/interface/fsys/01.mdwn | 19 +++++++++++++++++++ hurd/interface/fsys/02.mdwn | 33 +++++++++++++++++++++++++++++++++ hurd/interface/fsys/03.mdwn | 22 ++++++++++++++++++++++ hurd/interface/fsys/04.mdwn | 20 ++++++++++++++++++++ hurd/interface/fsys/05.mdwn | 20 ++++++++++++++++++++ hurd/interface/fsys/06.mdwn | 20 ++++++++++++++++++++ hurd/interface/fsys/07.mdwn | 19 +++++++++++++++++++ hurd/interface/fsys/08.mdwn | 23 +++++++++++++++++++++++ hurd/interface/fsys/09.mdwn | 19 +++++++++++++++++++ 10 files changed, 218 insertions(+) create mode 100644 hurd/interface/fsys/00.mdwn create mode 100644 hurd/interface/fsys/01.mdwn create mode 100644 hurd/interface/fsys/02.mdwn create mode 100644 hurd/interface/fsys/03.mdwn create mode 100644 hurd/interface/fsys/04.mdwn create mode 100644 hurd/interface/fsys/05.mdwn create mode 100644 hurd/interface/fsys/06.mdwn create mode 100644 hurd/interface/fsys/07.mdwn create mode 100644 hurd/interface/fsys/08.mdwn create mode 100644 hurd/interface/fsys/09.mdwn (limited to 'hurd/interface/fsys') diff --git a/hurd/interface/fsys/00.mdwn b/hurd/interface/fsys/00.mdwn new file mode 100644 index 00000000..68e0479e --- /dev/null +++ b/hurd/interface/fsys/00.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_startup"]] + + routine fsys_startup ( + bootstrap: mach_port_t; + RPT + openflags: int; + control_port: mach_port_send_t; + out realnode: mach_port_send_t); + +Sent by filesystem on its bootstrap port upon startup. `realnode` is the node +this filesystem is the translator for, opened with flags `flags` (`O_NOTRANS` +is assumed even if not provided). diff --git a/hurd/interface/fsys/01.mdwn b/hurd/interface/fsys/01.mdwn new file mode 100644 index 00000000..9cb95de5 --- /dev/null +++ b/hurd/interface/fsys/01.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_goaway"]] + + routine fsys_goaway ( + fsys: fsys_t; + RPT + flags: int); + +Filesystem should go away. Bye. diff --git a/hurd/interface/fsys/02.mdwn b/hurd/interface/fsys/02.mdwn new file mode 100644 index 00000000..63b84c48 --- /dev/null +++ b/hurd/interface/fsys/02.mdwn @@ -0,0 +1,33 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_getroot"]] + + routine fsys_getroot( + fsys: fsys_t; + RPT + #ifdef FSYS_GETROOT_UREPLY + ureplyport ureply: mig_reply_port_t; + #endif + dotdot_node: mach_port_send_t; + gen_uids: idarray_t; + gen_gids: idarray_t; + flags: int; + out do_retry: retry_type; + out retry_name: string_t; + out file: mach_port_send_t); + +Return a file to the root of the filesystem. `flags` are as for +[[`dir_lookup`|dir_lookup]] (but `O_CREAT` and `O_EXCL` are not meaningful). +`do_retry`, `retry_name`, and `result` are as for [[`dir_lookup`|dir_lookup]]. +The port should be authenticated with `gen_uids` and `gen_gids` (except, of +course, for `FS_RETRY_REAUTH` and `FS_RETRY_MAGICAL). `dotdot_node` is an +unauthenticated port for the directory in which this root is located. diff --git a/hurd/interface/fsys/03.mdwn b/hurd/interface/fsys/03.mdwn new file mode 100644 index 00000000..b0c033c2 --- /dev/null +++ b/hurd/interface/fsys/03.mdwn @@ -0,0 +1,22 @@ +[[!meta copyright="Copyright © 1992, 1993, 1994, 1995, 1996, 1997, 2002, 2009 +Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_getfile"]] + + routine fsys_getfile ( + fsys: fsys_t; + RPT + gen_uids: idarray_t; + gen_gids: idarray_t; + filehandle: data_t; + out file: mach_port_send_t); + +Get a file given a file handle (see [[`file_getfh`|file_getfh]]). diff --git a/hurd/interface/fsys/04.mdwn b/hurd/interface/fsys/04.mdwn new file mode 100644 index 00000000..0ef242f9 --- /dev/null +++ b/hurd/interface/fsys/04.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_syncfs"]] + + routine fsys_syncfs ( + fsys: fsys_t; + RPT + wait: int; + do_children: int); + +Sync a filesystem. Args are the same as for [[`file_syncfs`|file_syncfs]] in +[[`fs.defs`|fs]]. diff --git a/hurd/interface/fsys/05.mdwn b/hurd/interface/fsys/05.mdwn new file mode 100644 index 00000000..5caf6b17 --- /dev/null +++ b/hurd/interface/fsys/05.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_set_options"]] + + routine fsys_set_options ( + fsys: fsys_t; + RPT + options: data_t; + do_children: int); + +Pass a server-specific options string. This usually includes flags similar to +command line options, e.g., `--readonly`, or `--sync=30`. diff --git a/hurd/interface/fsys/06.mdwn b/hurd/interface/fsys/06.mdwn new file mode 100644 index 00000000..c8ccbed8 --- /dev/null +++ b/hurd/interface/fsys/06.mdwn @@ -0,0 +1,20 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_getpriv"]] + + routine fsys_getpriv ( + fsys: fsys_t; + RPT + out host_priv: mach_port_send_t; + out device_master: mach_port_send_t; + out fstask: mach_port_send_t); + +This is only implemented by bootstrap filesystems. diff --git a/hurd/interface/fsys/07.mdwn b/hurd/interface/fsys/07.mdwn new file mode 100644 index 00000000..4700416d --- /dev/null +++ b/hurd/interface/fsys/07.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_init"]] + + routine fsys_init ( + fsys: fsys_t; + sreplyport reply_port: sreply_port_t; + proc_server: mach_port_send_t; + auth_handle: auth_t); + +This is only implemented by bootstrap filesystems. diff --git a/hurd/interface/fsys/08.mdwn b/hurd/interface/fsys/08.mdwn new file mode 100644 index 00000000..42ac277d --- /dev/null +++ b/hurd/interface/fsys/08.mdwn @@ -0,0 +1,23 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_forward"]] + + routine fsys_forward ( + server: mach_port_t; + RPT + requestor: mach_port_send_t; + argv: data_t); + +Ask `server` to provide [[`fsys`|fsys]] translation service for us. +`requestor` is the bootstrap port supplied to the original translator, and +`argv` are the command line arguments. If the recipient accepts the request, +he (or some delegate) should send [[`fsys_startup`|fsys_startup]] to +`requestor` to start the filesystem up. diff --git a/hurd/interface/fsys/09.mdwn b/hurd/interface/fsys/09.mdwn new file mode 100644 index 00000000..fa5c4117 --- /dev/null +++ b/hurd/interface/fsys/09.mdwn @@ -0,0 +1,19 @@ +[[!meta copyright="Copyright © 2009 Free Software Foundation, Inc."]] + +[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable +id="license" text="Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no Invariant +Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license +is included in the section entitled [[GNU Free Documentation +License|/fdl]]."]]"""]] + +[[!meta title="fsys_get_options"]] + + routine fsys_get_options ( + server: fsys_t; + RPT + out options: data_t, dealloc); + +Return the options describing the operation of the receiving filesystem +(sutiable for [[`fsys_set_options`|fsys_set_options]]). -- cgit v1.2.3 From 508d432bd5e43b2af315b1a8a99fdb84c4bd294a Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 18 Aug 2009 15:51:49 +0200 Subject: Some examples gathered from Hurd sources. --- hurd/interface/fs/13.mdwn | 22 ++++++++++++++++++++++ hurd/interface/fs/14.mdwn | 29 +++++++++++++++++++++++++++++ hurd/interface/fsys/04.mdwn | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) (limited to 'hurd/interface/fsys') diff --git a/hurd/interface/fs/13.mdwn b/hurd/interface/fs/13.mdwn index 72ae0d06..2e06e0c4 100644 --- a/hurd/interface/fs/13.mdwn +++ b/hurd/interface/fs/13.mdwn @@ -21,6 +21,28 @@ Sync the individual file. If `omit_metadata` is set, then it is only necessary for the server to updated the actual contents of the file, not any associated metadata. +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/nfs]]. + +## [[libtrivfs]] + +Pass the call through to the underlying node. + +### [[storeio]] / [[streamio]] + +Instead of to the underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_sync`. + +## [[libdiskfs]] + +Invoke `diskfs_file_update`. + # Usage Examples ## [[glibc]] diff --git a/hurd/interface/fs/14.mdwn b/hurd/interface/fs/14.mdwn index 85d8a73a..c93613d8 100644 --- a/hurd/interface/fs/14.mdwn +++ b/hurd/interface/fs/14.mdwn @@ -19,6 +19,35 @@ License|/fdl]]."]]"""]] Sync the entire filesystem. +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/nfs]]. + +The implementation typically doesn't care on which specific node (as exported +by the implementing server) [[`file_syncfs`|file_syncfs]] is being invoked on. + +## [[libtrivfs]] + +Invoke [[`file_sync`|file_sync]] on the underlying node. Rationale: the +underlying node represents this filesystem's backend, and once this node is +synchronized, the whole [[libtrivfs]]-based filesystem is to be considered +synchronized. + +### [[storeio]] / [[streamio]] + +Instead of the to underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_syncfs`. + +## [[libdiskfs]] + +Invoke [[`fsys_syncfs`|fsys_syncfs]] on all active children, and invoke +`diskfs_sync_everything` and `diskfs_set_hypermetadata`. + # Usage Examples ## [[glibc]] diff --git a/hurd/interface/fsys/04.mdwn b/hurd/interface/fsys/04.mdwn index 0ef242f9..60d314c5 100644 --- a/hurd/interface/fsys/04.mdwn +++ b/hurd/interface/fsys/04.mdwn @@ -18,3 +18,38 @@ License|/fdl]]."]]"""]] Sync a filesystem. Args are the same as for [[`file_syncfs`|file_syncfs]] in [[`fs.defs`|fs]]. + +# Implementation Examples + +Servers that either don't keep any unsynchronized state (or don't have a +backing store at all) can simply `return 0`. Examples: [[translator/symlink]], +[[translator/nfs]]. + +## [[libtrivfs]] + +Invoke [[`file_sync`|file_sync]] on the underlying node. Rationale: the +underlying node represents this filesystem's backend, and once this node is +synchronized, the whole [[libtrivfs]]-based filesystem is to be considered +synchronized. + +### [[storeio]] / [[streamio]] + +Instead of to the underlying node, pass the call through to the backend +(device). + +## [[libnetfs]] + +Invoke `netfs_attempt_syncfs`. + +## [[libdiskfs]] + +Invoke [[`fsys_syncfs`|fsys_syncfs]] on all active children, and invoke +`diskfs_sync_everything` and `diskfs_set_hypermetadata`. + +# Usage Examples + +## [[libdiskfs]] + +In the implementations of both [[`file_syncfs`|file_syncfs]] and +[[`fsys_syncfs`|fsys_syncfs]], [[`fsys_syncfs`|fsys_syncfs]] is invoked on all +active children. -- cgit v1.2.3 From 72d62837a27cfb4d425c53c88e4aeee4888b4d9c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 18 Aug 2009 15:58:14 +0200 Subject: Note the similarity of file_syncfs and fsys_syncfs. --- hurd/interface/fs/14.mdwn | 6 +++++- hurd/interface/fsys/04.mdwn | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'hurd/interface/fsys') diff --git a/hurd/interface/fs/14.mdwn b/hurd/interface/fs/14.mdwn index c93613d8..a13c0bd8 100644 --- a/hurd/interface/fs/14.mdwn +++ b/hurd/interface/fs/14.mdwn @@ -17,7 +17,11 @@ License|/fdl]]."]]"""]] wait: int; do_children: int); -Sync the entire filesystem. +Synchronize the entire filesystem. + +This function has a companion in [[`fsys_syncfs`|fsys_syncfs]], which is +invoked on the server's control port instead of an arbitrary node. Both of +them are usually implemented in equivalent ways. # Implementation Examples diff --git a/hurd/interface/fsys/04.mdwn b/hurd/interface/fsys/04.mdwn index 60d314c5..7b370d2b 100644 --- a/hurd/interface/fsys/04.mdwn +++ b/hurd/interface/fsys/04.mdwn @@ -16,8 +16,11 @@ License|/fdl]]."]]"""]] wait: int; do_children: int); -Sync a filesystem. Args are the same as for [[`file_syncfs`|file_syncfs]] in -[[`fs.defs`|fs]]. +Synchronize the entire filesystem. + +This function has a companion in [[`file_syncfs`|file_syncfs]], which is +invoked on an arbitrary node instead of the server's control port. Both of +them are usually implemented in equivalent ways. # Implementation Examples -- cgit v1.2.3