-#endif NO_MOUNT_PRIVATE
- failed:
- thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
- _FREE(root_path, M_TEMP);
+#endif /* NO_MOUNT_PRIVATE */
+failed:
+ return (error);
+}
+
+/*
+ * Called with a partially initialized nfs_diskless struct
+ * with file handles to be filled in.
+ */
+int
+nfs_boot_getfh(struct nfs_diskless *nd, int v3, int sotype)
+{
+ int error = 0;
+
+ nd->nd_root.ndm_nfsv3 = v3;
+ nd->nd_root.ndm_sotype = sotype;
+ error = get_file_handle(&nd->nd_root);
+ if (error) {
+ printf("nfs_boot: get_file_handle(v%d) root failed, %d\n",
+ v3 ? 3 : 2, error);
+ goto failed;
+ }
+
+#if !defined(NO_MOUNT_PRIVATE)
+ if (nd->nd_private.ndm_saddr.sin_addr.s_addr) {
+ /* get private file handle */
+ nd->nd_private.ndm_nfsv3 = v3;
+ nd->nd_private.ndm_sotype = sotype;
+ error = get_file_handle(&nd->nd_private);
+ if (error) {
+ printf("nfs_boot: get_file_handle(v%d) private failed, %d\n",
+ v3 ? 3 : 2, error);
+ goto failed;
+ }
+ }
+#endif /* NO_MOUNT_PRIVATE */
+failed: