[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 28/70: libnetfs: implement file_get_translator_cntl
From: |
Samuel Thibault |
Subject: |
[hurd] 28/70: libnetfs: implement file_get_translator_cntl |
Date: |
Mon, 16 Sep 2013 07:41:39 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 9bb6c17f3f0e2793ef75339f48425b0ec802c2a3
Author: Justus Winter <address@hidden>
Date: Tue Jul 30 11:59:09 2013 +0200
libnetfs: implement file_get_translator_cntl
This is a trivially adapted version of libdiskfs/file-get-transcntl.c.
* libnetfs/file-get-transcntl.c: New file.
---
libnetfs/Makefile | 2 +-
libnetfs/file-get-transcntl.c | 52 +++++++++++++++++++++++++++++++++++++++++
libnetfs/fsstubs.c | 8 -------
3 files changed, 53 insertions(+), 9 deletions(-)
diff --git a/libnetfs/Makefile b/libnetfs/Makefile
index 24b5aca..13c9b53 100644
--- a/libnetfs/Makefile
+++ b/libnetfs/Makefile
@@ -34,7 +34,7 @@ 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-utimes.c file-reparent.c fsstubs.c file-get-transcntl.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 \
diff --git a/libnetfs/file-get-transcntl.c b/libnetfs/file-get-transcntl.c
new file mode 100644
index 0000000..04596d7
--- /dev/null
+++ b/libnetfs/file-get-transcntl.c
@@ -0,0 +1,52 @@
+/* libnetfs implementation of fs.defs: file_get_translator_cntl
+
+ Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation
+
+ This is a trivially adapted version of
+ libdiskfs/file-get-transcntl.c.
+
+ This program 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.
+
+ This program 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "priv.h"
+#include "fs_S.h"
+
+/* Implement file_get_translator_cntl as described in <hurd/fs.defs>. */
+error_t
+netfs_S_file_get_translator_cntl (struct protid *cred,
+ mach_port_t *ctl,
+ mach_msg_type_name_t *ctltype)
+{
+ struct node *np;
+ error_t err;
+
+ if (!cred)
+ return EOPNOTSUPP;
+
+ np = cred->po->np;
+
+ pthread_mutex_lock (&np->lock);
+
+ err = fshelp_isowner (&np->nn_stat, cred->user);
+ if (!err)
+ err = fshelp_fetch_control (&np->transbox, ctl);
+ if (!err && *ctl == MACH_PORT_NULL)
+ err = ENXIO;
+ if (!err)
+ *ctltype = MACH_MSG_TYPE_MOVE_SEND;
+
+ pthread_mutex_unlock (&np->lock);
+
+ return err;
+}
diff --git a/libnetfs/fsstubs.c b/libnetfs/fsstubs.c
index 708cbb8..f1b9bf7 100644
--- a/libnetfs/fsstubs.c
+++ b/libnetfs/fsstubs.c
@@ -30,14 +30,6 @@ netfs_S_file_notice_changes (struct protid *user,
}
error_t
-netfs_S_file_get_translator_cntl (struct protid *user,
- mach_port_t *trans,
- mach_msg_type_name_t *transtype)
-{
- return EOPNOTSUPP;
-}
-
-error_t
netfs_S_file_getfh (struct protid *user,
char **data, mach_msg_type_number_t *ndata)
{
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 10/70: sutils: allow multiple entries for the device "none", (continued)
- [hurd] 10/70: sutils: allow multiple entries for the device "none", Samuel Thibault, 2013/09/16
- [hurd] 08/70: mount: implement -O, --test-opts, Samuel Thibault, 2013/09/16
- [hurd] 07/70: mount: add -f and --fake arguments, Samuel Thibault, 2013/09/16
- [hurd] 11/70: sutils: fix the semantic of -t, --types in fstab.c, Samuel Thibault, 2013/09/16
- [hurd] 42/70: trans: register symlink translators as important, Samuel Thibault, 2013/09/16
- [hurd] 33/70: Reserve RPC ID for proc_set_init_task, Samuel Thibault, 2013/09/16
- [hurd] 06/70: mount: fix mount -oremount with one parameter, Samuel Thibault, 2013/09/16
- [hurd] 04/70: utils: escape arguments in remap.sh, Samuel Thibault, 2013/09/16
- [hurd] 30/70: umount: add a umount utility, Samuel Thibault, 2013/09/16
- [hurd] 32/70: Merge branch 'master-merge', Samuel Thibault, 2013/09/16
- [hurd] 28/70: libnetfs: implement file_get_translator_cntl,
Samuel Thibault <=
- [hurd] 02/70: Fix polling pfinet tun for write, Samuel Thibault, 2013/09/16
- [hurd] 69/70: Large store support for ext2fs, Samuel Thibault, 2013/09/16
- [hurd] 01/70: config.make: Use more configure settings when building xkb-data, Samuel Thibault, 2013/09/16
- [hurd] 09/70: mount: ignore mounted filesystems if --all is given, Samuel Thibault, 2013/09/16
- [hurd] 05/70: mount: add -n and --no-mtab arguments, Samuel Thibault, 2013/09/16
- [hurd] 29/70: libnetfs: handle dead-name notifications, Samuel Thibault, 2013/09/16
- [hurd] 16/70: Add configure checks for libdaemon, Samuel Thibault, 2013/09/16
- [hurd] 37/70: init: Mark all of inits children and init itself as important, Samuel Thibault, 2013/09/16
- [hurd] 57/70: libtrivfs: add fsys_get_children, Samuel Thibault, 2013/09/16
- [hurd] 61/70: libnetfs: add fsys_get_source, Samuel Thibault, 2013/09/16