Print this page
Revert "Revert "6602 lofi should support labeled devices""
This reverts commit 21386c8bd8477810b291eee22e08f1382e70cdf3.
Revert "6602 lofi should support labeled devices"
This reverts commit 406fc5100dac8d225a315a6def6be8d628f34e24.
Adding AoE support to nza-kernel

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/vfs.c
          +++ new/usr/src/uts/common/fs/vfs.c
↓ open down ↓ 4478 lines elided ↑ open up ↑
4479 4479  
4480 4480          vfs_list_unlock();
4481 4481  }
4482 4482  
4483 4483  #else /* x86 NEWBOOT */
4484 4484  
4485 4485  #if defined(__x86)
4486 4486  extern int hvmboot_rootconf();
4487 4487  #endif /* __x86 */
4488 4488  
     4489 +extern char *aoepath_prop;
4489 4490  extern ib_boot_prop_t *iscsiboot_prop;
4490 4491  
4491 4492  int
4492 4493  rootconf()
4493 4494  {
4494 4495          int error;
4495 4496          struct vfssw *vsw;
4496 4497          extern void pm_init();
4497 4498          char *fstyp, *fsmod;
4498 4499          int ret = -1;
↓ open down ↓ 22 lines elided ↑ open up ↑
4521 4522          RLOCK_VFSSW();
4522 4523          vsw = vfs_getvfsswbyname(fstyp);
4523 4524          RUNLOCK_VFSSW();
4524 4525          if (vsw == NULL) {
4525 4526                  cmn_err(CE_CONT, "Cannot find %s filesystem\n", fstyp);
4526 4527                  return (ENXIO);
4527 4528          }
4528 4529          VFS_INIT(rootvfs, &vsw->vsw_vfsops, 0);
4529 4530          VFS_HOLD(rootvfs);
4530 4531  
4531      -        /* always mount readonly first */
     4532 +        /* Always mount readonly first */
4532 4533          rootvfs->vfs_flag |= VFS_RDONLY;
4533 4534  
4534 4535          pm_init();
4535 4536  
4536      -        if (netboot && iscsiboot_prop) {
4537      -                cmn_err(CE_WARN, "NFS boot and iSCSI boot"
4538      -                    " shouldn't happen in the same time");
     4537 +        if ((aoepath_prop != NULL && (iscsiboot_prop != NULL || netboot)) ||
     4538 +            (iscsiboot_prop != NULL && (aoepath_prop != NULL || netboot)) ||
     4539 +            (netboot && (aoepath_prop != NULL || iscsiboot_prop != NULL))) {
     4540 +                cmn_err(CE_WARN, "Only one of AoE, iSCSI or NFS boot "
     4541 +                    "can be specified at time");
4539 4542                  return (EINVAL);
4540 4543          }
4541 4544  
4542      -        if (netboot || iscsiboot_prop) {
     4545 +        if (aoepath_prop != NULL || iscsiboot_prop != NULL || netboot) {
4543 4546                  ret = strplumb();
4544 4547                  if (ret != 0) {
4545 4548                          cmn_err(CE_WARN, "Cannot plumb network device %d", ret);
4546 4549                          return (EFAULT);
4547 4550                  }
4548 4551          }
4549 4552  
4550      -        if ((ret == 0) && iscsiboot_prop) {
4551      -                ret = modload("drv", "iscsi");
4552      -                /* -1 indicates fail */
4553      -                if (ret == -1) {
     4553 +        if (aoepath_prop != NULL) {
     4554 +                if (modload("drv", "aoe") == -1 ||
     4555 +                    modload("drv", "aoeblk") == -1) {
     4556 +                        cmn_err(CE_WARN, "Failed to load aoe modules");
     4557 +                        return (EINVAL);
     4558 +                }
     4559 +                if (i_ddi_attach_pseudo_node("aoe") == 0) {
     4560 +                        cmn_err(CE_WARN, "Failed to attach aoe driver");
     4561 +                        return (ENODEV);
     4562 +                }
     4563 +        }
     4564 +
     4565 +        if (iscsiboot_prop != NULL) {
     4566 +                if (modload("drv", "iscsi") == -1) {
4554 4567                          cmn_err(CE_WARN, "Failed to load iscsi module");
4555 4568                          iscsi_boot_prop_free();
4556 4569                          return (EINVAL);
4557      -                } else {
4558      -                        if (!i_ddi_attach_pseudo_node("iscsi")) {
4559      -                                cmn_err(CE_WARN,
4560      -                                    "Failed to attach iscsi driver");
4561      -                                iscsi_boot_prop_free();
4562      -                                return (ENODEV);
4563      -                        }
4564 4570                  }
     4571 +                if (i_ddi_attach_pseudo_node("iscsi") == 0) {
     4572 +                        cmn_err(CE_WARN, "Failed to attach iscsi driver");
     4573 +                        iscsi_boot_prop_free();
     4574 +                        return (ENODEV);
     4575 +                }
4565 4576          }
4566 4577  
4567 4578          error = VFS_MOUNTROOT(rootvfs, ROOT_INIT);
4568 4579          vfs_unrefvfssw(vsw);
4569 4580          rootdev = rootvfs->vfs_dev;
4570 4581  
4571      -        if (error)
     4582 +        if (error != 0)
4572 4583                  cmn_err(CE_CONT, "Cannot mount root on %s fstype %s\n",
4573 4584                      rootfs.bo_name, fstyp);
4574 4585          else
4575 4586                  cmn_err(CE_CONT, "?root on %s fstype %s\n",
4576 4587                      rootfs.bo_name, fstyp);
4577 4588          return (error);
4578 4589  }
4579 4590  
4580 4591  /*
4581 4592   * XXX this is called by nfs only and should probably be removed
↓ open down ↓ 195 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX