summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-07-30 11:59:20 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-09-15 23:19:45 +0200
commit3a5bcbcc94f01b1ef1ed0571b31434ed57162224 (patch)
tree19bf83ce545ce57f1b1cb7a00b4373f78f377f67 /libnetfs
parent70b1ab5dbb8d7d1cf63ab170e0a96a03c6dd363c (diff)
libnetfs: add fsys_get_source
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.
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/Makefile5
-rw-r--r--libnetfs/fsys-get-source.c34
-rw-r--r--libnetfs/get-source.c28
-rw-r--r--libnetfs/netfs.h8
4 files changed, 72 insertions, 3 deletions
diff --git a/libnetfs/Makefile b/libnetfs/Makefile
index f4567408..1a71b499 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 00000000..6143d10b
--- /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 00000000..71a96390
--- /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 2b9454a9..e10ccae0 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 */