Re: [patch] change get_sb prototype

viro@parcelfarce.linux.theplanet.co.uk
Mon, 26 May 2003 02:02:41 +0100


On Mon, May 26, 2003 at 02:39:59AM +0200, Andries.Brouwer@cwi.nl 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/