summaryrefslogtreecommitdiff
path: root/ulfs.c
diff options
context:
space:
mode:
authorSergiu Ivanov <unlimitedscolobb@gmail.com>2009-07-05 15:26:58 +0300
committerSergiu Ivanov <unlimitedscolobb@gmail.com>2009-12-10 21:32:45 +0000
commit4db02de530ceb22a814ab6f53eda77c40de03fe7 (patch)
tree759b4287eaa92b2d63c4895f5c7209b184bb3ce4 /ulfs.c
parentd711d1eb2ac42911690a107f80e7fb5df09a4782 (diff)
Add the mountee to the list of merged filesystems.unionmount
* mount.c (start_mountee): Add the mountee's filesystem to the list of merged filesystems. * node.c (node_init_root): Take into consideration the fact that an empty string refers to the mountee root. * ulfs.c (ulfs_check): Likewise. (ulfs_register): Don't check whether "" is a valid directory.
Diffstat (limited to 'ulfs.c')
-rw-r--r--ulfs.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/ulfs.c b/ulfs.c
index 3c565a5..2626a90 100644
--- a/ulfs.c
+++ b/ulfs.c
@@ -1,7 +1,10 @@
/* Hurd unionfs
- Copyright (C) 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2005, 2009 Free Software Foundation, Inc.
+
Written by Moritz Schulte <moritz@duesseldorf.ccc.de>.
+ Adapted for unionmount by Sergiu Ivanov <unlimitedscolobb@gmail.com>.
+
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
@@ -31,6 +34,7 @@
#include "lib.h"
#include "ulfs.h"
+#include "mount.h"
/* The start of the ulfs chain. */
ulfs_t *ulfs_chain_start;
@@ -212,14 +216,16 @@ ulfs_for_each_under_priv (char *path_under,
return err;
}
-/* Register a new underlying filesystem. */
+/* Register a new underlying filesystem. A null path refers to the
+ underlying filesystem; a path equal to an empty string refers to
+ the filesystem of the mountee. */
error_t
ulfs_register (char *path, int flags, int priority)
{
ulfs_t *ulfs;
error_t err;
- if (path)
+ if (path && path[0])
{
err = check_dir (path);
if (err)
@@ -261,7 +267,12 @@ ulfs_check ()
{
if (u->path)
- p = file_name_lookup (u->path, O_READ | O_DIRECTORY, 0);
+ {
+ if (!u->path[0])
+ p = mountee_root;
+ else
+ p = file_name_lookup (u->path, O_READ | O_DIRECTORY, 0);
+ }
else
p = underlying_node;