]> git.neil.brown.name Git - LaFS.git/commitdiff
Check we haven't allocated too many flags.
authorNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 01:53:40 +0000 (11:53 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 02:49:07 +0000 (12:49 +1000)
Simple compile-time checking that we haven't
allocated too many B_* flags.

Signed-off-by: NeilBrown <neilb@suse.de>
state.h
super.c

diff --git a/state.h b/state.h
index 26c0cd62ab159f9e8ad99cea731966eb02ecbb5d..f35e2e820bba55ebf6003a392f87f2fc5a7d4914 100644 (file)
--- 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 e676167fdf924ff702617fa1b985d488303db2da..e2e8a03d9f88cb689e481b521e9189ad9d774a85 100644 (file)
--- 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;