Re: question about kernel 2.4 ramdisk

From: David Gibson (
Date: Fri Dec 14 2001 - 00:35:59 EST

On Sat, Dec 08, 2001 at 10:53:48AM +0100, Christoph Rohland wrote:
> Hi David,
> On Thu, 6 Dec 2001, David Gibson wrote:
> > The options are different because the ramfs limits patch predates
> > shmfs.
> But tmpfs made it earlier into the kernel and if we want to merge the
> ramfs patch we should unify the options.

I know, just giving you the background.

> >> Further thought: Wouldn't it be better to add a no_swap mount
> >> option to shmem and try to merge the two? There is a lot of code
> >> duplication between mm/shmem.c and fs/ramfs/inode.c.
> >
> > Possibly. In fact the patch to fs/ramfs/inode.c will be
> > insufficient - the limits patch also requires a change to struct
> > address_space_operations in fs.h, and also a change in mm/pagemap.c.
> > shmfs applies the limits in a different way which doesn't need this, I
> > haven't looked at it enough to see how it's done - by the time shmfs
> > came around I'd moved on from the ramfs stuff.
> I thought the patch in question does it without the removepage
> operation.

Oh, so it does, I wonder who did that. Yes, I thought of doing it the
way its done there but rejected it on the grounds of ugliness - plus I
wasn't sure of some details of the VFS which meant I wasn't sure if it
would always work correctly.

> > On the other hand one of the nice things about ramfs is it's
> > simplicity and ramfs with limits is quite a bit less complex than
> > shmfs.
> But the core of shmem is always compiled. And the rest is as simple as
> ramfs...

The point of keeping ramfs simple isn't to reduce the kernel image
size, it's to keep it useful as an example of how to make a trivial

David Gibson			| For every complex problem there is a	| solution which is simple, neat and
				| wrong.  -- H.L. Mencken

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to More majordomo info at Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Dec 15 2001 - 21:00:29 EST