summaryrefslogtreecommitdiff
path: root/libdiskfs/diskfs.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-05-06 00:49:54 +0000
committerRoland McGrath <roland@gnu.org>2001-05-06 00:49:54 +0000
commitaede167cfb66c3c95742f7c3821643591040a56d (patch)
treee83e78ea4051e36dfad97910368643e2459f91a3 /libdiskfs/diskfs.h
parent5b097e8086fde7387f255cb9504c1027e9ff85d2 (diff)
2001-04-22 Neal H Walfield <neal@cs.uml.edu>
* Makefile (OTHERSRCS): Add extern-inline.c. * diskfs.h (DISKFS_EXTERN_INLINE): New macro. (diskfs_spawn_first_thread): Update prototype to include the additional parameter, a demuxer. (diskfs_begin_using_protid_port): Moved and renamed function begin_using_protid_port from priv.h. (diskfs_end_using_protid_port): Moved and renamed function end_using_protid_port from priv.h. * extern-inline.c: New file. * fsmutations.h (FILE_INTRAN): Use new function name. (FILE_DESTRUCTOR): Likewise. (IO_INTRAN): Likewise. (IO_DESTRUCTOR): Likewise. * init-first.c: Include <hurd/ports.h>. (master_thread_function): Unnamed parameter is now the demuxer. Use that rather than diskfs_demuxer directly. (diskfs_spawn_first_thread): New parameter DEMUXER. * init-main.c (diskfs_init_main): Pass diskfs_demuxer to diskfs_spawn_first_thread to conform to new semantics. * priv.h (begin_using_protid_port): Moved to diskfs.h. (end_using_protid_port): Likewise.
Diffstat (limited to 'libdiskfs/diskfs.h')
-rw-r--r--libdiskfs/diskfs.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index fda0f9c6..c067f576 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -1,5 +1,5 @@
/* Definitions for fileserver helper functions
- Copyright (C) 1994, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1994,95,96,97,98,99,2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -26,6 +26,10 @@
#include <hurd/iohelp.h>
#include <idvec.h>
+#ifndef DISKFS_EXTERN_INLINE
+#define DISKFS_EXTERN_INLINE extern inline
+#endif
+
/* Each user port referring to a file points to one of these
(with the aid of the ports library). */
struct protid
@@ -560,8 +564,9 @@ mach_port_t diskfs_startup_diskfs (mach_port_t bootstrap, int flags);
/* Call this after all format-specific initialization is done (except
for setting diskfs_root_node); at this point the pagers should be
- ready to go. */
-void diskfs_spawn_first_thread (void);
+ ready to go. DEMUXER is the demuxer to user. Normally, this is
+ just diskfs_demuxer. */
+void diskfs_spawn_first_thread (ports_demuxer_type demuxer);
/* Once diskfs_root_node is set, call this if we are a bootstrap
filesystem. If you call this, then the library will call
@@ -762,6 +767,25 @@ error_t diskfs_start_protid (struct peropen *po, struct protid **cred);
the user to install is USER. */
void diskfs_finish_protid (struct protid *cred, struct iouser *user);
+/* Called by MiG to translate ports into struct protid *.
+ fsmutations.h arranges for this to happen for the io and
+ fs interfaces. */
+DISKFS_EXTERN_INLINE struct protid *
+diskfs_begin_using_protid_port (file_t port)
+{
+ return ports_lookup_port (diskfs_port_bucket, port, diskfs_protid_class);
+}
+
+/* Called by MiG after server routines have been run; this
+ balances begin_using_protid_port, and is arranged for the io
+ and fs interfaces by fsmutations.h. */
+DISKFS_EXTERN_INLINE void
+diskfs_end_using_protid_port (struct protid *cred)
+{
+ if (cred)
+ ports_port_deref (cred);
+}
+
/* Create and return a new peropen structure on node NP with open
flags FLAGS. The initial values for the root_parent, shadow_root, and
shadow_root_parent fields are copied from CONTEXT if it's non-zero,