• Andries E. Brouwer's avatar
    [PATCH] change get_sb prototype · 2f124a73
    Andries E. Brouwer authored
    (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.
    
    If I am not mistaken, precisely two filesystems do not treat this
    argument as a constant, namely afs and cifs. A separate patch
    gives some cleanup there.
    2f124a73
msdosfs_syms.c 1.15 KB