Patch: linux-2.5.30/fs/ntfs BUG_ON(cond1 || cond2) bugs(!) and clean ups

From: Adam J. Richter (adam@yggdrasil.com)
Date: Mon Aug 05 2002 - 15:41:30 EST


        The following patch replaces all BUG_ON(condition1 || condition2)
statements in fs/ntfs with separate BUG_ON statements, usually like so:

                BUG_ON(condition1);
                BUG_ON(condition2);

        This provides more information if the BUG_ON statement is every
tripped.

        In addition, the fs/ntfs code had some
BUG_ON(...atomic_dec_and_test(...)) statements. BUG_ON conditions should
not have side effects, because you are supposed to be able to compile out
BUG_ON statements to have the code run faster (which is an important
guarantee for encouraging developers to write BUG_ON statements). I
have translated the offending cases to statements of the following form:

        if(...atomic_dec_and_test(...))
                BUG();

        I have attached the patch below. I would like to get these
changes into Linus's 2.5 tree. Please let me know if you want to take
it from here, if you want me to submit this patch to Linus or if you
want me to do something else. Thanks for your time, and for maintaining
the NT file system on Linux.

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:28 EST