diff options
| author | Andries E. Brouwer <andries.brouwer@cwi.nl> | 2003-05-25 04:04:50 -0700 |
|---|---|---|
| committer | Jaroslav Kysela <perex@suse.cz> | 2003-05-25 04:04:50 -0700 |
| commit | 2f124a73c7e036388e2e998c8ae1abf9d0b3204a (patch) | |
| tree | 5d1014d03ebc7952529e11b7a88d782c033aee7d | |
| parent | 4b6243ca36127091c17dba9dff98ba46f619f506 (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.
64 files changed, 116 insertions, 113 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 133bc87505fd..03f43b68e801 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -120,7 +120,7 @@ by better scheme anyway. --------------------------- file_system_type --------------------------- prototypes: - struct super_block *(*get_sb) (struct file_system_type *, int, char *, void *); + struct super_block *(*get_sb) (struct file_system_type *, int, const char *, void *); void (*kill_sb) (struct super_block *); locking rules: may block BKL diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 2f526cadf84f..2f388460cbe7 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting @@ -51,7 +51,7 @@ success and negative number in case of error (-EINVAL unless you have more informative error value to report). Call it foo_fill_super(). Now declare struct super_block foo_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super); } diff --git a/drivers/isdn/capi/capifs.c b/drivers/isdn/capi/capifs.c index 8cdf0e65f9c6..945357b2c7c4 100644 --- a/drivers/isdn/capi/capifs.c +++ b/drivers/isdn/capi/capifs.c @@ -141,7 +141,7 @@ static int capifs_fill_super(struct super_block *s, void *data, int silent) } static struct super_block *capifs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, capifs_fill_super); } diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 869a3f5273e2..c82630ec1819 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -299,8 +299,8 @@ static int oprofilefs_fill_super(struct super_block * sb, void * data, int silen } -static struct super_block * oprofilefs_get_sb(struct file_system_type * fs_type, - int flags, char * dev_name, void * data) +static struct super_block *oprofilefs_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, oprofilefs_fill_super); } diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 53f05b670bb6..8fcd56ebb4e3 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -489,7 +489,7 @@ static void fs_remove_file (struct dentry *dentry) static struct file_system_type usbdevice_fs_type; static struct super_block *usb_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { if (fs_type == &usbdevice_fs_type) printk (KERN_INFO "Please use the 'usbfs' filetype instead, " diff --git a/fs/adfs/super.c b/fs/adfs/super.c index 14def9ef7385..d5b8294a2fa1 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -459,7 +459,7 @@ error: } static struct super_block *adfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, adfs_fill_super); } diff --git a/fs/affs/super.c b/fs/affs/super.c index 93a7cdd02ee0..61c71fe3f785 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -541,7 +541,7 @@ affs_statfs(struct super_block *sb, struct statfs *buf) } static struct super_block *affs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, affs_fill_super); } diff --git a/fs/afs/super.c b/fs/afs/super.c index 0e4603081774..f02009bf7bd6 100644 --- a/fs/afs/super.c +++ b/fs/afs/super.c @@ -40,7 +40,8 @@ static inline char *strdup(const char *s) static void afs_i_init_once(void *foo, kmem_cache_t *cachep, unsigned long flags); static struct super_block *afs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data); + int flags, const char *dev_name, + void *data); static struct inode *afs_alloc_inode(struct super_block *sb); @@ -407,10 +408,9 @@ static int afs_fill_super(struct super_block *sb, void *_data, int silent) * get an AFS superblock * - TODO: don't use get_sb_nodev(), but rather call sget() directly */ -static struct super_block *afs_get_sb(struct file_system_type *fs_type, - int flags, - char *dev_name, - void *options) +static struct super_block * +afs_get_sb(struct file_system_type *fs_type, int flags, + const char *dev_name, void *options) { struct super_block *sb; void *data[2] = { dev_name, options }; diff --git a/fs/autofs/init.c b/fs/autofs/init.c index 87744e9bee0d..b977ece69f0c 100644 --- a/fs/autofs/init.c +++ b/fs/autofs/init.c @@ -15,7 +15,7 @@ #include "autofs_i.h" static struct super_block *autofs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, autofs_fill_super); } diff --git a/fs/autofs4/init.c b/fs/autofs4/init.c index d8d9c3cf8d13..acecec8578ce 100644 --- a/fs/autofs4/init.c +++ b/fs/autofs4/init.c @@ -15,7 +15,7 @@ #include "autofs_i.h" static struct super_block *autofs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, autofs4_fill_super); } diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index c2d5ca4d16f2..5295f9d97c84 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -916,8 +916,8 @@ befs_statfs(struct super_block *sb, struct statfs *buf) } static struct super_block * -befs_get_sb(struct file_system_type *fs_type, int flags, char *dev_name, - void *data) +befs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, + void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, befs_fill_super); } diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 0aeab591b8cf..7a28495b0a87 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -379,7 +379,7 @@ out: } static struct super_block *bfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, bfs_fill_super); } diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index f00c99440b4c..bc72ed4d368e 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -621,7 +621,7 @@ static int bm_fill_super(struct super_block * sb, void * data, int silent) } static struct super_block *bm_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, bm_fill_super); } diff --git a/fs/block_dev.c b/fs/block_dev.c index 58b7813539e9..52e956455310 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -196,7 +196,7 @@ static int block_fsync(struct file *filp, struct dentry *dentry, int datasync) */ static struct super_block *bd_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_pseudo(fs_type, "bdev:", NULL, 0x62646576); } diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index d6244d17f236..f754ff70c9d2 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -57,13 +57,14 @@ unsigned int CIFSMaximumBufferSize = CIFS_MAX_MSGSIZE; struct task_struct * oplockThread = NULL; extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, - char *); + const char *); extern int cifs_umount(struct super_block *, struct cifs_sb_info *); void cifs_proc_init(void); void cifs_proc_clean(void); static int -cifs_read_super(struct super_block *sb, void *data, char *devname, int silent) +cifs_read_super(struct super_block *sb, void *data, + const char *devname, int silent) { struct inode *inode; struct cifs_sb_info *cifs_sb; @@ -251,7 +252,7 @@ struct super_operations cifs_super_ops = { static struct super_block * cifs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { int rc; struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL); diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 89fd14b85887..d74c9e601293 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -342,7 +342,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) } int -parse_mount_options(char *options, char *devname, struct smb_vol *vol) +parse_mount_options(char *options, const char *devname, struct smb_vol *vol) { char *value; char *data; @@ -795,7 +795,7 @@ ipv6_connect(struct sockaddr_in6 *psin_server, struct socket **csocket) int cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, - char *mount_data, char *devname) + char *mount_data, const char *devname) { int rc = 0; int xid; @@ -811,7 +811,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, xid = GetXid(); cFYI(1, ("Entering cifs_mount. Xid: %d with: %s", xid, mount_data)); - if(parse_mount_options(mount_data, devname, &volume_info)) { + if (parse_mount_options(mount_data, devname, &volume_info)) { FreeXid(xid); return -EINVAL; } diff --git a/fs/coda/inode.c b/fs/coda/inode.c index 2728e039f86a..03a21eb84918 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -303,7 +303,7 @@ static int coda_statfs(struct super_block *sb, struct statfs *buf) /* init_coda: used by filesystems.c to register coda */ static struct super_block *coda_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, coda_fill_super); } diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index af2c968a5571..7e7f162fc0e3 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -464,7 +464,7 @@ static struct super_operations cramfs_ops = { }; static struct super_block *cramfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, cramfs_fill_super); } 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); } diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 3f871c1fa42a..64a97888a1f1 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -73,7 +73,8 @@ static struct super_operations devpts_sops = { .remount_fs = devpts_remount, }; -static int devpts_fill_super(struct super_block *s, void *data, int silent) +static int +devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode * inode; @@ -106,7 +107,7 @@ fail: } static struct super_block *devpts_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, devpts_fill_super); } diff --git a/fs/efs/super.c b/fs/efs/super.c index 21be0cb8cb50..d3f72b95208c 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c @@ -16,7 +16,7 @@ #include <linux/vfs.h> static struct super_block *efs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, efs_fill_super); } diff --git a/fs/eventpoll.c b/fs/eventpoll.c index da1114d24455..f264bc7f3ddf 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c @@ -260,17 +260,20 @@ static int ep_remove(struct eventpoll *ep, struct epitem *epi); static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync); static int ep_eventpoll_close(struct inode *inode, struct file *file); static unsigned int ep_eventpoll_poll(struct file *file, poll_table *wait); -static int ep_collect_ready_items(struct eventpoll *ep, struct list_head *txlist, int maxevents); +static int ep_collect_ready_items(struct eventpoll *ep, + struct list_head *txlist, int maxevents); static int ep_send_events(struct eventpoll *ep, struct list_head *txlist, struct epoll_event *events); static void ep_reinject_items(struct eventpoll *ep, struct list_head *txlist); -static int ep_events_transfer(struct eventpoll *ep, struct epoll_event *events, int maxevents); -static int ep_poll(struct eventpoll *ep, struct epoll_event *events, int maxevents, - long timeout); +static int ep_events_transfer(struct eventpoll *ep, + struct epoll_event *events, int maxevents); +static int ep_poll(struct eventpoll *ep, struct epoll_event *events, + int maxevents, long timeout); static int eventpollfs_delete_dentry(struct dentry *dentry); static struct inode *ep_eventpoll_inode(void); static struct super_block *eventpollfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data); + int flags, const char *dev_name, + void *data); /* Safe wake up implementation */ @@ -1637,10 +1640,10 @@ eexit_1: } -static struct super_block *eventpollfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) +static struct super_block * +eventpollfs_get_sb(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) { - return get_sb_pseudo(fs_type, "eventpoll:", NULL, EVENTPOLLFS_MAGIC); } diff --git a/fs/ext2/super.c b/fs/ext2/super.c index dc7ced597149..48a3d099f9a0 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -989,7 +989,7 @@ static int ext2_statfs (struct super_block * sb, struct statfs * buf) } static struct super_block *ext2_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, ext2_fill_super); } diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 6d27c23210b8..272197d032a2 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -2029,7 +2029,7 @@ static int ext3_sync_dquot(struct dquot *dquot) #endif static struct super_block *ext3_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, ext3_fill_super); } diff --git a/fs/freevxfs/vxfs_super.c b/fs/freevxfs/vxfs_super.c index c3d3f301ba20..d3ebd64c780e 100644 --- a/fs/freevxfs/vxfs_super.c +++ b/fs/freevxfs/vxfs_super.c @@ -230,7 +230,7 @@ out: * The usual module blurb. */ static struct super_block *vxfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, vxfs_fill_super); } diff --git a/fs/hfs/super.c b/fs/hfs/super.c index f93f0e78789b..48be69ce4108 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -100,7 +100,7 @@ static struct super_operations hfs_super_operations = { /*================ File-local variables ================*/ static struct super_block *hfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, hfs_fill_super); } diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index aaa088d8601c..36aa38cd829a 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -637,7 +637,7 @@ bail0: } static struct super_block *hpfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, hpfs_fill_super); } diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index db0e1597caa3..a1fe7e32422f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -501,7 +501,7 @@ hugetlbfs_fill_super(struct super_block * sb, void * data, int silent) } static struct super_block *hugetlbfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, hugetlbfs_fill_super); } diff --git a/fs/intermezzo/super.c b/fs/intermezzo/super.c index be225ba1155f..82104dd3093c 100644 --- a/fs/intermezzo/super.c +++ b/fs/intermezzo/super.c @@ -187,8 +187,9 @@ static int presto_set_channel(struct presto_cache *cache, char *channel) /* We always need to remove the presto options before passing mount options to cache FS */ -struct super_block * presto_get_sb(struct file_system_type *izo_type, - int flags, char *devname, void * data) +struct super_block * +presto_get_sb(struct file_system_type *izo_type, int flags, + const char *devname, void *data) { struct file_system_type *fstype; struct presto_cache *cache = NULL; diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 9c47f2565297..b252fc2e3623 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1376,7 +1376,7 @@ void leak_check_brelse(struct buffer_head * bh){ #endif static struct super_block *isofs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, isofs_fill_super); } diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index e74ce5fc40f8..e7e6d5442774 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c @@ -1783,7 +1783,7 @@ static struct super_operations jffs_ops = }; static struct super_block *jffs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, jffs_fill_super); } diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c index bce925b6c9ab..e87cdaececb6 100644 --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c @@ -101,9 +101,9 @@ static int jffs2_sb_set(struct super_block *sb, void *data) return 0; } -static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type, - int flags, char *dev_name, - void *data, struct mtd_info *mtd) +static struct super_block * +jffs2_get_sb_mtd(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, struct mtd_info *mtd) { struct super_block *sb; struct jffs2_sb_info *c; @@ -153,9 +153,9 @@ static struct super_block *jffs2_get_sb_mtd(struct file_system_type *fs_type, return sb; } -static struct super_block *jffs2_get_sb_mtdnr(struct file_system_type *fs_type, - int flags, char *dev_name, - void *data, int mtdnr) +static struct super_block * +jffs2_get_sb_mtdnr(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data, int mtdnr) { struct mtd_info *mtd; @@ -168,8 +168,9 @@ static struct super_block *jffs2_get_sb_mtdnr(struct file_system_type *fs_type, return jffs2_get_sb_mtd(fs_type, flags, dev_name, data, mtd); } -static struct super_block *jffs2_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) +static struct super_block * +jffs2_get_sb(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) { int err; struct nameidata nd; diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 84ddb9e25483..ebb881e50ad2 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -372,8 +372,9 @@ static void jfs_unlockfs(struct super_block *sb) txResume(sb); } } -static struct super_block *jfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + +static struct super_block *jfs_get_sb(struct file_system_type *fs_type, + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, jfs_fill_super); } diff --git a/fs/libfs.c b/fs/libfs.c index f7d965e92338..932fd24707ee 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -7,8 +7,6 @@ #include <linux/mount.h> #include <linux/vfs.h> -extern struct vfsmount *do_kern_mount(const char *, int, char *, void *); - int simple_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { diff --git a/fs/minix/inode.c b/fs/minix/inode.c index aaaa4d9c3664..93005e83d319 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -554,7 +554,7 @@ void minix_truncate(struct inode * inode) } static struct super_block *minix_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, minix_fill_super); } diff --git a/fs/msdos/msdosfs_syms.c b/fs/msdos/msdosfs_syms.c index 54b493e9a2d4..29b3593fd733 100644 --- a/fs/msdos/msdosfs_syms.c +++ b/fs/msdos/msdosfs_syms.c @@ -25,7 +25,7 @@ EXPORT_SYMBOL(msdos_rmdir); EXPORT_SYMBOL(msdos_unlink); static struct super_block *msdos_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, msdos_fill_super); } diff --git a/fs/namespace.c b/fs/namespace.c index 0174d8400c9d..3ba38cc13f33 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -23,7 +23,6 @@ #include <linux/mount.h> #include <asm/uaccess.h> -extern struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data); extern int __init init_rootfs(void); extern int __init fs_subsys_init(void); @@ -39,7 +38,7 @@ static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry) return tmp & hash_mask; } -struct vfsmount *alloc_vfsmnt(char *name) +struct vfsmount *alloc_vfsmnt(const char *name) { struct vfsmount *mnt = kmem_cache_alloc(mnt_cache, GFP_KERNEL); if (mnt) { @@ -63,8 +62,7 @@ struct vfsmount *alloc_vfsmnt(char *name) void free_vfsmnt(struct vfsmount *mnt) { - if (mnt->mnt_devname) - kfree(mnt->mnt_devname); + kfree(mnt->mnt_devname); kmem_cache_free(mnt_cache, mnt); } diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 9de41ad18cbf..0744ac038279 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c @@ -955,7 +955,7 @@ int ncp_current_malloced; #endif static struct super_block *ncp_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, ncp_fill_super); } diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index b97f81b911a1..825108da3ef2 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -1192,7 +1192,7 @@ static int nfs_compare_super(struct super_block *sb, void *data) } static struct super_block *nfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *raw_data) + int flags, const char *dev_name, void *raw_data) { int error; struct nfs_server *server; @@ -1421,7 +1421,7 @@ nfs_copy_user_string(char *dst, struct nfs_string *src, int maxlen) } static struct super_block *nfs4_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *raw_data) + int flags, const char *dev_name, void *raw_data) { int error; struct nfs_server *server; diff --git a/fs/nfsctl.c b/fs/nfsctl.c index 46f0372bf2a5..12472dd2a99d 100644 --- a/fs/nfsctl.c +++ b/fs/nfsctl.c @@ -19,8 +19,6 @@ * open a file on nfsd fs */ -struct vfsmount *do_kern_mount(const char *type, int flags, char *name, void *data); - static struct file *do_open(char *name, int flags) { struct nameidata nd; diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index f5886a979e1b..93dfe60fdb3f 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -433,7 +433,7 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent) } static struct super_block *nfsd_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, nfsd_fill_super); } diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 24afa0afcb3d..475799f476ac 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -1656,7 +1656,7 @@ unsigned long ntfs_nr_mounts = 0; DECLARE_MUTEX(ntfs_lock); static struct super_block *ntfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, ntfs_fill_super); } diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index a465eedc13f6..5a1fb89449be 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -1053,7 +1053,7 @@ out_no_root: } static struct super_block *openprom_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, openprom_fill_super); } diff --git a/fs/pipe.c b/fs/pipe.c index f3d1b93f75b5..3db9e975261d 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -627,7 +627,7 @@ no_files: */ static struct super_block *pipefs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_pseudo(fs_type, "pipe:", NULL, PIPEFS_MAGIC); } diff --git a/fs/proc/root.c b/fs/proc/root.c index d49f353378df..f6b7c065a969 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -25,7 +25,7 @@ struct proc_dir_entry *proc_sys_root; #endif static struct super_block *proc_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, proc_fill_super); } diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 8c6a4dc19cd4..90f7a0034e64 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -555,7 +555,7 @@ static void destroy_inodecache(void) } static struct super_block *qnx4_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, qnx4_fill_super); } diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 15418ab4f490..372f06515900 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -192,13 +192,13 @@ static int ramfs_fill_super(struct super_block * sb, void * data, int silent) } static struct super_block *ramfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, ramfs_fill_super); } static struct super_block *rootfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super); } diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index ae31cff05cd1..4f16c0cd9f1e 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -1395,12 +1395,10 @@ static int reiserfs_statfs (struct super_block * s, struct statfs * buf) } static struct super_block* -get_super_block (struct file_system_type *fs_type, - int flags, - char *dev_name, - void *data) +get_super_block (struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) { - return get_sb_bdev (fs_type, flags, dev_name, data, reiserfs_fill_super); + return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super); } static int __init diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c index 7355ce94e60c..dd52de09689c 100644 --- a/fs/romfs/inode.c +++ b/fs/romfs/inode.c @@ -599,7 +599,7 @@ static struct super_operations romfs_ops = { }; static struct super_block *romfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, romfs_fill_super); } diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c index 46e4cba390e4..abe004b1e78f 100644 --- a/fs/smbfs/inode.c +++ b/fs/smbfs/inode.c @@ -759,7 +759,7 @@ int smb_current_vmalloced; #endif static struct super_block *smb_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, smb_fill_super); } diff --git a/fs/super.c b/fs/super.c index eba1a860a141..2aae8ed4cdcc 100644 --- a/fs/super.c +++ b/fs/super.c @@ -259,9 +259,6 @@ retry: return s; } -struct vfsmount *alloc_vfsmnt(char *name); -void free_vfsmnt(struct vfsmount *mnt); - void drop_super(struct super_block *sb) { up_read(&sb->s_umount); @@ -558,7 +555,7 @@ static int test_bdev_super(struct super_block *s, void *data) } struct super_block *get_sb_bdev(struct file_system_type *fs_type, - int flags, char *dev_name, void * data, + int flags, const char *dev_name, void *data, int (*fill_super)(struct super_block *, void *, int)) { struct block_device *bdev; @@ -663,7 +660,7 @@ struct super_block *get_sb_single(struct file_system_type *fs_type, } struct vfsmount * -do_kern_mount(const char *fstype, int flags, char *name, void *data) +do_kern_mount(const char *fstype, int flags, const char *name, void *data) { struct file_system_type *type = get_fs_type(fstype); struct super_block *sb = ERR_PTR(-ENOMEM); @@ -702,5 +699,5 @@ out: struct vfsmount *kern_mount(struct file_system_type *type) { - return do_kern_mount(type->name, 0, (char *)type->name, NULL); + return do_kern_mount(type->name, 0, type->name, NULL); } diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index 940fbcc5a805..c3e5dbe1710a 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c @@ -55,7 +55,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent) } static struct super_block *sysfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, sysfs_fill_super); } diff --git a/fs/sysv/super.c b/fs/sysv/super.c index 9bac127e5c68..baf3157204b3 100644 --- a/fs/sysv/super.c +++ b/fs/sysv/super.c @@ -497,13 +497,13 @@ failed: /* Every kernel module contains stuff like this. */ static struct super_block *sysv_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, sysv_fill_super); } static struct super_block *v7_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, v7_fill_super); } diff --git a/fs/udf/super.c b/fs/udf/super.c index e95e09fda8a8..00bfdd3d6a1b 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -99,7 +99,7 @@ static int udf_statfs(struct super_block *, struct statfs *); /* UDF filesystem type */ static struct super_block *udf_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, udf_fill_super); } diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 53029020b321..d9d96adb4672 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -1055,7 +1055,7 @@ static struct super_operations ufs_super_ops = { }; static struct super_block *ufs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, ufs_fill_super); } diff --git a/fs/vfat/vfatfs_syms.c b/fs/vfat/vfatfs_syms.c index b94296c7b786..a8bad844ea86 100644 --- a/fs/vfat/vfatfs_syms.c +++ b/fs/vfat/vfatfs_syms.c @@ -12,7 +12,7 @@ #include <linux/msdos_fs.h> static struct super_block *vfat_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, vfat_fill_super); } diff --git a/fs/xfs/linux/xfs_super.c b/fs/xfs/linux/xfs_super.c index a6821a542818..7d2662e59031 100644 --- a/fs/xfs/linux/xfs_super.c +++ b/fs/xfs/linux/xfs_super.c @@ -747,7 +747,7 @@ STATIC struct super_block * linvfs_get_sb( struct file_system_type *fs_type, int flags, - char *dev_name, + const char *dev_name, void *data) { return get_sb_bdev(fs_type, flags, dev_name, data, linvfs_fill_super); diff --git a/include/linux/fs.h b/include/linux/fs.h index de57729940ef..78b45c4afd9c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -919,7 +919,8 @@ struct file_system_type { const char *name; struct subsystem subsys; int fs_flags; - struct super_block *(*get_sb) (struct file_system_type *, int, char *, void *); + struct super_block *(*get_sb) (struct file_system_type *, int, + const char *, void *); void (*kill_sb) (struct super_block *); struct module *owner; struct file_system_type * next; @@ -927,7 +928,7 @@ struct file_system_type { }; struct super_block *get_sb_bdev(struct file_system_type *fs_type, - int flags, char *dev_name, void * data, + int flags, const char *dev_name, void *data, int (*fill_super)(struct super_block *, void *, int)); struct super_block *get_sb_single(struct file_system_type *fs_type, int flags, void *data, @@ -1117,7 +1118,7 @@ extern void sync_filesystems(int wait); extern void emergency_sync(void); extern void emergency_remount(void); extern int do_remount_sb(struct super_block *sb, int flags, - void *data, int force); + void *data, int force); extern sector_t bmap(struct inode *, sector_t); extern int setattr_mask(unsigned int); extern int notify_change(struct dentry *, struct iattr *); diff --git a/include/linux/mount.h b/include/linux/mount.h index d02e7845565a..d6996e7c7310 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -50,5 +50,10 @@ static inline void mntput(struct vfsmount *mnt) } } +extern void free_vfsmnt(struct vfsmount *mnt); +extern struct vfsmount *alloc_vfsmnt(const char *name); +extern struct vfsmount *do_kern_mount(const char *fstype, int flags, + const char *name, void *data); + #endif #endif /* _LINUX_MOUNT_H */ diff --git a/include/linux/namespace.h b/include/linux/namespace.h index acd64b4ca117..e7b313a202b6 100644 --- a/include/linux/namespace.h +++ b/include/linux/namespace.h @@ -12,9 +12,8 @@ struct namespace { struct rw_semaphore sem; }; -void umount_tree(struct vfsmount *mnt); - extern void umount_tree(struct vfsmount *); +extern int copy_namespace(int, struct task_struct *); static inline void put_namespace(struct namespace *namespace) { @@ -38,7 +37,6 @@ static inline void exit_namespace(struct task_struct *p) put_namespace(namespace); } } -extern int copy_namespace(int, struct task_struct *); static inline void get_namespace(struct namespace *namespace) { diff --git a/kernel/futex.c b/kernel/futex.c index df2dcbf557d0..5cd746c3c86c 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -545,7 +545,7 @@ asmlinkage long sys_futex(u32 __user *uaddr, int op, int val, static struct super_block * futexfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_pseudo(fs_type, "futex", NULL, 0xBAD1DEA); } diff --git a/mm/shmem.c b/mm/shmem.c index 6703b33d0458..83514240a7ef 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1647,7 +1647,8 @@ static int shmem_remount_fs(struct super_block *sb, int *flags, char *data) } #endif -static int shmem_fill_super(struct super_block *sb, void *data, int silent) +static int shmem_fill_super(struct super_block *sb, + void *data, int silent) { struct inode *inode; struct dentry *root; @@ -1814,7 +1815,7 @@ static struct vm_operations_struct shmem_vm_ops = { }; static struct super_block *shmem_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_nodev(fs_type, flags, data, shmem_fill_super); } diff --git a/net/socket.c b/net/socket.c index 4d62ac970ca6..76d29acb146a 100644 --- a/net/socket.c +++ b/net/socket.c @@ -325,7 +325,7 @@ static struct super_operations sockfs_ops = { }; static struct super_block *sockfs_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_pseudo(fs_type, "socket:", &sockfs_ops, SOCKFS_MAGIC); } diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 768d5b373fd2..abcb5ee4b890 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -749,7 +749,7 @@ out: static struct super_block * rpc_get_sb(struct file_system_type *fs_type, - int flags, char *dev_name, void *data) + int flags, const char *dev_name, void *data) { return get_sb_single(fs_type, flags, data, rpc_fill_super); } |
