bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 13/16] libtrivfs: add fsys_get_source


From: Justus Winter
Subject: [PATCH 13/16] libtrivfs: add fsys_get_source
Date: Tue, 30 Jul 2013 11:59:21 +0200

* libtrivfs/Makefile: Add fsys-get-source.c and get-source.c
* libtrivfs/trivfs.h: Add trivfs_get_source.
* libtrivfs/fsys-get-source.c: New file.
* libtrivfs/get-source.c: Likewise.
---
 libtrivfs/Makefile          |    4 ++--
 libtrivfs/fsys-get-source.c |   33 +++++++++++++++++++++++++++++++++
 libtrivfs/get-source.c      |   28 ++++++++++++++++++++++++++++
 libtrivfs/trivfs.h          |    8 +++++++-
 4 files changed, 70 insertions(+), 3 deletions(-)
 create mode 100644 libtrivfs/fsys-get-source.c
 create mode 100644 libtrivfs/get-source.c

diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile
index 3163777..241b76d 100644
--- a/libtrivfs/Makefile
+++ b/libtrivfs/Makefile
@@ -25,7 +25,7 @@ FSSRCS= dir-link.c dir-mkdir.c dir-mkfile.c dir-lookup.c 
dir-readdir.c \
        file-getlinknode.c file-lock.c file-set-trans.c file-statfs.c \
        file-sync.c file-syncfs.c file-set-size.c file-utimes.c file-exec.c \
        file-access.c dir-chg.c file-chg.c file-get-storage-info.c \
-       file-get-fs-options.c file-reparent.c
+       file-get-fs-options.c file-reparent.c get-source.c
 
 IOSRCS=io-async-icky.c io-async.c io-duplicate.c io-map.c io-modes-get.c \
        io-modes-off.c io-modes-on.c io-modes-set.c io-owner-get.c \
@@ -35,7 +35,7 @@ IOSRCS=io-async-icky.c io-async.c io-duplicate.c io-map.c 
io-modes-get.c \
 
 FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-stubs.c fsys-syncfs.c \
        fsys-forward.c fsys-set-options.c fsys-get-options.c \
-       fsys-get-children.c
+       fsys-get-children.c fsys-get-source.c
 
 OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \
        cntl-clean.c migsupport.c times.c startup.c open.c \
diff --git a/libtrivfs/fsys-get-source.c b/libtrivfs/fsys-get-source.c
new file mode 100644
index 0000000..64aec2f
--- /dev/null
+++ b/libtrivfs/fsys-get-source.c
@@ -0,0 +1,33 @@
+/* fsys_get_source
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   Written by Justus Winter <4winter@informatik.uni-hamburg.de>
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd 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, or (at your option)
+   any later version.
+
+   The GNU Hurd 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 the GNU Hurd.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "priv.h"
+
+/* Return information about the source of the receiving
+   filesystem. */
+error_t
+trivfs_S_fsys_get_source (trivfs_control_t server,
+                         mach_port_t reply,
+                         mach_msg_type_name_t replyPoly,
+                         char *source)
+{
+  return trivfs_get_source (source);
+}
diff --git a/libtrivfs/get-source.c b/libtrivfs/get-source.c
new file mode 100644
index 0000000..9ea5693
--- /dev/null
+++ b/libtrivfs/get-source.c
@@ -0,0 +1,28 @@
+/* Default version of trivfs_get_source
+
+   Copyright (C) 2013 Free Software Foundation, Inc.
+
+   Written by Justus Winter <4winter@informatik.uni-hamburg.de>
+
+   This file is part of the GNU Hurd.
+
+   The GNU Hurd 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, or (at
+   your option) any later version.
+
+   The GNU Hurd 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 the GNU Hurd.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include "priv.h"
+
+error_t
+trivfs_get_source (char *source)
+{
+  return EOPNOTSUPP;
+}
diff --git a/libtrivfs/trivfs.h b/libtrivfs/trivfs.h
index 33b0436..cf817b5 100644
--- a/libtrivfs/trivfs.h
+++ b/libtrivfs/trivfs.h
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1994,95,96,97,99,2002 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,99,2002,13 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
@@ -233,6 +233,12 @@ error_t trivfs_set_options (struct trivfs_control *fsys,
    routine simply calls diskfs_append_std_options.  */
 error_t trivfs_append_args (struct trivfs_control *fsys,
                            char **argz, size_t *argz_len);
+
+/* The user may define this function.  The function must set source to
+   the source device of the filesystem. The function may return an
+   EOPNOTSUPP to indicate that the concept of a source device is not
+   applicable. The default function always returns EOPNOTSUPP. */
+error_t trivfs_get_source (char *source);
 
 /* Add the port class *CLASS to the list of control port classes recognized
    by trivfs; if *CLASS is 0, an attempt is made to allocate a new port
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]