Re: [PATCH] use seq_file for /proc/swaps

Christoph Hellwig (hch@infradead.org)
Wed, 30 Oct 2002 16:29:24 +0000


On Tue, Oct 29, 2002 at 10:12:59PM -0800, Randy.Dunlap wrote:
> Are you and/or Greg U. going to do a CONFIG_SWAP option?

Yes. It's already in -ac.

> I moved the proc_swaps_operations to swapfile.c like you asked.
> I like that part of this patch.
> But it makes more sense to me to move the create_seq_entry() call
> to mm/swap.c:: in its __init swap_setup() function
> (or add another __init function in swapfile.c to do this ?).

Despite it's name swap.c has absolutely nothing to do with
swapping :) So please add another initfunc to swapfile.c.

> That meant that I had to duplicate create_seq_entry() or
> export it. For now I have duplicated it, and that would make
> 3 copies of it in the kernel -- and that's bad IMO, so it would
> need to be exported (but I didn't do that for now).

Not sure whether that three lines of code are really worth exporting :)

> And there's the question of __init ordering: when will the __init
> function mm/swap.c::swap_setup(), calling create_seq_entry(),
> happen in relation to create_proc_entry() being ready to work?

create_proc_entry() works as soon as kmalloc() works, i.e. it's fine
for all initcalls.`

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/