diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-06-05 04:00:05 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-06-05 04:00:05 +0200 |
commit | cbd76edeabd5ed078391abb2323b7aee790cdc04 (patch) | |
tree | ccf3af333f203cfd1f54fb14b0b5666ba5b76862 /include | |
parent | Merge tag 'pull-18-rc1-work.fd' of git://git.kernel.org/pub/scm/linux/kernel/... (diff) | |
parent | move mount-related externs from fs.h to mount.h (diff) | |
download | linux-cbd76edeabd5ed078391abb2323b7aee790cdc04.tar.xz linux-cbd76edeabd5ed078391abb2323b7aee790cdc04.zip |
Merge tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull mount handling updates from Al Viro:
"Cleanups (and one fix) around struct mount handling.
The fix is usermode_driver.c one - once you've done kern_mount(), you
must kern_unmount(); simple mntput() will end up with a leak. Several
failure exits in there messed up that way... In practice you won't hit
those particular failure exits without fault injection, though"
* tag 'pull-18-rc1-work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
move mount-related externs from fs.h to mount.h
blob_to_mnt(): kern_unmount() is needed to undo kern_mount()
m->mnt_root->d_inode->i_sb is a weird way to spell m->mnt_sb...
linux/mount.h: trim includes
uninline may_mount() and don't opencode it in fspick(2)/fsopen(2)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 11 | ||||
-rw-r--r-- | include/linux/mount.h | 29 |
2 files changed, 17 insertions, 23 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index d5ae3f3767b2..9ad5e3520fae 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2469,22 +2469,11 @@ struct super_block *sget(struct file_system_type *type, extern int register_filesystem(struct file_system_type *); extern int unregister_filesystem(struct file_system_type *); -extern struct vfsmount *kern_mount(struct file_system_type *); -extern void kern_unmount(struct vfsmount *mnt); -extern int may_umount_tree(struct vfsmount *); -extern int may_umount(struct vfsmount *); -extern long do_mount(const char *, const char __user *, - const char *, unsigned long, void *); -extern struct vfsmount *collect_mounts(const struct path *); -extern void drop_collected_mounts(struct vfsmount *); -extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, - struct vfsmount *); extern int vfs_statfs(const struct path *, struct kstatfs *); extern int user_statfs(const char __user *, struct kstatfs *); extern int fd_statfs(int, struct kstatfs *); extern int freeze_super(struct super_block *super); extern int thaw_super(struct super_block *super); -extern bool our_mnt(struct vfsmount *mnt); extern __printf(2, 3) int super_setup_bdi_name(struct super_block *sb, char *fmt, ...); extern int super_setup_bdi(struct super_block *sb); diff --git a/include/linux/mount.h b/include/linux/mount.h index 7f18a7555dff..55a4abaf6715 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -11,17 +11,15 @@ #define _LINUX_MOUNT_H #include <linux/types.h> -#include <linux/list.h> -#include <linux/nodemask.h> -#include <linux/spinlock.h> -#include <linux/seqlock.h> -#include <linux/atomic.h> +#include <asm/barrier.h> struct super_block; -struct vfsmount; struct dentry; -struct mnt_namespace; +struct user_namespace; +struct file_system_type; struct fs_context; +struct file; +struct path; #define MNT_NOSUID 0x01 #define MNT_NODEV 0x02 @@ -81,9 +79,6 @@ static inline struct user_namespace *mnt_user_ns(const struct vfsmount *mnt) return smp_load_acquire(&mnt->mnt_userns); } -struct file; /* forward dec */ -struct path; - extern int mnt_want_write(struct vfsmount *mnt); extern int mnt_want_write_file(struct file *file); extern void mnt_drop_write(struct vfsmount *mnt); @@ -94,12 +89,10 @@ extern struct vfsmount *mnt_clone_internal(const struct path *path); extern bool __mnt_is_readonly(struct vfsmount *mnt); extern bool mnt_may_suid(struct vfsmount *mnt); -struct path; extern struct vfsmount *clone_private_mount(const struct path *path); extern int __mnt_want_write(struct vfsmount *); extern void __mnt_drop_write(struct vfsmount *); -struct file_system_type; extern struct vfsmount *fc_mount(struct fs_context *fc); extern struct vfsmount *vfs_create_mount(struct fs_context *fc); extern struct vfsmount *vfs_kern_mount(struct file_system_type *type, @@ -115,6 +108,18 @@ extern void mark_mounts_for_expiry(struct list_head *mounts); extern dev_t name_to_dev_t(const char *name); extern bool path_is_mountpoint(const struct path *path); +extern bool our_mnt(struct vfsmount *mnt); + +extern struct vfsmount *kern_mount(struct file_system_type *); +extern void kern_unmount(struct vfsmount *mnt); +extern int may_umount_tree(struct vfsmount *); +extern int may_umount(struct vfsmount *); +extern long do_mount(const char *, const char __user *, + const char *, unsigned long, void *); +extern struct vfsmount *collect_mounts(const struct path *); +extern void drop_collected_mounts(struct vfsmount *); +extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, + struct vfsmount *); extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num); #endif /* _LINUX_MOUNT_H */ |