bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 12/16] libnetfs: add fsys_get_source


From: Justus Winter
Subject: [PATCH 12/16] libnetfs: add fsys_get_source
Date: Tue, 30 Jul 2013 11:59:20 +0200

Add a user overridable function netfs_get_source with a default
implementation returning EOPNOTSUPP. Add a server function for
fsys-get-source.

* libnetfs/Makefile: Add fsys-get-source.c and get-source.c
* libnetfs/netfs.h: Add netfs_get_source.
* libnetfs/fsys-get-source.c: New file.
* libnetfs/get-source.c: Likewise.
---
 libnetfs/Makefile          |    5 +++--
 libnetfs/fsys-get-source.c |   34 ++++++++++++++++++++++++++++++++++
 libnetfs/get-source.c      |   28 ++++++++++++++++++++++++++++
 libnetfs/netfs.h           |    8 +++++++-
 4 files changed, 72 insertions(+), 3 deletions(-)
 create mode 100644 libnetfs/fsys-get-source.c
 create mode 100644 libnetfs/get-source.c

diff --git a/libnetfs/Makefile b/libnetfs/Makefile
index f456740..1a71b49 100644
--- a/libnetfs/Makefile
+++ b/libnetfs/Makefile
@@ -34,7 +34,8 @@ FSSRCS= dir-link.c dir-lookup.c dir-mkdir.c dir-mkfile.c \
        file-get-translator.c file-getcontrol.c file-getlinknode.c \
        file-lock-stat.c file-lock.c file-set-size.c \
        file-set-translator.c file-statfs.c file-sync.c file-syncfs.c \
-       file-utimes.c file-reparent.c fsstubs.c file-get-transcntl.c
+       file-utimes.c file-reparent.c fsstubs.c file-get-transcntl.c \
+       get-source.c
 
 IOSRCS=        io-read.c io-readable.c io-seek.c io-write.c io-stat.c 
io-async.c     \
        io-set-all-openmodes.c io-get-openmodes.c io-set-some-openmodes.c     \
@@ -44,7 +45,7 @@ IOSRCS=       io-read.c io-readable.c io-seek.c io-write.c 
io-stat.c io-async.c     \
        io-version.c
 
 FSYSSRCS= fsys-syncfs.c fsys-getroot.c fsys-get-options.c fsys-set-options.c \
-       fsys-goaway.c fsysstubs.c fsys-get-children.c
+       fsys-goaway.c fsysstubs.c fsys-get-children.c fsys-get-source.c
 
 IFSOCKSRCS=
 OTHERSRCS= drop-node.c init-init.c make-node.c make-peropen.c make-protid.c   \
diff --git a/libnetfs/fsys-get-source.c b/libnetfs/fsys-get-source.c
new file mode 100644
index 0000000..6143d10
--- /dev/null
+++ b/libnetfs/fsys-get-source.c
@@ -0,0 +1,34 @@
+/* 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"
+#include "fsys_S.h"
+
+/* Return information about the source of the receiving
+   filesystem.  */
+error_t
+netfs_S_fsys_get_source (fsys_t server,
+                        mach_port_t reply,
+                        mach_msg_type_name_t replyPoly,
+                        char *source)
+{
+  return netfs_get_source (source);
+}
diff --git a/libnetfs/get-source.c b/libnetfs/get-source.c
new file mode 100644
index 0000000..71a9639
--- /dev/null
+++ b/libnetfs/get-source.c
@@ -0,0 +1,28 @@
+/* Default version of netfs_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
+netfs_get_source (char *source)
+{
+  return EOPNOTSUPP;
+}
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index 2b9454a..e10ccae 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -1,6 +1,6 @@
 /*
 
-   Copyright (C) 1994,95,96,97,99,2000,02 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,99,2000,02,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
@@ -313,6 +313,12 @@ error_t netfs_file_get_storage_info (struct iouser *cred,
                                     mach_msg_type_number_t *num_offsets,
                                     char **data,
                                     mach_msg_type_number_t *data_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 netfs_get_source (char *source);
 
 /* Option parsing */
 
-- 
1.7.10.4




reply via email to

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