summaryrefslogtreecommitdiff
path: root/usr/src/grub
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2014-11-07 16:39:21 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2014-11-07 16:39:21 +0000
commite46b615a809a16dc4fe18a3ed07f823fa4a5189f (patch)
treece0e7be16cd624c7ad39c4890d73d433c944ac07 /usr/src/grub
parentf8b9ed83a90e9c166708a03e903b5c036158dbfe (diff)
parentb515258426fed6c7311fd3f1dea697cfbd4085c6 (diff)
downloadillumos-joyent-e46b615a809a16dc4fe18a3ed07f823fa4a5189f.tar.gz
[illumos-gate merge]
commit b515258426fed6c7311fd3f1dea697cfbd4085c6 5027 zfs large block support commit f3477bb2505a35e160b09c9dbf5476112be4fa7d 4457 we apparently change .comment of almost every userland object commit 738f37bc3dcd61e8a893af0f2d466d76690b70ec 5244 zio pipeline callers should explicitly invoke next stage commit f7950bf1145637c6dc57742a8bb95631fd5c846f 5243 zdb -b could be much faster commit cffcfaee1e6b29ef9ceb7d80e4e053ffd029906b 5270 ld(1) cannot handle CIE version 3 in .eh_frame Conflicts: usr/src/man/man1m/zfs.1m
Diffstat (limited to 'usr/src/grub')
-rw-r--r--usr/src/grub/grub-0.97/stage2/fsys_zfs.c12
-rw-r--r--usr/src/grub/grub-0.97/stage2/zfs-include/spa.h7
2 files changed, 14 insertions, 5 deletions
diff --git a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
index 341b6cd971..91b4bcec6f 100644
--- a/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
+++ b/usr/src/grub/grub-0.97/stage2/fsys_zfs.c
@@ -1048,6 +1048,7 @@ static const char *spa_feature_names[] = {
"com.delphix:hole_birth",
"com.delphix:extensible_dataset",
"com.delphix:embedded_data",
+ "org.open-zfs:large_blocks",
NULL
};
@@ -1837,6 +1838,17 @@ zfs_read(char *buf, int len)
blksz = DNODE->dn_datablkszsec << SPA_MINBLOCKSHIFT;
/*
+ * Note: for GRUB, SPA_MAXBLOCKSIZE is 128KB. There is not enough
+ * memory to allocate the new max blocksize (16MB), so while
+ * GRUB understands the large_blocks on-disk feature, it can't
+ * actually read large blocks.
+ */
+ if (blksz > SPA_MAXBLOCKSIZE) {
+ grub_printf("blocks larger than 128K are not supported\n");
+ return (0);
+ }
+
+ /*
* Entire Dnode is too big to fit into the space available. We
* will need to read it in chunks. This could be optimized to
* read in as large a chunk as there is space available, but for
diff --git a/usr/src/grub/grub-0.97/stage2/zfs-include/spa.h b/usr/src/grub/grub-0.97/stage2/zfs-include/spa.h
index 19fe52f13f..deb52cfda3 100644
--- a/usr/src/grub/grub-0.97/stage2/zfs-include/spa.h
+++ b/usr/src/grub/grub-0.97/stage2/zfs-include/spa.h
@@ -56,17 +56,14 @@
BF64_SET(x, low, len, ((val) >> (shift)) - (bias))
/*
- * We currently support nine block sizes, from 512 bytes to 128K.
- * We could go higher, but the benefits are near-zero and the cost
- * of COWing a giant block to modify one byte would become excessive.
+ * Note: GRUB can't actually read blocks larger than 128KB, due to lack
+ * of memory. Therefore its SPA_MAXBLOCKSIZE is still 128KB.
*/
#define SPA_MINBLOCKSHIFT 9
#define SPA_MAXBLOCKSHIFT 17
#define SPA_MINBLOCKSIZE (1ULL << SPA_MINBLOCKSHIFT)
#define SPA_MAXBLOCKSIZE (1ULL << SPA_MAXBLOCKSHIFT)
-#define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1)
-
/*
* Size of block to hold the configuration data (a packed nvlist)
*/