aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/priv.h')
-rw-r--r--libdiskfs/priv.h68
1 files changed, 44 insertions, 24 deletions
diff --git a/libdiskfs/priv.h b/libdiskfs/priv.h
index 0f14ca3a..07464d56 100644
--- a/libdiskfs/priv.h
+++ b/libdiskfs/priv.h
@@ -1,5 +1,7 @@
/* Private declarations for fileserver library
- Copyright (C) 1994, 1995, 1996 Free Software Foundation
+
+ Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2006, 2009 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
@@ -20,18 +22,51 @@
#include <mach.h>
#include <hurd.h>
+#include <sys/mman.h>
#include <hurd/ports.h>
#include <hurd/fshelp.h>
#include <hurd/iohelp.h>
+#include <hurd/port.h>
#include <assert.h>
+#include <argp.h>
#include "diskfs.h"
-extern mach_port_t fs_control_port; /* receive right */
+/* These inhibit setuid or exec. */
+extern int _diskfs_nosuid, _diskfs_noexec;
+
+/* This relaxes the requirement to set `st_atim'. */
+extern int _diskfs_noatime;
+
+/* This enables SysV style group behaviour. New nodes inherit the GID
+ of the user creating them unless the SGID bit is set of the parent
+ directory. */
+extern int _diskfs_no_inherit_dir_group;
+
+/* This is the -C argument value. */
+extern char *_diskfs_chroot_directory;
+
+/* If --boot-command is given, this points to the program and args. */
+extern char **_diskfs_boot_command;
+
+/* Port cell holding a cached port to the exec server. */
+extern struct hurd_port _diskfs_exec_portcell;
volatile struct mapped_time_value *_diskfs_mtime;
-extern struct argp_option diskfs_common_options[];
+extern const struct argp_option diskfs_common_options[];
+/* Option keys for long-only options in diskfs_common_options. */
+#define OPT_SUID_OK 600 /* --suid-ok */
+#define OPT_EXEC_OK 601 /* --exec-ok */
+#define OPT_ATIME 602 /* --atime */
+#define OPT_NO_INHERIT_DIR_GROUP 603 /* --no-inherit-dir-group */
+#define OPT_INHERIT_DIR_GROUP 604 /* --inherit-dir-group */
+
+/* Common value for diskfs_common_options and diskfs_default_sync_interval. */
+#define DEFAULT_SYNC_INTERVAL 5
+#define DEFAULT_SYNC_INTERVAL_STRING STRINGIFY(DEFAULT_SYNC_INTERVAL)
+#define STRINGIFY(x) STRINGIFY_1(x)
+#define STRINGIFY_1(x) #x
/* Diskfs thinks the disk is dirty if this is set. */
extern int _diskfs_diskdirty;
@@ -39,25 +74,6 @@ extern int _diskfs_diskdirty;
/* Needed for MiG. */
typedef struct protid *protid_t;
-/* Called by MiG to translate ports into struct protid *.
- fsmutations.h arranges for this to happen for the io and
- fs interfaces. */
-extern inline struct protid *
-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. */
-extern inline void
-end_using_protid_port (struct protid *cred)
-{
- if (cred)
- ports_port_deref (cred);
-}
-
/* Actually read or write a file. The file size must already permit
the requested access. NP is the file to read/write. DATA is a buffer
to write from or fill on read. OFFSET is the absolute address (-1
@@ -72,6 +88,9 @@ error_t _diskfs_rdwr_internal (struct node *np, char *data, off_t offset,
and auth ports). */
void _diskfs_init_completed (void);
+/* Called in a bootstrap filesystem only, to get the privileged ports. */
+void _diskfs_boot_privports (void);
+
/* Clean routine for control port. */
void _diskfs_control_clean (void *);
@@ -97,7 +116,7 @@ extern fshelp_fetch_root_callback2_t _diskfs_translator_callback2;
if (!(PROTID)) \
return EOPNOTSUPP; \
\
- if (diskfs_readonly) \
+ if (diskfs_check_readonly ()) \
return EROFS; \
\
np = (PROTID)->po->np; \
@@ -114,6 +133,7 @@ extern fshelp_fetch_root_callback2_t _diskfs_translator_callback2;
#define HONORED_STATE_MODES (O_APPEND|O_ASYNC|O_FSYNC|O_NONBLOCK|O_NOATIME)
/* Bits that are turned off after open */
-#define OPENONLY_STATE_MODES (O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS|O_NONBLOCK)
+#define OPENONLY_STATE_MODES \
+ (O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS|O_NONBLOCK|O_EXLOCK|O_SHLOCK)
#endif