>From e34df048e3ece0703cbf2fcc4fb2368692b2b1f2 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov <unlimitedscol...@gmail.com> Date: Thu, 28 May 2009 21:33:47 +0300 Subject: [PATCH] Make unionmount always include the underlying node.
* main.c (main): Add the code for always registering the underlying node among the merged filesystems. Update copyright years and comments. * netfs.c (netfs_append_args): Remove the code which adds the name of the ``--underlying'' option to the command line string. Update copyright years and comments. * options.c (argp_common_options): Remove the UNDERLYING command line option. (argp_parse_common_options): Remove the handling of OPT_UNDERLYING flag. Update copyright years and comments. * options.h: Remove definitions of OPT_UNDERLYING and OPT_LONG_UNDERLYING. Update copyright years and comments. --- main.c | 10 +++++++++- netfs.c | 9 +++++---- options.c | 8 ++++---- options.h | 7 ++++--- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/main.c b/main.c index c33b065..8bde8be 100644 --- a/main.c +++ b/main.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 <mor...@duesseldorf.ccc.de>. + Extended by Sergiu Ivanov <unlimitedscol...@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 @@ -77,6 +80,9 @@ main (int argc, char **argv) /* Argument parsing. */ argp_parse (&argp_startup, argc, argv, ARGP_IN_ORDER, 0, 0); + /* Register the underlying node in the ulfs list. */ + ulfs_register (NULL, 0, 0); + err = node_create_root (&netfs_root_node); if (err) error (EXIT_FAILURE, err, "failed to create root node"); @@ -90,6 +96,8 @@ main (int argc, char **argv) if (err) error (EXIT_FAILURE, err, "failed to initialize root node"); + ulfs_check (); + /* Map the time, used for updating node information. */ err = maptime_map (0, 0, &maptime); if (err) diff --git a/netfs.c b/netfs.c index 89d1bf6..f2997aa 100644 --- a/netfs.c +++ b/netfs.c @@ -1,7 +1,11 @@ /* Hurd unionfs - Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software + Foundation, Inc. + Written by Moritz Schulte <mor...@duesseldorf.ccc.de>. + Extended by Sergiu Ivanov <unlimitedscol...@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 @@ -71,9 +75,6 @@ netfs_append_args (char **argz, size_t *argz_len) { if (ulfs->path) err = argz_add (argz, argz_len, ulfs->path); - else - err = argz_add (argz, argz_len, - OPT_LONG (OPT_LONG_UNDERLYING)); } } diff --git a/options.c b/options.c index ef29a02..31a2608 100644 --- a/options.c +++ b/options.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 <mor...@duesseldorf.ccc.de>. + Extended by Sergiu Ivanov <unlimitedscol...@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 @@ -43,8 +46,6 @@ static int parsing_startup_options_finished; /* Argp options common to the runtime and startup parser. */ static const struct argp_option argp_common_options[] = { - { OPT_LONG_UNDERLYING, OPT_UNDERLYING, 0, 0, - "add the underlying node to the unionfs" }, { OPT_LONG_WRITABLE, OPT_WRITABLE, 0, 0, "specify the following filesystem as writable" }, { OPT_LONG_DEBUG, OPT_DEBUG, 0, OPTION_HIDDEN, @@ -124,7 +125,6 @@ argp_parse_common_options (int key, char *arg, struct argp_state *state) ulfs_match = 0; break; - case OPT_UNDERLYING: /* --underlying */ case ARGP_KEY_ARG: if (ulfs_mode == ULFS_MODE_REMOVE) diff --git a/options.h b/options.h index eb74ce6..0229556 100644 --- a/options.h +++ b/options.h @@ -1,7 +1,10 @@ /* Hurd unionfs - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc. + Written by Moritz Schulte <mor...@duesseldorf.ccc.de>. + Extended by Sergiu Ivanov <unlimitedscol...@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 @@ -20,7 +23,6 @@ /* Argument parsing. */ /* The possible short options. */ -#define OPT_UNDERLYING 'u' #define OPT_WRITABLE 'w' #define OPT_DEBUG 'd' #define OPT_CACHE_SIZE 'c' @@ -31,7 +33,6 @@ #define OPT_STOW 's' /* The long options. */ -#define OPT_LONG_UNDERLYING "underlying" #define OPT_LONG_WRITABLE "writable" #define OPT_LONG_DEBUG "debug" #define OPT_LONG_CACHE_SIZE "cache-size" -- 1.5.2.4