From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@panasas.com>,
"J. Bruce Fields" <bfields@citi.umich.edu>,
pNFS Mailing List <pnfs@linux-nfs.org>,
NFS list <linux-nfs@vger.kernel.org>,
Andy Adamson <andros@netapp.com>
Subject: Re: [PATCH 2/5] nfsd: Fix independence of a few nfsd related headers
Date: Thu, 22 Oct 2009 10:02:26 -0400 [thread overview]
Message-ID: <1256220146.6402.23.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <4AE01569.9000002@panasas.com>
On Thu, 2009-10-22 at 10:18 +0200, Boaz Harrosh wrote:
> On 10/22/2009 02:28 AM, Trond Myklebust wrote:
> > On Wed, 2009-10-21 at 10:14 +0200, Boaz Harrosh wrote:
> >> An header should be compilation independent, .i.e pull in
> >> any header who's declarations are directly used by this header.
> >> And not let users re-include all it's dependencies all over
> >> again.
> >>
> >> [At the end of the day what's the use of a header if it does
> >> not have more then one user?]
> >
> >
> > The problem with this is that you quickly end up including the same
> > header files over and over and over again as they get pulled in several
> > times over by different headers.
> >
> >
> >
>
> What is the problem with that?
>
> two things:
> 1. it is unavoidable.
> 2. That's why we invented the #ifndef FOO_H #define FOO_H for.
> 3. Look at the current mess, to the point that you don't understand why
> the code does not compile, you end up just copy-past the include list
> of that other file, and now actually do end with extra un-needed includes.
> (Don't believe me look at the last patch as proof).
> 4. So I add to an header a use of a type that now needs a new include.
> All my users do not compile any more. What to do? OK I'll include it so
> not to change all existing users all over again. Now we get a double
> standard. All headers used before any users, must be carried around.
> The late comers are escaped.
> 5. The opposite of 4. An header is no longer needed. Extra header left at all
> users.
>
> It used to be a problem before me and you have begun programing.
> Since then the cpp looks at it's internal structures and will not re-open.
> Note that the compiler never sees the second instance, ever.
>
> That said we have no choice of the matter. It is a Kernel style guide. I
> should know because I was banged on the head with it a couple of times.
> And rightly so.
>
> Come on that was a joke right
> Boaz
No. What I'm saying is that this doesn't have to be an absolute rule.
The Kernel style guide assumes that everything in 'include/*' is going
to be exported all around the kernel.
The problem is that we put a lot of stuff which is private to fs/nfs and
fs/nfsd in there. Those header files do not have to absolutely follow
the style guide rule, 'cos we know what is being included before and
after them...
Cheers
Trond
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
next prev parent reply other threads:[~2009-10-22 14:02 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 8:10 [PATCHSET 0/5] nfsd: Cleanup nfsd/pnfsd headers and code placment Boaz Harrosh
2009-10-21 8:11 ` [PATCH 1/5] sunrpc: Clean never used include files Boaz Harrosh
2009-10-21 12:54 ` [pnfs] " Boaz Harrosh
2009-10-21 13:26 ` [PATCH version2] " Boaz Harrosh
2009-10-21 8:14 ` [PATCH 2/5] nfsd: Fix independence of a few nfsd related headers Boaz Harrosh
2009-10-22 0:28 ` Trond Myklebust
[not found] ` <1256171298.6809.1.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-10-22 8:18 ` Boaz Harrosh
2009-10-22 10:14 ` Benny Halevy
2009-10-22 14:02 ` Trond Myklebust [this message]
[not found] ` <1256220146.6402.23.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-10-22 15:59 ` Boaz Harrosh
2009-11-04 22:09 ` J. Bruce Fields
2009-11-05 8:48 ` Boaz Harrosh
2009-11-05 16:33 ` J. Bruce Fields
2009-11-05 16:41 ` J. Bruce Fields
2009-11-05 16:59 ` Trond Myklebust
[not found] ` <1257440343.3114.7.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-11-05 17:03 ` J. Bruce Fields
2009-11-05 17:06 ` Trond Myklebust
2009-11-11 14:57 ` Boaz Harrosh
2009-11-11 17:36 ` J. Bruce Fields
2009-11-11 17:59 ` Boaz Harrosh
2009-11-11 18:06 ` J. Bruce Fields
2009-11-12 10:28 ` [pnfs] " Boaz Harrosh
2009-11-12 10:35 ` Trond Myklebust
[not found] ` <1258022133.2973.5.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-11-12 12:48 ` Boaz Harrosh
2009-11-12 13:07 ` Benny Halevy
2009-11-12 13:36 ` Trond Myklebust
[not found] ` <1258033010.2968.12.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-11-12 14:45 ` Boaz Harrosh
2009-10-21 8:14 ` [PATCH 3/5] nfsd: Fix independence of linux/nfsd/ headers Boaz Harrosh
2009-10-21 8:15 ` [PATCH 4/5] SQUASHME pnfsd: Move pnfsd code out of nfs4state.c/h Boaz Harrosh
2009-11-03 6:30 ` Benny Halevy
2009-10-21 8:16 ` [PATCH 5/5] nfsd: Remove lots of un-needed includes Boaz Harrosh
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=1256220146.6402.23.camel@heimdal.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=andros@netapp.com \
--cc=bfields@citi.umich.edu \
--cc=bhalevy@panasas.com \
--cc=bharrosh@panasas.com \
--cc=linux-nfs@vger.kernel.org \
--cc=pnfs@linux-nfs.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