+static int v4root_add_parents(nfs_export *exp)
+{
+ char *hostname = exp->m_export.e_hostname;
+ char *path;
+ char *ptr;
+
+ path = strdup(exp->m_export.e_path);
+ if (!path) {
+ xlog(L_WARNING, "v4root_add_parents: Unable to create "
+ "pseudo export for '%s'", exp->m_export.e_path);
+ return -ENOMEM;
+ }
+ for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) {
+ int ret;
+ char saved;
+
+ saved = *ptr;
+ *ptr = '\0';
+ ret = pseudofs_update(hostname, path, exp);
+ if (ret)
+ return ret;
+ *ptr = saved;
+ ptr++;
+ }
+ free(path);
+ return 0;
+}
+