From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Oleg Verych <olecom@flower.upol.cz>
Subject: Re: [RFC 6/7] Use an external declaration in exit.c for fs_cachep
Date: Sat, 18 Nov 2006 17:53:40 +1100 [thread overview]
Message-ID: <20061118175340.2e98966d.sfr@canb.auug.org.au> (raw)
In-Reply-To: <slrneltauh.dd3.olecom@flower.upol.cz>
[-- Attachment #1: Type: text/plain, Size: 1083 bytes --]
On Sat, 18 Nov 2006 06:44:33 +0000 Oleg Verych <olecom@flower.upol.cz> wrote:
>
>
> On 2006-11-18, Stephen Rothwell wrote:
> []
> >> --- linux-2.6.19-rc5-mm2.orig/kernel/exit.c 2006-11-15 16:48:11.485511089 -0600
> >> +++ linux-2.6.19-rc5-mm2/kernel/exit.c 2006-11-17 23:04:09.764530373 -0600
> >> @@ -48,6 +48,8 @@
> >> #include <asm/pgtable.h>
> >> #include <asm/mmu_context.h>
> >>
> >> +extern kmem_cache_t *fs_cachep;
> >
> > You know what I am going to say, right? :-)
>
> I know, externs must be in headers. Please, explain why.
So that there is only one declaration. That way if it is changed,
everywhere that uses it will notice. Also, the same header must be
included by the file that defines the variable or function so any
discrepancy between declaration and definition will be obvious.
i.e. we are protecting ourselves against change and making maintainance
easier.
In this particular case, the type is probably never going to change, but
consistency is good.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-11-18 6:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-18 5:43 [RFC 0/7] Remove slab cache declarations in slab.h Christoph Lameter
2006-11-18 5:43 ` [RFC 1/7] Remove declaration of sighand_cachep from slab.h Christoph Lameter
2006-11-18 6:27 ` Stephen Rothwell
2006-11-18 6:51 ` SCSI init discussion/SAN problem Evan Rempel
2006-11-20 16:20 ` [RFC 1/7] Remove declaration of sighand_cachep from slab.h Christoph Lameter
2006-11-21 8:07 ` Andrew Morton
2006-11-21 19:36 ` Christoph Lameter
2006-11-21 19:49 ` Andrew Morton
2006-11-21 19:56 ` Christoph Lameter
2006-11-21 20:07 ` Andrew Morton
2006-11-18 5:43 ` [RFC 2/7] Remove bio_cachep " Christoph Lameter
2006-11-18 5:43 ` [RFC 3/7] Move vm_area_cachep to mm.h Christoph Lameter
2006-11-18 5:44 ` [RFC 4/7] Move files_cachep to file.h Christoph Lameter
2006-11-21 8:09 ` Andrew Morton
2006-11-18 5:44 ` [RFC 5/7] Use external declaration for filep_cachep Christoph Lameter
2006-11-18 6:31 ` Stephen Rothwell
2006-11-20 16:20 ` Christoph Lameter
2006-11-18 5:44 ` [RFC 6/7] Use an external declaration in exit.c for fs_cachep Christoph Lameter
2006-11-18 6:32 ` Stephen Rothwell
2006-11-18 6:37 ` Oleg Verych
2006-11-18 6:53 ` Stephen Rothwell [this message]
2006-11-20 16:21 ` Christoph Lameter
2006-11-18 5:44 ` [RFC 7/7] Move names_cachep to fs.h Christoph Lameter
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=20061118175340.2e98966d.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=olecom@flower.upol.cz \
/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®