All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Perepechko <Andrew.Perepechko@Sun.COM>
To: Jan Kara <jack@suse.cz>
Cc: linux-fsdevel@vger.kernel.org,
	Johann Lombardi <Johann.Lombardi@Sun.COM>,
	Zhiyong Landen tian <Zhiyong.Tian@Sun.COM>,
	Alex Lyashkov <Alexey.Lyashkov@Sun.COM>
Subject: Re: [RFC] quota: 64-bit limits with vfs
Date: Mon, 10 Mar 2008 20:13:10 +0300	[thread overview]
Message-ID: <200803102013.11097.andrew.perepechko@sun.com> (raw)
In-Reply-To: <20080310162609.GA30435@duck.suse.cz>

Hello, Jan.

I agree with your comments except for the one below.

Why do you think these macros don't do the right thing?
How can they fail? I can't agree with you that introducing
separate functions for id/time and duplicating code in 
disk2memdqblk and mem2diskdqblk is more nice than using
several uniform macros(why aren't the latter nice, btw?). 
Wasn't that you who told me that code duplication is no good? ;)

Thank you for your patience.
Andrew.

On Monday 10 March 2008 19:26:09 Jan Kara wrote:

> > +#define DQ2MQ(v) (sizeof(v) == sizeof(__u64) ? \
> > +		  (qsize_t)le64_to_cpu(v) : \
> > +		  (qsize_t)le32_to_cpu(v))
> > +
> > +#define MQ2DQ(v, newv) (sizeof(v) == sizeof(__u64) ? \
> > +			(v = cpu_to_le64((__u64)newv)) : \
> > +			(v = cpu_to_le32((__u32)newv)))
> > +
> > +#define DQF_GET(var, rev, field) (rev == 0 ? \
> > +		DQ2MQ((var)->disk_dqblk_r0.field) : \
> > +		DQ2MQ((var)->disk_dqblk_r1.field))
> > +
> > +#define DQF_PUT(var, rev, field, val) (rev == 0 ? \
> > +		MQ2DQ((var)->disk_dqblk_r0.field, val) : \
> > +		MQ2DQ((var)->disk_dqblk_r1.field, val))
>   Actually, these macros will do the right thing for dqb_id only be sheer
> luck and they won't work for dqb_curspace, dqb_itime and dqb_btime.
>   Please just get rid of them, they aren't very nice anyway. In disk2memdqb()
> and mem2diskdqb() just do
> 
>   if (rev == 0) {
> 	conversions..
>   }
>   else if (ret == 1) {
> 	conversions..
>   }
>   else {
> 	BUG();
>   }
> 
>   And for fields dqb_id and dqb_itime we use at other places introduce
> functions get_dqb_id() and get/set_dqb_itime().
> 

  reply	other threads:[~2008-03-10 17:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 13:41 [RFC] quota: 64-bit limits with vfs Andrew Perepechko
2008-03-06 14:48 ` Jan Kara
2008-03-09 22:46   ` Andrew Perepechko
2008-03-10 16:26     ` Jan Kara
2008-03-10 17:13       ` Andrew Perepechko [this message]
2008-03-10 17:20         ` Jan Kara
2008-03-14 13:08           ` Andrew Perepechko
2008-03-15  4:23             ` Andreas Dilger
2008-03-15 13:24               ` Andrew Perepechko
2008-03-15 13:32                 ` Andrew Perepechko
2008-03-15 14:45                 ` Andreas Dilger
2008-03-15 18:58                   ` [RFC] quota: 64-bit limits with vfs, updated Andrew Perepechko
2008-03-15 22:47                     ` Andreas Dilger
2008-03-16  1:14                       ` Andrew Perepechko
2008-03-16 11:21                         ` Andrew Perepechko
2008-03-17 14:35                           ` Jan Kara
2008-03-20 21:37                             ` Andrew Perepechko
2008-03-21  1:04                               ` Andreas Dilger
2008-03-21  9:14                                 ` Andrew Perepechko
2008-03-21 10:24                                   ` Andrew Perepechko
2008-03-17 14:51                         ` Jan Kara

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=200803102013.11097.andrew.perepechko@sun.com \
    --to=andrew.perepechko@sun.com \
    --cc=Alexey.Lyashkov@Sun.COM \
    --cc=Johann.Lombardi@Sun.COM \
    --cc=Zhiyong.Tian@Sun.COM \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    /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.