From: NeilBrown Date: Wed, 23 Jun 2010 01:53:40 +0000 (+1000) Subject: Check we haven't allocated too many flags. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=5a155c9fc30cb18ed5c145b4812e6408fcacb77f;p=LaFS.git Check we haven't allocated too many flags. Simple compile-time checking that we haven't allocated too many B_* flags. Signed-off-by: NeilBrown --- diff --git a/state.h b/state.h index 26c0cd6..f35e2e8 100644 --- a/state.h +++ b/state.h @@ -472,6 +472,8 @@ enum { * Gets allocated to '0'. * Flag only set under B_IOLock. */ + + B_NUM_FLAGS }; /* indexing info stays in the block, not in the inode */ struct lafs_inode { diff --git a/super.c b/super.c index e676167..e2e8a03 100644 --- a/super.c +++ b/super.c @@ -876,6 +876,8 @@ static int __init lafs_init(void) { int err; + BUILD_BUG_ON(B_NUM_FLAGS > 32); + err = lafs_ihash_init(); if (err) goto out;