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 /include/linux | |
| 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.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 7 | ||||
| -rw-r--r-- | include/linux/mount.h | 5 | ||||
| -rw-r--r-- | include/linux/namespace.h | 4 |
3 files changed, 10 insertions, 6 deletions
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) { |
