All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tristan Ye <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 1/3] Ocfs2: Using macro to set/clear *FILLED* flags in info handler.
Date: Tue, 01 Feb 2011 15:48:41 +0800	[thread overview]
Message-ID: <4D47BAD9.1020509@oracle.com> (raw)
In-Reply-To: <20110131221547.GH23899@wotan.suse.de>

Mark Fasheh wrote:
> On Sun, Jan 30, 2011 at 02:25:59PM +0800, Tristan Ye wrote:
>> It's a best-effort attempt to simplize duplicated codes here.
>
> Nice cleanup. I have only one issue with it:
>
>
>> Signed-off-by: Tristan Ye <tristan.ye@oracle.com>
>> ---
>>  fs/ocfs2/ioctl.c |   38 ++++++++++++++++++++++++++++++--------
>>  1 files changed, 30 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
>> index 7a48681..731cf46 100644
>> --- a/fs/ocfs2/ioctl.c
>> +++ b/fs/ocfs2/ioctl.c
>> @@ -46,6 +46,22 @@ static inline void __o2info_set_request_error(struct ocfs2_info_request *kreq,
>>  #define o2info_set_request_error(a, b) \
>>  		__o2info_set_request_error((struct ocfs2_info_request *)&(a), b)
>>  
>> +static inline void __o2info_set_request_filled(struct ocfs2_info_request *req)
>> +{
>> +	req->ir_flags |= OCFS2_INFO_FL_FILLED;
>> +}
>> +
>> +#define o2info_set_request_filled(a) \
>> +		__o2info_set_request_filled((struct ocfs2_info_request *)&(a))
>
> The macro here (and below) casts it's argument, thus defeating any
> typechecking we would have gotten from the function call. Can you
> pleaseremove the macro, rename the functions (take out the __) and use them
> directly? I know we might then want to deref the i*_req field in the
> handlers below but I don't think that's a big deal for what we gain.

Hi Mark,

    The reason why I used a macro is to make the life of caller as easy 
as taking the
specific info object(like ocfs2_info_blocksize, or 
ocfs2_info_clustersize etc) directly,
just for the sake of making the codes look more neat.

    That's not a big deal to use a direct inline func, while need caller 
bother to cast
the info type;-)

Tristan.

> 	--Mark
>
>
> --
> Mark Fasheh

  parent reply	other threads:[~2011-02-01  7:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30  6:25 [Ocfs2-devel] [PATCH 0/3] Ocfs2: Adding new codes 'OCFS2_INFO_FREEINODE' and 'OCFS2_INFO_FREEFRAG' for o2info ioctl V2 Tristan Ye
2011-01-30  6:25 ` [Ocfs2-devel] [PATCH 1/3] Ocfs2: Using macro to set/clear *FILLED* flags in info handler Tristan Ye
2011-01-31 22:15   ` Mark Fasheh
2011-02-01  1:10     ` Joel Becker
2011-02-01  3:06       ` Mark Fasheh
2011-02-01  6:01         ` Joel Becker
2011-02-01  7:53           ` Tristan Ye
2011-02-01 17:37           ` Mark Fasheh
2011-02-01  7:48     ` Tristan Ye [this message]
2011-02-20 12:08   ` Joel Becker
2011-01-30  6:26 ` [Ocfs2-devel] [PATCH 2/3] Ocfs2: Add a new code 'OCFS2_INFO_FREEINODE' for o2info ioctl Tristan Ye
2011-01-31 22:57   ` Mark Fasheh
2011-02-01  7:52     ` Tristan Ye
2011-02-20 12:07   ` Joel Becker
2011-02-20 12:59     ` Tristan Ye
2011-02-21  2:04       ` Joel Becker
2011-02-21 18:17       ` Sunil Mushran
2011-01-30  6:26 ` [Ocfs2-devel] [PATCH 3/3] Ocfs2: Add a new code 'OCFS2_INFO_FREEFRAG' " Tristan Ye
  -- strict thread matches above, loose matches on Subject: below --
2010-11-16 10:13 [Ocfs2-devel] [PATCH 0/3] Ocfs2: Adding new codes 'OCFS2_INFO_FREEINODE' and 'OCFS2_INFO_FREEFRAG' for o2info ioctl V2 Tristan Ye
2010-11-16 10:13 ` [Ocfs2-devel] [PATCH 1/3] Ocfs2: Using macro to set/clear *FILLED* flags in info handler Tristan Ye
2010-12-07  1:04   ` Joel Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D47BAD9.1020509@oracle.com \
    --to=tristan.ye@oracle.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.