[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.61.0705041340310.18504@yvahk01.tjqt.qr>
Date: Fri, 4 May 2007 13:42:09 +0200 (MEST)
From: Jan Engelhardt <jengelh@...ux01.gwdg.de>
To: "Robert P. J. Day" <rpjday@...dspring.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Rewrite the MAJOR() macro as a call to imajor().
On May 4 2007 04:14, Robert P. J. Day wrote:
>> On May 3 2007 23:18, Andrew Morton wrote:
>> >> struct inode *i = file->f_mapping->host;
>> >>
>> >> - return i && S_ISBLK(i->i_mode) && MAJOR(i->i_rdev) == LOOP_MAJOR;
>> >> + return i && S_ISBLK(i->i_mode) && imajor(i) == LOOP_MAJOR;
>> >> }
>> >
>> >there's no runtime change, and I count a couple hundred MAJORs in the tree.
>>
>> Why do we even have imajor() if all it does is calling the MAJOR()
>> macro?
>
> i'm guessing it's to hide the underlying implementation of
>extracting the major/minor numbers from an inode, in case that
>implementation ever changes, which strikes me as perfectly reasonable.
How often has the implementation changed? I think i_rdev has been
there for a looong time. But yes, doing the MAJOR => imajor conversion
is preferable. Because you don't need the struct declaration for inode
then, and may omit to #include <linux/fs.h>. (Other things may need
fs.h so it's a bit of a corner case.)
> all i was doing was standardizing the small handful of holdouts.
Please continue, this was not a rant :)
Jan
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists