summaryrefslogtreecommitdiff
path: root/unionfs/unionfs.h
diff options
context:
space:
mode:
authorroot <root@(null).(none)>2009-05-03 17:20:00 +0200
committerroot <root@(null).(none)>2009-05-03 17:20:00 +0200
commite0faf22f31c48fb27b43c1825897d26e58feafc4 (patch)
tree65a09372b31e08a3a865bd0a88cd2718bafcd643 /unionfs/unionfs.h
This is my initial working version.
There is a bug in boot in this version: subhurd sometimes cannot boot.
Diffstat (limited to 'unionfs/unionfs.h')
-rw-r--r--unionfs/unionfs.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/unionfs/unionfs.h b/unionfs/unionfs.h
new file mode 100644
index 00000000..8f5a0873
--- /dev/null
+++ b/unionfs/unionfs.h
@@ -0,0 +1,90 @@
+/* Hurd unionfs
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Written by Moritz Schulte <moritz@duesseldorf.ccc.de>.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or * (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA. */
+
+/* This unionfs knows about two different kind of nodes: `light nodes'
+ (in short: lnode) and `nodes' (or: netfs nodes) as used by
+ libnetfs. They have different tasks and therefore this division
+ makes sense.
+
+ lnodes form the filesystem tree as seen by the user; most
+ importantly they contain the `name' of the node.
+
+ lnodes are small and cheap, they are not cached (nodes are).
+
+ lnodes are usually created when a node is looked up and destroyed
+ when that node gets destroyed; but there are also reasons for
+ lnodes _not_ being destroyed.
+
+ The distinction makes it possible to keep certain information for
+ the unionfs in these lnodes while netfs nodes don't have to stay in
+ memory.
+
+ lnodes have to be looked up first before a node is looked up. Each
+ lnode contains a pointer to the netfs node, which might be NULL in
+ case the netfs node is not in memory anymore. */
+
+/* General information and properties for the unionfs. */
+
+#ifndef INCLUDED_UNIONFS_H
+#define INCLUDED_UNIONFS_H
+
+#include <hurd/netfs.h>
+#include <sys/types.h>
+
+#include "node.h"
+#include "lib.h"
+
+/* Default maximum number of nodes in the cache. */
+#define NCACHE_SIZE 256
+
+/* The inode for the root node. */
+#define UNIONFS_ROOT_INODE 1
+
+/* Flags for UNIONFS_FLAGS. */
+
+/* Print debugging messages to stderr. */
+#define FLAG_UNIONFS_MODE_DEBUG 0x00000001
+/* Use copy-on-write. */
+#define FLAG_UNIONFS_MODE_COW 0x00000002
+
+/* Flags describing certain properties of the unionfs. */
+extern int unionfs_flags;
+
+/* The filesystem id (the pid). */
+extern pid_t fsid;
+
+/* Mapped time, used for updating node information. */
+extern volatile struct mapped_time_value *maptime;
+
+/* A port to the underlying node. */
+extern mach_port_t underlying_node;
+
+/* stat information for the underlying node. */
+extern struct stat underlying_node_stat;
+
+/* Send a debugging message, if unionfs is in debugging mode. */
+#define debug_msg(fmt, args...) \
+ do \
+ { \
+ if (unionfs_flags & FLAG_UNIONFS_MODE_DEBUG) \
+ debug_msg_send (fmt , ## args); \
+ } \
+ while (0)
+
+#endif