Re: [-mm patch] unionfs: make functions static

Satyam Sharma
2007-07-02T02:21:47Z

Hi,

[ Cc:'s trimmed ]

On 7/2/07, Josef Sipek <jsipek@fsl.cs.sunysb.edu> wrote:
> On Sun, Jul 01, 2007 at 10:23:30PM +0200, Adrian Bunk wrote:
> > This patch makes some needlessly global functions static.
> >
> ...
> > --- linux-2.6.22-rc6-mm1/fs/unionfs/lookup.c.old 2007-07-01 00:05:02.000000000 +0200
> > +++ linux-2.6.22-rc6-mm1/fs/unionfs/lookup.c 2007-07-01 00:06:05.000000000 +0200
> > @@ -18,6 +18,8 @@
> >
> > #include "union.h"
> >
> > +static int realloc_dentry_private_data(struct dentry *dentry);
> > +
> > /* is the filename valid == !(whiteout for a file or opaque dir marker) */
>
> I forget who said it, but someone wasn't very happy with prototypes like
> that in .c files. What's the prefered way - are they ok for static symbols?

The preferred way is to push static functions' definitions above the
callsites (caller functions) in the same file, if possible.
Perhaps Adrian was in a hurry so didn't do that ...

Satyam