From 13efe6721a370c38b65e0da3d33f310f42cfa05f Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 18 Apr 2016 21:53:28 +0200 Subject: 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. --- libnetfs/fsys-getroot.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libnetfs/fsys-getroot.c') diff --git a/libnetfs/fsys-getroot.c b/libnetfs/fsys-getroot.c index 2d02120e..d9191105 100644 --- a/libnetfs/fsys-getroot.c +++ b/libnetfs/fsys-getroot.c @@ -23,6 +23,7 @@ #include "misc.h" #include "callbacks.h" #include +#include error_t netfs_S_fsys_getroot (struct netfs_control *pt, @@ -67,8 +68,12 @@ netfs_S_fsys_getroot (struct netfs_control *pt, || fshelp_translated (&netfs_root_node->transbox)) && !(flags & O_NOTRANS)) { + struct fshelp_stat_cookie2 cookie = { + .next = &peropen_context, + }; + err = fshelp_fetch_root (&netfs_root_node->transbox, - &peropen_context, dotdot, cred, flags, + &cookie, dotdot, cred, flags, _netfs_translator_callback1, _netfs_translator_callback2, do_retry, retry_name, retry_port); -- cgit v1.2.3