Re: [patch] change get_sb prototype

From: viro (viro@parcelfarce.linux.theplanet.co.uk)
Date: Sun May 25 2003 - 20:08:00 EST


On Mon, May 26, 2003 at 02:39:59AM +0200, Andries.Brouwer@xxxxxx wrote:
> The boring patch below does not change behaviour.
> It does two things:
>
> (i) The prototypes for free_vfsmnt(), alloc_vfsmnt(), do_kern_mount()
> so far occurred in several individual c files. Now they are in
> <linux/mount.h>.
>
> (ii) do_kern_mount() has a third argument name that is typically
> a constant. It is called with "rootfs", "nfsd", type->name, "capifs",
> "usbdevfs", "binfmt_misc" etc. So, it should have a prototype that
> expresses this:
>
> do_kern_mount(const char *fstype, int flags, const char *name, void *data);
>
> This makes the ugly cast
>
> - return do_kern_mount(type->name, 0, (char *)type->name, NULL);
> + return do_kern_mount(type->name, 0, type->name, NULL);
>
> go away. Now do_kern_mount() calls type->get_sb(), so also get_sb()
> must have a const third argument. That is what the patch below does.

Eeek... What for? It's _much_ easier to kill silly const char * in
struct file_system_type. And no, I don't believe that const is of any
value in that case.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/