From 75b49ebed9d6328c2399c4d4b15b1e8a023285bf Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 14 Jan 2012 11:30:43 +0100 Subject: [PATCH] Remove defines pertaining to arbitrary limits not affecting GRUB anymore. * grub-core/fs/ext2.c (EXT2_PATH_MAX): Removed. (EXT2_MAX_SYMLINKCNT): Likewise. * grub-core/fs/nilfs2.c (NILFS_BTREE_LEVEL_MAX): Likewise. * grub-core/net/tftp.c (TFTP_MAX_PACKET): Likewise. * include/grub/i386/pc/pxe.h (GRUB_PXE_MIN_BLKSIZE): Likewise. (GRUB_PXE_MAX_BLKSIZE): Likewise. * include/grub/normal.h (GRUB_MAX_CMDLINE): Likewise. * include/grub/zfs/dnode.h (DN_MAX_INDBLKSHIFT): Likewise. (DN_MAX_OBJECT_SHIFT): Likewise. (DN_MAX_OFFSET_SHIFT): Likewise. (DN_MAX_OBJECT): Likewise. (DNODES_PER_LEVEL_SHIFT): Likewise. * include/grub/zfs/spa.h (SPA_MAXBLOCKSHIFT): Likewise. (SPA_MAXBLOCKSIZE): Likewise. (SPA_BLOCKSIZES): Likewise. * include/grub/zfs/zap_impl.h (MZAP_MAX_BLKSHIFT): Likewise. (MZAP_MAX_BLKSZ): Likewise. --- ChangeLog | 23 +++++++++++++++++++++++ grub-core/fs/ext2.c | 4 ---- grub-core/fs/nilfs2.c | 1 - grub-core/net/tftp.c | 3 +-- include/grub/i386/pc/pxe.h | 3 --- include/grub/normal.h | 3 --- include/grub/zfs/dnode.h | 5 ----- include/grub/zfs/spa.h | 9 --------- include/grub/zfs/zap_impl.h | 2 -- 9 files changed, 24 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e34a478c..80c774256 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2012-01-14 Vladimir Serbinenko + + Remove defines pertaining to arbitrary limits not affecting GRUB + anymore. + + * grub-core/fs/ext2.c (EXT2_PATH_MAX): Removed. + (EXT2_MAX_SYMLINKCNT): Likewise. + * grub-core/fs/nilfs2.c (NILFS_BTREE_LEVEL_MAX): Likewise. + * grub-core/net/tftp.c (TFTP_MAX_PACKET): Likewise. + * include/grub/i386/pc/pxe.h (GRUB_PXE_MIN_BLKSIZE): Likewise. + (GRUB_PXE_MAX_BLKSIZE): Likewise. + * include/grub/normal.h (GRUB_MAX_CMDLINE): Likewise. + * include/grub/zfs/dnode.h (DN_MAX_INDBLKSHIFT): Likewise. + (DN_MAX_OBJECT_SHIFT): Likewise. + (DN_MAX_OFFSET_SHIFT): Likewise. + (DN_MAX_OBJECT): Likewise. + (DNODES_PER_LEVEL_SHIFT): Likewise. + * include/grub/zfs/spa.h (SPA_MAXBLOCKSHIFT): Likewise. + (SPA_MAXBLOCKSIZE): Likewise. + (SPA_BLOCKSIZES): Likewise. + * include/grub/zfs/zap_impl.h (MZAP_MAX_BLKSHIFT): Likewise. + (MZAP_MAX_BLKSZ): Likewise. + 2012-01-14 Vladimir Serbinenko * grub-core/fs/zfs/zfs.c (grub_zfs_read): Remove useless alloc and diff --git a/grub-core/fs/ext2.c b/grub-core/fs/ext2.c index 6eb53d3f8..51f3a658f 100644 --- a/grub-core/fs/ext2.c +++ b/grub-core/fs/ext2.c @@ -21,10 +21,6 @@ #define EXT2_MAGIC 0xEF53 /* Amount of indirect blocks in an inode. */ #define INDIRECT_BLOCKS 12 -/* Maximum length of a pathname. */ -#define EXT2_PATH_MAX 4096 -/* Maximum nesting of symlinks, used to prevent a loop. */ -#define EXT2_MAX_SYMLINKCNT 8 /* The good old revision and the default inode size. */ #define EXT2_GOOD_OLD_REVISION 0 diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c index 0b001eb0e..c2eecba2f 100644 --- a/grub-core/fs/nilfs2.c +++ b/grub-core/fs/nilfs2.c @@ -49,7 +49,6 @@ GRUB_MOD_LICENSE ("GPLv3+"); /* nilfs btree node level. */ #define NILFS_BTREE_LEVEL_DATA 0 #define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1) -#define NILFS_BTREE_LEVEL_MAX 14 /* nilfs 1st super block posission from beginning of the partition in 512 block size */ diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c index c05ef24d4..9704a345b 100644 --- a/grub-core/net/tftp.c +++ b/grub-core/net/tftp.c @@ -41,7 +41,6 @@ enum enum { TFTP_DEFAULTSIZE_PACKET = 512, - TFTP_MAX_PACKET = 1432 }; enum @@ -81,7 +80,7 @@ struct tftphdr { grub_int8_t rrq[TFTP_DEFAULTSIZE_PACKET]; struct { grub_uint16_t block; - grub_int8_t download[TFTP_MAX_PACKET]; + grub_int8_t download[0]; } data; struct { grub_uint16_t block; diff --git a/include/grub/i386/pc/pxe.h b/include/grub/i386/pc/pxe.h index 376a18962..925631d04 100644 --- a/include/grub/i386/pc/pxe.h +++ b/include/grub/i386/pc/pxe.h @@ -157,9 +157,6 @@ #define GRUB_PXE_BOOTP_SIZE (312 + 236) /* DHCP standard vendor field size. */ #endif -#define GRUB_PXE_MIN_BLKSIZE 512 -#define GRUB_PXE_MAX_BLKSIZE 1432 - #define GRUB_PXE_TFTP_PORT 69 #define GRUB_PXE_ERR_LEN 0xFFFFFFFF diff --git a/include/grub/normal.h b/include/grub/normal.h index 08c14d209..84e387242 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -28,9 +28,6 @@ #include #include -/* The maximum size of a command-line. */ -#define GRUB_MAX_CMDLINE 1600 - /* The standard left and right margin for some messages. */ #define STANDARD_MARGIN 6 diff --git a/include/grub/zfs/dnode.h b/include/grub/zfs/dnode.h index 279c5451e..5103b1c20 100644 --- a/include/grub/zfs/dnode.h +++ b/include/grub/zfs/dnode.h @@ -30,11 +30,8 @@ */ #define DNODE_SHIFT 9 /* 512 bytes */ #define DN_MIN_INDBLKSHIFT 10 /* 1k */ -#define DN_MAX_INDBLKSHIFT 14 /* 16k */ #define DNODE_BLOCK_SHIFT 14 /* 16k */ #define DNODE_CORE_SIZE 64 /* 64 bytes for dnode sans blkptrs */ -#define DN_MAX_OBJECT_SHIFT 48 /* 256 trillion (zfs_fid_t limit) */ -#define DN_MAX_OFFSET_SHIFT 64 /* 2^64 bytes in a dnode */ /* * Derived constants. @@ -42,11 +39,9 @@ #define DNODE_SIZE (1 << DNODE_SHIFT) #define DN_MAX_NBLKPTR ((DNODE_SIZE - DNODE_CORE_SIZE) >> SPA_BLKPTRSHIFT) #define DN_MAX_BONUSLEN (DNODE_SIZE - DNODE_CORE_SIZE - (1 << SPA_BLKPTRSHIFT)) -#define DN_MAX_OBJECT (1ULL << DN_MAX_OBJECT_SHIFT) #define DNODES_PER_BLOCK_SHIFT (DNODE_BLOCK_SHIFT - DNODE_SHIFT) #define DNODES_PER_BLOCK (1ULL << DNODES_PER_BLOCK_SHIFT) -#define DNODES_PER_LEVEL_SHIFT (DN_MAX_INDBLKSHIFT - SPA_BLKPTRSHIFT) #define DNODE_FLAG_SPILL_BLKPTR (1<<2) diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h index 0e29fa44a..19a2b640a 100644 --- a/include/grub/zfs/spa.h +++ b/include/grub/zfs/spa.h @@ -66,17 +66,8 @@ #define BF64_SET_SB(x, low, len, shift, bias, val) \ 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. - */ #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) diff --git a/include/grub/zfs/zap_impl.h b/include/grub/zfs/zap_impl.h index e42727ab6..0e985d9f9 100644 --- a/include/grub/zfs/zap_impl.h +++ b/include/grub/zfs/zap_impl.h @@ -28,8 +28,6 @@ #define ZAP_HASHBITS 28 #define MZAP_ENT_LEN 64 #define MZAP_NAME_LEN (MZAP_ENT_LEN - 8 - 4 - 2) -#define MZAP_MAX_BLKSHIFT SPA_MAXBLOCKSHIFT -#define MZAP_MAX_BLKSZ (1 << MZAP_MAX_BLKSHIFT) typedef struct mzap_ent_phys { grub_uint64_t mze_value;