diff options
author | Justus Winter <justus@gnupg.org> | 2016-04-18 21:53:28 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2016-05-19 22:27:37 +0200 |
commit | 13efe6721a370c38b65e0da3d33f310f42cfa05f (patch) | |
tree | 5c05409d7e27b9cb0842af4bbe7bf242b7659ab7 /libdiskfs/fsys-getroot.c | |
parent | 3416078aa58b095566e559b7dbd9c9da4d1fc5d5 (diff) | |
download | hurd-13efe6721a370c38b65e0da3d33f310f42cfa05f.tar.gz hurd-13efe6721a370c38b65e0da3d33f310f42cfa05f.tar.bz2 hurd-13efe6721a370c38b65e0da3d33f310f42cfa05f.zip |
Unify the short-circuit translator logic
* libdiskfs/dir-lookup.c (short_circuited_callback1): Move function to
libfshelp.
(diskfs_S_dir_lookup): Use the function from libfshelp instead.
* libdiskfs/fsys-getroot.c (diskfs_S_fsys_getroot): Adapt accordingly.
* libdiskfs/trans-callback.c (_diskfs_translator_callback2_fn): Likewise.
* libfshelp/fetch-root.c (fshelp_short_circuited_callback1): New function.
* libfshelp/fshelp.h (struct fshelp_stat_cookie): New definition.
(fshelp_short_circuited_callback1): New prototype.
* libnetfs/dir-lookup.c (short_circuited_callback1): Drop function.
(netfs_S_dir_lookup): Use the function from libfshelp instead.
* libnetfs/fsys-getroot.c (netfs_S_fsys_getroot): Adapt accordingly.
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Likewise.
Diffstat (limited to 'libdiskfs/fsys-getroot.c')
-rw-r--r-- | libdiskfs/fsys-getroot.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libdiskfs/fsys-getroot.c b/libdiskfs/fsys-getroot.c index 401f1032..6f93888f 100644 --- a/libdiskfs/fsys-getroot.c +++ b/libdiskfs/fsys-getroot.c @@ -21,6 +21,7 @@ #include "priv.h" #include "fsys_S.h" +#include <hurd/fshelp.h> #include <hurd/fsys.h> #include <fcntl.h> @@ -78,11 +79,15 @@ diskfs_S_fsys_getroot (struct diskfs_control *pt, || fshelp_translated (&diskfs_root_node->transbox)) && !(flags & O_NOTRANS)) { + struct fshelp_stat_cookie2 cookie = { + .next = &peropen_context, + }; + err = fshelp_fetch_root (&diskfs_root_node->transbox, - &peropen_context, dotdot, &user, flags, - _diskfs_translator_callback1, - _diskfs_translator_callback2, - retry, retryname, returned_port); + &cookie, dotdot, &user, flags, + _diskfs_translator_callback1, + _diskfs_translator_callback2, + retry, retryname, returned_port); if (err != ENOENT) { pthread_mutex_unlock (&diskfs_root_node->lock); |