public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Christoph Hellwig <hch@lst.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] more procfs bits for !CONFIG_MMU
Date: Wed, 1 Jan 2003 23:58:42 +0000	[thread overview]
Message-ID: <20030101235842.A3044@infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0301011539070.12809-100000@home.transmeta.com>; from torvalds@transmeta.com on Wed, Jan 01, 2003 at 03:43:05PM -0800

On Wed, Jan 01, 2003 at 03:43:05PM -0800, Linus Torvalds wrote:
> 
> On Thu, 2 Jan 2003, Christoph Hellwig wrote:
> >
> > To avoid ifdef hell I extented the task_foo() abstraction already
> > present in array.c a bit and the actual implementations now live
> > in task_mmu.c and task_nommu.c.
> 
> Please do "proc_mmu.c" and "proc_nommu.c", and move the non-task-related 
> parts there too (ie move "pid_maps_read()" there too, and just make the 
> no-mmu version of it be empty or whatever, ok?)

I can add an empty stub function, but that doesn't help to reduce the
ifdef mess as there is no /proc/<pid>/maps on nommu at all so we don't
have the struct file_operations and more important can't register it.

Maybe I need to make adding new entries for /proc/<pid>/ dynamic so
proc_mmu.c can just call

	create_proc_pid_entry("stats", &proc_maps_operations, ...)

> > --- 1.4/fs/proc/Makefile	Sat Dec 14 07:38:56 2002
> > +++ edited/fs/proc/Makefile	Wed Jan  1 13:45:28 2003
> > @@ -9,6 +9,12 @@
> >  proc-objs    := inode.o root.o base.o generic.o array.o \
> >  		kmsg.o proc_tty.o proc_misc.o kcore.o
> >  
> > +ifeq ($(CONFIG_MMU),y)
> > +proc-objs    += task_mmu.o
> > +else
> > +proc-objs    += task_nommu.o
> > +endif
> 
> Isn't it much nicer to just write this something like
> 
> 	proc-mmu-y = proc_mmu.o
> 	proc-mmu-n = proc_nommu.o
> 
> 	obj-y += $(proc-mmu-$(CONFIG_MMU))
> 
> instead, and avoid conditionals?

Could be done.  Maybe Kai even has an even nicer generic version? :)
The new makefiles really need some docs..


  reply	other threads:[~2003-01-01 23:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-01 23:05 [PATCH] more procfs bits for !CONFIG_MMU Christoph Hellwig
2003-01-01 23:43 ` Linus Torvalds
2003-01-01 23:58   ` Christoph Hellwig [this message]
2003-01-02  0:32     ` Linus Torvalds
2003-01-02 16:29     ` Sam Ravnborg
2003-01-02 16:35       ` Christoph Hellwig
2003-01-02 16:49         ` Sam Ravnborg
2003-01-02 16:51           ` Christoph Hellwig
2003-01-15 16:11   ` Christoph Hellwig

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=20030101235842.A3044@infradead.org \
    --to=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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