summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/fs')
-rw-r--r--usr/src/uts/common/fs/sockfs/socksubr.c15
-rw-r--r--usr/src/uts/common/fs/vfs.c34
2 files changed, 43 insertions, 6 deletions
diff --git a/usr/src/uts/common/fs/sockfs/socksubr.c b/usr/src/uts/common/fs/sockfs/socksubr.c
index d8b69aef5e..33a6841f16 100644
--- a/usr/src/uts/common/fs/sockfs/socksubr.c
+++ b/usr/src/uts/common/fs/sockfs/socksubr.c
@@ -92,7 +92,7 @@ static struct kmem_cache *socktpi_cache, *socktpi_unix_cache;
struct kmem_cache *socktpi_sod_cache;
dev_t sockdev; /* For fsid in getattr */
-
+int sockfs_defer_nl7c_init = 0;
struct sockparams *sphead;
krwlock_t splist_lock;
@@ -107,6 +107,8 @@ extern void nl7c_init(void);
extern int sostr_init();
+extern int modrootloaded;
+
#define ADRSTRLEN (2 * sizeof (void *) + 1)
/*
* kernel structure for passing the sockinfo data back up to the user.
@@ -195,6 +197,11 @@ soconfig(int domain, int type, int protocol,
dprint(0, ("soconfig(%d,%d,%d,%s,%d)\n",
domain, type, protocol, devpath, devpathlen));
+ if (sockfs_defer_nl7c_init) {
+ nl7c_init();
+ sockfs_defer_nl7c_init = 0;
+ }
+
/*
* Look for an existing match.
*/
@@ -769,7 +776,11 @@ sockinit(int fstype, char *name)
mutex_init(&socklist.sl_lock, NULL, MUTEX_DEFAULT, NULL);
sendfile_init();
- nl7c_init();
+ if (!modrootloaded) {
+ sockfs_defer_nl7c_init = 1;
+ } else {
+ nl7c_init();
+ }
return (0);
diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c
index 30e9cf7430..bf9d325048 100644
--- a/usr/src/uts/common/fs/vfs.c
+++ b/usr/src/uts/common/fs/vfs.c
@@ -36,7 +36,6 @@
* contributors.
*/
-
#include <sys/types.h>
#include <sys/t_lock.h>
#include <sys/param.h>
@@ -84,11 +83,11 @@
#include <sys/attr.h>
#include <sys/spa.h>
#include <sys/lofi.h>
+#include <sys/bootprops.h>
#include <vm/page.h>
#include <fs/fs_subr.h>
-
/* Private interfaces to create vopstats-related data structures */
extern void initialize_vopstats(vopstats_t *);
extern vopstats_t *get_fstype_vopstats(struct vfs *, struct vfssw *);
@@ -4489,6 +4488,9 @@ vfs_root_redev(vfs_t *vfsp, dev_t ndev, int fstype)
extern int hvmboot_rootconf();
#endif /* __x86 */
+extern ib_boot_prop_t *iscsiboot_prop;
+extern void iscsi_boot_prop_free();
+
int
rootconf()
{
@@ -4496,6 +4498,7 @@ rootconf()
struct vfssw *vsw;
extern void pm_init();
char *fstyp, *fsmod;
+ int ret = -1;
getrootfs(&fstyp, &fsmod);
@@ -4533,8 +4536,31 @@ rootconf()
pm_init();
- if (netboot)
- (void) strplumb();
+ if (netboot && iscsiboot_prop) {
+ cmn_err(CE_WARN, "NFS boot and iSCSI boot"
+ " shouldn't happen in the same time");
+ return (EINVAL);
+ }
+
+ if (netboot || iscsiboot_prop)
+ ret = strplumb();
+
+ if ((ret == 0) && iscsiboot_prop) {
+ ret = modload("drv", "iscsi");
+ /* -1 indicates fail */
+ if (ret == -1) {
+ cmn_err(CE_WARN, "Failed to load iscsi module");
+ iscsi_boot_prop_free();
+ return (EINVAL);
+ } else {
+ if (!i_ddi_attach_pseudo_node("iscsi")) {
+ cmn_err(CE_WARN,
+ "Failed to attach iscsi driver");
+ iscsi_boot_prop_free();
+ return (ENODEV);
+ }
+ }
+ }
error = VFS_MOUNTROOT(rootvfs, ROOT_INIT);
vfs_unrefvfssw(vsw);