Re: [PATCH] quota: Remove use of info_any_dirty()

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jan Kara <jack@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>
Date: Monday, June 2, 2008 - 1:41 pm

Hi,

On Mon, Jun 2, 2008 at 7:11 PM, Jan Kara <jack@suse.cz> wrote:

This is really too hideous in my opinion and looks like a candidate
for its own static inline function.

Or you can try to rewrite the boolean expression on multiple lines
using continue, something like:

-               for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++)
-                       if ((type == cnt || type == -1) && sb_has_quota_enabled(
-                           && info_any_dirty(&sb_dqopt(sb)->info[cnt]))
-                               dirty = 1;
+               for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++) {
+                       if (type != cnt && type != -1)
+                               continue;
+                       if (!sb_has_quota_enabled(sb, cnt))
+                               continue;
+                       if (!info_any_dirty(&sb_dqopt(sb)->info[cnt]))
+                               continue;
+                       dirty = 1;
+               }

(This uses the original macro, I know. How about moving that from the
header to a new inline function just above this function?)

What do you think?


Vegard

PS: This is a really good clean-up effort. Good work!

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Cleanup quota header files, Jan Kara, (Mon Jun 2, 1:11 pm)
[PATCH] quota: Remove use of info_any_dirty(), Jan Kara, (Mon Jun 2, 1:11 pm)
Re: [PATCH] quota: Remove use of info_any_dirty(), Vegard Nossum, (Mon Jun 2, 1:41 pm)