summaryrefslogtreecommitdiff
path: root/fs/devfs
diff options
context:
space:
mode:
authorAndries E. Brouwer <andries.brouwer@cwi.nl>2003-05-25 04:04:50 -0700
committerJaroslav Kysela <perex@suse.cz>2003-05-25 04:04:50 -0700
commit2f124a73c7e036388e2e998c8ae1abf9d0b3204a (patch)
tree5d1014d03ebc7952529e11b7a88d782c033aee7d /fs/devfs
parent4b6243ca36127091c17dba9dff98ba46f619f506 (diff)
[PATCH] change get_sb prototype
(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.
Diffstat (limited to 'fs/devfs')
-rw-r--r--fs/devfs/base.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 6ca2544a5322..5e6374bc8d20 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -2554,8 +2554,9 @@ out_no_root:
return -EINVAL;
} /* End Function devfs_fill_super */
-static struct super_block *devfs_get_sb (struct file_system_type *fs_type,
- int flags, char *dev_name, void *data)
+static struct super_block *
+devfs_get_sb (struct file_system_type *fs_type, int flags,
+ const char *dev_name, void *data)
{
return get_sb_single (fs_type, flags, data, devfs_fill_super);
}