From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>
Cc: ext2-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [2.6 patch] fs/ext2/bitmap.c: ext2_count_free() is only required #ifdef EXT2FS_DEBUG
Date: Fri, 18 Nov 2005 04:33:45 +0100 [thread overview]
Message-ID: <20051118033345.GW11494@stusta.de> (raw)
In-Reply-To: <20050513224004.3f68a1e8.akpm@osdl.org>
On Fri, May 13, 2005 at 10:40:04PM -0700, Andrew Morton wrote:
> Adrian Bunk <bunk@stusta.de> wrote:
> >
> > --- linux-2.6.12-rc2-mm3-full/fs/ext2/ext2.h.old 2005-04-20 23:08:52.000000000 +0200
> > +++ linux-2.6.12-rc2-mm3-full/fs/ext2/ext2.h 2005-04-20 23:14:21.000000000 +0200
> > @@ -1,5 +1,6 @@
> > #include <linux/fs.h>
> > #include <linux/ext2_fs.h>
> > +#include <linux/buffer_head.h>
> >
> > /*
> > * second extended file system inode data in memory
> > @@ -79,6 +80,22 @@
> > return container_of(inode, struct ext2_inode_info, vfs_inode);
> > }
> >
> > +static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
> > +
>
> This will cause a copy of `nibblemap' to be included in each compilation
> unit which uses ext2.h. Unless the compiler is sufficiently smart to elide
> it, which it might be. But then it might be sufficiently smart to generate
> a "you're not usig this" warning too.
>
> If it's only needed for EXT2_DEBUG then I'd be inclined to move it into one
> of the other .c files, inside EXT2_DEBUG. Or just leave it as-is.
Patch below.
cu
Adrian
<-- snip -->
There's no need for ext2_count_free() #ifndef EXT2FS_DEBUG.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
fs/ext2/bitmap.c | 7 +++++++
1 file changed, 7 insertions(+)
--- linux-2.6.15-rc1-mm1-full/fs/ext2/bitmap.c.old 2005-11-18 02:48:33.000000000 +0100
+++ linux-2.6.15-rc1-mm1-full/fs/ext2/bitmap.c 2005-11-18 02:50:16.000000000 +0100
@@ -7,8 +7,12 @@
* Universite Pierre et Marie Curie (Paris VI)
*/
+#ifdef EXT2FS_DEBUG
+
#include <linux/buffer_head.h>
+#include "ext2.h"
+
static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
unsigned long ext2_count_free (struct buffer_head * map, unsigned int numchars)
@@ -23,3 +27,6 @@
nibblemap[(map->b_data[i] >> 4) & 0xf];
return (sum);
}
+
+#endif /* EXT2FS_DEBUG */
+
prev parent reply other threads:[~2005-11-18 3:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-13 0:47 [RFC: 2.6 patch] ext2: make ext2_count_free a static inline Adrian Bunk
2005-05-14 5:40 ` Andrew Morton
2005-05-16 18:51 ` Adrian Bunk
2005-11-18 3:33 ` Adrian Bunk [this message]
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=20051118033345.GW11494@stusta.de \
--to=bunk@stusta.de \
--cc=akpm@osdl.org \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@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