* Purpose of GLOBAL_EXTERN macro
@ 2011-10-11 9:40 Suresh Jayaraman
[not found] ` <4E940EF9.7030603-IBi9RG/b67k@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Suresh Jayaraman @ 2011-10-11 9:40 UTC (permalink / raw)
To: Steve French, linux-cifs
I bumped into the GLOBAL_EXTERN macro in the cifs code. I'm not sure I
understand the purpose of this. Can someone explain why we need this
instead of simply using "extern"?
Thanks
Suresh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Purpose of GLOBAL_EXTERN macro
[not found] ` <4E940EF9.7030603-IBi9RG/b67k@public.gmane.org>
@ 2011-10-11 11:08 ` Jeff Layton
[not found] ` <20111011070821.6c153d53-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Layton @ 2011-10-11 11:08 UTC (permalink / raw)
To: Suresh Jayaraman; +Cc: Steve French, linux-cifs
On Tue, 11 Oct 2011 15:10:09 +0530
Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org> wrote:
> I bumped into the GLOBAL_EXTERN macro in the cifs code. I'm not sure I
> understand the purpose of this. Can someone explain why we need this
> instead of simply using "extern"?
>
I've never been quite sure what that's all about either. I think the
idea was to allow you to put global declarations in an include file but
then have only one .c file actually do them?
Seems like there was a patch to remove it a few years ago, but Steve
never merged it for some reason...
In any case, I agree with akpm's thoughts on the matter:
https://lkml.org/lkml/2008/11/14/367
--
Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Purpose of GLOBAL_EXTERN macro
[not found] ` <20111011070821.6c153d53-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
@ 2011-10-11 14:17 ` Steve French
0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2011-10-11 14:17 UTC (permalink / raw)
To: Jeff Layton; +Cc: Suresh Jayaraman, linux-cifs
On Tue, Oct 11, 2011 at 6:08 AM, Jeff Layton <jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org> wrote:
> On Tue, 11 Oct 2011 15:10:09 +0530
> Suresh Jayaraman <sjayaraman-IBi9RG/b67k@public.gmane.org> wrote:
>
>> I bumped into the GLOBAL_EXTERN macro in the cifs code. I'm not sure I
>> understand the purpose of this. Can someone explain why we need this
>> instead of simply using "extern"?
>>
>
> I've never been quite sure what that's all about either. I think the
> idea was to allow you to put global declarations in an include file but
> then have only one .c file actually do them?
>
> Seems like there was a patch to remove it a few years ago, but Steve
> never merged it for some reason...
The idea of having all of the globals in one place was an idea
borrowed from other file systems in the past. Basically,
having all of the globals in one place made it easier
to identify locking issues and make future locking changes.
We could take all of the global externs and do the equivalent, ie
(put them in cifsfs.c in one big series of defines in the beginning of
the file).
It would make cifsfs.c bigger, and perhaps a little harder to read,
but otherwise would do the same thing. If it weren't for the spurious sparse
warning, it would be easier. If others feel strongly about making cifsfs.c
a little longer to avoid the sparse error by removing the macro - I'll take
a patch to remove it, but not sure it matters much the code size would
be the same.
I was fairly certain that a few other file systems in Linux had a global extern
macro or equivalent, but probably removed it due to sparse throwing warnings.
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-11 14:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11 9:40 Purpose of GLOBAL_EXTERN macro Suresh Jayaraman
[not found] ` <4E940EF9.7030603-IBi9RG/b67k@public.gmane.org>
2011-10-11 11:08 ` Jeff Layton
[not found] ` <20111011070821.6c153d53-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2011-10-11 14:17 ` Steve French
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.