[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 96/98: libdiskfs: register passive translator startups
From: |
Samuel Thibault |
Subject: |
[hurd] 96/98: libdiskfs: 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 9c2d39405c30b75bc817a6212a116421ebb927f1
Author: Justus Winter <address@hidden>
Date: Tue Oct 8 12:42:52 2013 +0200
libdiskfs: register passive translator startups
Detect passive translator startup and add the resulting active
translator to the list of active translators.
Note that newpi is properly deallocated in the function epilogue.
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Detect and register
passive translator startup.
---
libdiskfs/dir-lookup.c | 41 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 38 insertions(+), 3 deletions(-)
diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c
index 86116e3..3950bf9 100644
--- a/libdiskfs/dir-lookup.c
+++ b/libdiskfs/dir-lookup.c
@@ -1,6 +1,6 @@
/* libdiskfs implementation of fs.defs:dir_lookup
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2008, 2013 Free Software Foundation, Inc.
+ 2002, 2008, 2013, 2014 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
@@ -74,6 +74,10 @@ diskfs_S_dir_lookup (struct protid *dircred,
if (! relpath)
return ENOMEM;
+ /* Keep a pointer to the start of the path for length
+ calculations. */
+ char *path_start = path;
+
*returned_port_poly = MACH_MSG_TYPE_MAKE_SEND;
*retry = FS_RETRY_NORMAL;
retryname[0] = '\0';
@@ -274,11 +278,16 @@ diskfs_S_dir_lookup (struct protid *dircred,
goto out;
dirport = ports_get_send_right (newpi);
- ports_port_deref (newpi);
- newpi = 0;
if (np != dnp)
pthread_mutex_unlock (&dnp->lock);
+ /* 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. */
+ boolean_t register_translator =
+ np->transbox.active == MACH_PORT_NULL;
+
error = fshelp_fetch_root (&np->transbox, dircred->po,
dirport, dircred->user,
lastcomp ? flags : 0,
@@ -301,9 +310,35 @@ diskfs_S_dir_lookup (struct protid *dircred,
*end++ = '/';
strcpy (end, 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 - path_start] = '\0';
+ }
+
+ error = fshelp_set_active_translator (&newpi->pi,
+ translator_path,
+ np->transbox.active);
+ if (error)
+ goto out;
+ }
+
goto out;
}
+ ports_port_deref (newpi);
+ newpi = NULL;
+
/* ENOENT means there was a hiccup, and the translator
vanished while NP was unlocked inside fshelp_fetch_root.
Reacquire the locks, and continue as normal. */
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, (continued)
- [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, 2014/01/13
- [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 <=
- [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
- [hurd] 98/98: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/01/13
- [hurd] 17/98: utils: implement portinfo --search, Samuel Thibault, 2014/01/13
- [hurd] 10/98: auth: fix use of uninitialized variable err, Samuel Thibault, 2014/01/13
- [hurd] 61/98: trans: fix transparent reauthentication in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 01/98: pfinet: fix emission on the loopback device, Samuel Thibault, 2014/01/13