mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ray Lee <ray-lk@madrabbit.org>
Cc: mpm@selenic.com, linux-kernel@vger.kernel.org
Subject: Re: 2.6.5-mm1 [PATCH]
Date: Sun, 4 Apr 2004 23:55:26 -0700	[thread overview]
Message-ID: <20040404235526.09ff3c39.akpm@osdl.org> (raw)
In-Reply-To: <1081147276.1374.13.camel@orca.madrabbit.org>

Ray Lee <ray-lk@madrabbit.org> wrote:
>
> Could I suggest an alternate version, below? It limits the knowledge of
>  the CONFIG_QUOTA option to the quota header file, and still shrinks the
>  inode by two pointers. The only functional difference between this and
>  Matt Mackall's version is the below will still leave in a call to
>  memset, but with a zero length. On the plus side, it keeps fs/inode.c
>  free of preprocessor noise, which seems worth the trade-off.
> 
>   quota.h |    4 ++++
>   1 files changed, 4 insertions(+)
> 
>  diff -NurX ../dontdiff linus-2.6/include/linux/quota.h linus-2.6-inode-shrinkage/include/linux/quota.h
>  --- linus-2.6/include/linux/quota.h	2004-04-03 08:46:35.000000000 -0800
>  +++ linus-2.6-inode-shrinkage/include/linux/quota.h	2004-04-03 08:45:19.000000000 -0800
>  @@ -57,7 +57,11 @@
>   #define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
>   #define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
>   
>  +#ifdef CONFIG_QUOTA
>   #define MAXQUOTAS 2
>  +#else
>  +#define MAXQUOTAS 0
>  +#endif

The advantage of the ifdeffy one is that if someone accesses i_dquot
outside CONFIG_QUOTA, they get a compile failure rather than runtime inode
corruption.

  reply	other threads:[~2004-04-05  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-05  6:41 Ray Lee
2004-04-05  6:55 ` Andrew Morton [this message]
2004-04-05  7:19   ` Ray Lee

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=20040404235526.09ff3c39.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=ray-lk@madrabbit.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

all inboxes | Powered by JetHome®