[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 97/98: libnetfs: register passive translator startups
From: |
Samuel Thibault |
Subject: |
[hurd] 97/98: libnetfs: register passive translator startups |
Date: |
Tue, 14 Jan 2014 02:00:06 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 9a7776ddef6626536f21c09090b8329168a053ce
Author: Justus Winter <address@hidden>
Date: Thu Oct 17 11:20:30 2013 +0200
libnetfs: register passive translator startups
Detect passive translator startup and add the resulting active
translator to the list of active translators.
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Detect and register
passive translator startup.
---
libnetfs/dir-lookup.c | 43 +++++++++++++++++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 2 deletions(-)
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c
index 74351fa..99a8746 100644
--- a/libnetfs/dir-lookup.c
+++ b/libnetfs/dir-lookup.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995,96,97,98,99,2000,01,02,13
+ Copyright (C) 1995,96,97,98,99,2000,01,02,13,14
Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
@@ -67,6 +67,10 @@ netfs_S_dir_lookup (struct protid *diruser,
if (! relpath)
return ENOMEM;
+ /* Keep a pointer to the start of the filename for length
+ calculations. */
+ char *filename_start = filename;
+
*retry_port_type = MACH_MSG_TYPE_MAKE_SEND;
*do_retry = FS_RETRY_NORMAL;
*retry_name = '\0';
@@ -256,10 +260,16 @@ netfs_S_dir_lookup (struct protid *diruser,
}
}
+ boolean_t register_translator;
if (! error)
{
dirport = ports_get_send_right (newpi);
- ports_port_deref (newpi);
+
+ /* Check if an active translator is currently running. If
+ not, fshelp_fetch_root will start one. In that case, we
+ need to register it in the list of active
+ translators. */
+ register_translator = np->transbox.active == MACH_PORT_NULL;
error = fshelp_fetch_root (&np->transbox, diruser->po,
dirport,
@@ -283,9 +293,38 @@ netfs_S_dir_lookup (struct protid *diruser,
strcat (retry_name, "/");
strcat (retry_name, nextname);
}
+
+ if (register_translator)
+ {
+ char *translator_path = strdupa (relpath);
+ if (nextname != NULL)
+ {
+ /* This was not the last path component.
+ NEXTNAME points to the next component, locate
+ the end of the current component and use it
+ to trim TRANSLATOR_PATH. */
+ char *end = nextname;
+ while (*end != 0)
+ end--;
+ translator_path[end - filename_start] = '\0';
+ }
+
+ error = fshelp_set_active_translator (&newpi->pi,
+ translator_path,
+ np->transbox.active);
+ if (error)
+ {
+ ports_port_deref (newpi);
+ goto out;
+ }
+ }
+
+ ports_port_deref (newpi);
goto out;
}
+ ports_port_deref (newpi);
+
/* ENOENT means there was a hiccup, and the translator vanished
while NP was unlocked inside fshelp_fetch_root; continue as
normal. */
error = 0;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 07/98: proc: fix a use-after-free error, (continued)
- [hurd] 07/98: proc: fix a use-after-free error, Samuel Thibault, 2014/01/13
- [hurd] 18/98: libdiskfs: remove dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 60/98: trans: fix the creation of files in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 69/98: trans: return nodes locked when creating fake nodes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 20/98: ext2fs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 93/98: trans/mtab: make the translator multithreaded, Samuel Thibault, 2014/01/13
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13
- [hurd] 15/98: mach-defpager: include errno.h, Samuel Thibault, 2014/01/13
- [hurd] 91/98: trans/mtab: remove the loop detection logic, Samuel Thibault, 2014/01/13
- [hurd] 97/98: libnetfs: register passive translator startups,
Samuel Thibault <=
- [hurd] 19/98: libdiskfs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function, Samuel Thibault, 2014/01/13
- [hurd] 23/98: mach-defpager: do not remove -Wall from CFLAGS, Samuel Thibault, 2014/01/13
- [hurd] 94/98: trans/mtab: do not include non-filesystem translators by default, Samuel Thibault, 2014/01/13
- [hurd] 96/98: libdiskfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 92/98: trans/mtab: properly lock mtab objects, Samuel Thibault, 2014/01/13
- [hurd] 03/98: libports: fix the thread counts in case the thread creation fails, Samuel Thibault, 2014/01/13
- [hurd] 76/98: utils/settrans: fix the teardown of chrooted environments, Samuel Thibault, 2014/01/13
- [hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xlator_create, Samuel Thibault, 2014/01/13
- [hurd] 95/98: libfshelp: fix the api of fshelp_set_active_translator, Samuel Thibault, 2014/01/13