943 if (zap_lookup(dn, DMU_POOL_PROPS, &objnum, stack))
944 return (ERR_FILESYSTEM_NOT_FOUND);
945
946 if (errnum = dnode_get(mosmdn, objnum, DMU_OT_POOL_PROPS, dn, stack))
947 return (errnum);
948
949 if (zap_lookup(dn, ZPOOL_PROP_BOOTFS, &objnum, stack))
950 return (ERR_FILESYSTEM_NOT_FOUND);
951
952 if (!objnum)
953 return (ERR_FILESYSTEM_NOT_FOUND);
954
955 *obj = objnum;
956 return (0);
957 }
958
959 /*
960 * List of pool features that the grub implementation of ZFS supports for
961 * read. Note that features that are only required for write do not need
962 * to be listed here since grub opens pools in read-only mode.
963 */
964 static const char *spa_feature_names[] = {
965 "org.illumos:lz4_compress",
966 NULL
967 };
968
969 /*
970 * Checks whether the MOS features that are active are supported by this
971 * (GRUB's) implementation of ZFS.
972 *
973 * Return:
974 * 0: Success.
975 * errnum: Failure.
976 */
977 static int
978 check_mos_features(dnode_phys_t *mosmdn, char *stack)
979 {
980 uint64_t objnum;
981 dnode_phys_t *dn;
982 uint8_t error = 0;
|
943 if (zap_lookup(dn, DMU_POOL_PROPS, &objnum, stack))
944 return (ERR_FILESYSTEM_NOT_FOUND);
945
946 if (errnum = dnode_get(mosmdn, objnum, DMU_OT_POOL_PROPS, dn, stack))
947 return (errnum);
948
949 if (zap_lookup(dn, ZPOOL_PROP_BOOTFS, &objnum, stack))
950 return (ERR_FILESYSTEM_NOT_FOUND);
951
952 if (!objnum)
953 return (ERR_FILESYSTEM_NOT_FOUND);
954
955 *obj = objnum;
956 return (0);
957 }
958
959 /*
960 * List of pool features that the grub implementation of ZFS supports for
961 * read. Note that features that are only required for write do not need
962 * to be listed here since grub opens pools in read-only mode.
963 *
964 * When this list is updated the version number in usr/src/grub/capability
965 * must be incremented to ensure the new grub gets installed.
966 */
967 static const char *spa_feature_names[] = {
968 "org.illumos:lz4_compress",
969 NULL
970 };
971
972 /*
973 * Checks whether the MOS features that are active are supported by this
974 * (GRUB's) implementation of ZFS.
975 *
976 * Return:
977 * 0: Success.
978 * errnum: Failure.
979 */
980 static int
981 check_mos_features(dnode_phys_t *mosmdn, char *stack)
982 {
983 uint64_t objnum;
984 dnode_phys_t *dn;
985 uint8_t error = 0;
|