linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Andrew Perepechko <Andrew.Perepechko@sun.com>
Cc: Jan Kara <jack@suse.cz>,
	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, updated
Date: Fri, 21 Mar 2008 09:04:03 +0800	[thread overview]
Message-ID: <20080321010403.GA2971@webber.adilger.int> (raw)
In-Reply-To: <200803210037.38094.andrew.perepechko@sun.com>

On Mar 21, 2008  00:37 +0300, Andrew Perepechko wrote:
> +#define REV_ASSERT(r) BUG_ON((rev) != 0 && (rev) != 1)

Umm, "r" and "rev" are not consistent above...

Since this assertion is only on the in-memory quota structure, it would
probably be better to have something like

#define REV_R0  0x12340000
#define REV_R1  0x12340001

and when unpacking the on-disk revision number or it with REV_OFFSET and

#define REV_ASSERT(revno) BUG_ON((revno) != REV_R0 && (revno) != REV_R1)

That detects the common case of memory being zeroed for some reason.  It
will also easily detect if you aren't properly swabbing the revision
and unmasking the 0x1234000 from the in-memory structure.

Just a thought...  some people may not like this idea, but I dislike
using "0" as a magic number for anything.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.


  reply	other threads:[~2008-03-21  1:04 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
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 [this message]
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=20080321010403.GA2971@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=Alexey.Lyashkov@sun.com \
    --cc=Andrew.Perepechko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).