[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/17] libdiskfs: add fsys_get_source
From: |
Justus Winter |
Subject: |
[PATCH 11/17] libdiskfs: add fsys_get_source |
Date: |
Fri, 19 Jul 2013 17:25:13 +0200 |
---
libdiskfs/Makefile | 4 ++--
libdiskfs/diskfs.h | 6 ++++++
libdiskfs/fsys-get-source.c | 35 +++++++++++++++++++++++++++++++++++
libdiskfs/get-source.c | 29 +++++++++++++++++++++++++++++
4 files changed, 72 insertions(+), 2 deletions(-)
create mode 100644 libdiskfs/fsys-get-source.c
create mode 100644 libdiskfs/get-source.c
diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile
index 1a0edd0..03c2e2b 100644
--- a/libdiskfs/Makefile
+++ b/libdiskfs/Makefile
@@ -35,7 +35,7 @@ IOSRCS= io-async-icky.c io-async.c io-duplicate.c
io-get-conch.c io-revoke.c \
io-select.c io-stat.c io-stubs.c io-write.c io-version.c io-sigio.c
FSYSSRCS=fsys-getroot.c fsys-goaway.c fsys-startup.c fsys-getfile.c \
fsys-options.c fsys-syncfs.c fsys-forward.c \
- fsys-get-children.c
+ fsys-get-children.c fsys-get-source.c
IFSOCKSRCS=ifsock.c
OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \
extern-inline.c \
@@ -52,7 +52,7 @@ OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c
dir-renamed.c \
remount.c console.c disk-pager.c \
name-cache.c direnter.c dirrewrite.c dirremove.c lookup.c dead-name.c \
validate-mode.c validate-group.c validate-author.c validate-flags.c \
- validate-rdev.c validate-owner.c extra-version.c
+ validate-rdev.c validate-owner.c extra-version.c get-source.c
SRCS = $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS)
installhdrs = diskfs.h diskfs-pager.h
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 2489517..6466987 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -567,6 +567,12 @@ error_t (*diskfs_create_symlink_hook)(struct node *np,
const char *target);
isn't set, then the normal method (reading from the file data) is
used. If it returns any other error, it is returned to the user. */
error_t (*diskfs_read_symlink_hook)(struct node *np, char *target);
+
+/* 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 diskfs_get_source (char *source);
/* The library exports the following functions for general use */
diff --git a/libdiskfs/fsys-get-source.c b/libdiskfs/fsys-get-source.c
new file mode 100644
index 0000000..e7e0e78
--- /dev/null
+++ b/libdiskfs/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
+diskfs_S_fsys_get_source (mach_port_t server,
+ mach_port_t reply,
+ mach_msg_type_name_t replyPoly,
+ char *source)
+{
+ return diskfs_get_source (source);
+}
diff --git a/libdiskfs/get-source.c b/libdiskfs/get-source.c
new file mode 100644
index 0000000..bad6ff1
--- /dev/null
+++ b/libdiskfs/get-source.c
@@ -0,0 +1,29 @@
+/* Default version of diskfs_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
+diskfs_get_source (char *source)
+{
+ return EOPNOTSUPP;
+}
--
1.7.10.4
- Re: [PATCH 07/17] libnetfs: add fsys_get_children, (continued)
- [PATCH 09/17] trans/symlink.c: add fsys_get_children, Justus Winter, 2013/07/19
- [PATCH 17/17] add mtab prototype, Justus Winter, 2013/07/19
- Re: [PATCH 17/17] add mtab prototype, Neal H. Walfield, 2013/07/22
- Re: [PATCH 17/17] add mtab prototype, Samuel Thibault, 2013/07/22
- [PATCH 10/17] hurd: add fsys_get_children, Justus Winter, 2013/07/19
- [PATCH 13/17] libtrivfs: add fsys_get_source, Justus Winter, 2013/07/19
- [PATCH 12/17] libnetfs: add fsys_get_source, Justus Winter, 2013/07/19
- [PATCH 11/17] libdiskfs: add fsys_get_source,
Justus Winter <=
- [PATCH 15/17] hurd: add fsys_get_source, Justus Winter, 2013/07/19
- Re: [PATCH 15/17] hurd: add fsys_get_source, Neal H. Walfield, 2013/07/22
- [PATCH 16/17] XXX this looks wrong to me, please have a look, Justus Winter, 2013/07/19
- [PATCH 14/17] trans/symlink.c: add fsys_get_source, Justus Winter, 2013/07/19
- Re: feature-mtab-translator (v3), Richard Braun, 2013/07/19
- Re: feature-mtab-translator (v3), Justus Winter, 2013/07/19
- Re: feature-mtab-translator (v3), Neal H. Walfield, 2013/07/22
- Re: feature-mtab-translator (v3), Neal H. Walfield, 2013/07/22
- Re: feature-mtab-translator (v3), Neal H. Walfield, 2013/07/22
- Re: feature-mtab-translator (v3), Samuel Thibault, 2013/07/22