public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] proc_lookup not exported
@ 2001-04-17 23:59 Jeff Golds
  2001-04-18  0:43 ` Alexander Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Golds @ 2001-04-17 23:59 UTC (permalink / raw)
  To: linux-kernel

Hi folks.

I noticed that proc_lookup is not exported in fs/proc/procfs_syms.c but
that the function is an external in include/linux/proc_fs.h.

This patch exports the function appropriately and is against the 2.4.3
kernel tree.

*** procfs_syms.c.orig  Tue Apr 17 15:50:56 2001
--- procfs_syms.c       Tue Apr 17 15:51:19 2001
***************
*** 19,24 ****
--- 19,25 ----
  EXPORT_SYMBOL(proc_net);
  EXPORT_SYMBOL(proc_bus);
  EXPORT_SYMBOL(proc_root_driver);
+ EXPORT_SYMBOL(proc_lookup);
 
  static DECLARE_FSTYPE(proc_fs_type, "proc", proc_read_super,
FS_SINGLE);


-Jeff


-- 
Jeff Golds
jgolds@resilience.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] proc_lookup not exported
  2001-04-17 23:59 [PATCH] proc_lookup not exported Jeff Golds
@ 2001-04-18  0:43 ` Alexander Viro
  2001-04-18 16:37   ` Jeff Golds
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Viro @ 2001-04-18  0:43 UTC (permalink / raw)
  To: Jeff Golds; +Cc: linux-kernel



On Tue, 17 Apr 2001, Jeff Golds wrote:

> Hi folks.
> 
> I noticed that proc_lookup is not exported in fs/proc/procfs_syms.c but
> that the function is an external in include/linux/proc_fs.h.

Not every public function needs to be exported. proc_lookup() is
shared between different files in fs/proc/, so it can't be made
static. However, it got no business being used outside of the
fs/proc and it certainly shouldn't be used in modules.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] proc_lookup not exported
  2001-04-18  0:43 ` Alexander Viro
@ 2001-04-18 16:37   ` Jeff Golds
  2001-04-18 21:48     ` Alexander Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Golds @ 2001-04-18 16:37 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-kernel

Alexander Viro wrote:
> 
> On Tue, 17 Apr 2001, Jeff Golds wrote:
> 
> > Hi folks.
> >
> > I noticed that proc_lookup is not exported in fs/proc/procfs_syms.c but
> > that the function is an external in include/linux/proc_fs.h.
> 
> Not every public function needs to be exported. proc_lookup() is
> shared between different files in fs/proc/, so it can't be made
> static. However, it got no business being used outside of the
> fs/proc and it certainly shouldn't be used in modules.
> 

I don't see why not. I created my own mkdir and rmdir handlers in my
module.  I'd like to use the lookup function that proc supplies instead
of supplying my own, why shouldn't I be allowed to do that?  It's not as
if I am doing something other than what normally happens:  I am
assigning inode_operations::lookup to be proc_lookup.

-Jeff


-- 
Jeff Golds
jgolds@resilience.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] proc_lookup not exported
  2001-04-18 16:37   ` Jeff Golds
@ 2001-04-18 21:48     ` Alexander Viro
  2001-04-18 22:46       ` Jeff Golds
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Viro @ 2001-04-18 21:48 UTC (permalink / raw)
  To: Jeff Golds; +Cc: linux-kernel



On Wed, 18 Apr 2001, Jeff Golds wrote:

> I don't see why not. I created my own mkdir and rmdir handlers in my
> module.  I'd like to use the lookup function that proc supplies instead
> of supplying my own, why shouldn't I be allowed to do that?  It's not as
> if I am doing something other than what normally happens:  I am
> assigning inode_operations::lookup to be proc_lookup.

Use ramfs as a model; procfs is not well-suited for that sort of work.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] proc_lookup not exported
  2001-04-18 21:48     ` Alexander Viro
@ 2001-04-18 22:46       ` Jeff Golds
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Golds @ 2001-04-18 22:46 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-kernel

Alexander Viro wrote:
> 
> On Wed, 18 Apr 2001, Jeff Golds wrote:
> 
> > I don't see why not. I created my own mkdir and rmdir handlers in my
> > module.  I'd like to use the lookup function that proc supplies instead
> > of supplying my own, why shouldn't I be allowed to do that?  It's not as
> > if I am doing something other than what normally happens:  I am
> > assigning inode_operations::lookup to be proc_lookup.
> 
> Use ramfs as a model; procfs is not well-suited for that sort of work.
> 

I don't want to cause trouble, but it sure seems like the kernel source
tree could be better organized.  For example, in every C application I
have seen, global header files specify interfaces into the relevant
module and local header files are for intramodule use only.  In the
Linux kernel tree, ALL the header files are global, thus, you can't
easily tell what things are exported and what is not as you can't just
look at the header file.  Isn't this against what open source is about: 
Requiring inside knowledge about the code?

I don't understand why local header files are not used.  It's easy to
prevent people from using the wrong functions, simply make a script that
checks to see if people are including the local header files from other
modules and return an error if they are.  This could be checked at build
time.

Maybe this is all old news, I am rather new to the Linux kernel, but
perhaps this is something that could be addressed in future (2.5?)
versions of the kernel.

-Jeff

-- 
Jeff Golds
jgolds@resilience.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-04-18 22:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-17 23:59 [PATCH] proc_lookup not exported Jeff Golds
2001-04-18  0:43 ` Alexander Viro
2001-04-18 16:37   ` Jeff Golds
2001-04-18 21:48     ` Alexander Viro
2001-04-18 22:46       ` Jeff Golds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox