bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 12/17] libnetfs: add fsys_get_source


From: Justus Winter
Subject: [PATCH 12/17] libnetfs: add fsys_get_source
Date: Fri, 19 Jul 2013 17:25:14 +0200

---
 libnetfs/Makefile          |    5 +++--
 libnetfs/fsys-get-source.c |   35 +++++++++++++++++++++++++++++++++++
 libnetfs/get-source.c      |   28 ++++++++++++++++++++++++++++
 libnetfs/netfs.h           |    6 ++++++
 4 files changed, 72 insertions(+), 2 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 121689e..0d1fa7c 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..37bd0cc
--- /dev/null
+++ b/libnetfs/fsys-get-source.c
@@ -0,0 +1,35 @@
+/* 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; see the file COPYING.  If not, write to
+   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+#include "priv.h"
+#include "fsys_S.h"
+
+/* Return information about the source of the receiving
+   filesystem.  */
+error_t
+netfs_S_fsys_get_source (mach_port_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..68d5c89
--- /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 this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. */
+
+#include "priv.h"
+
+error_t
+netfs_get_source (char *source)
+{
+  return EOPNOTSUPP;
+}
diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h
index 2b9454a..7cd57ed 100644
--- a/libnetfs/netfs.h
+++ b/libnetfs/netfs.h
@@ -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]