In order to support filehandle lookup in filesystems with internal mounts (multiple subvols in the one filesystem) reconnect_path() in exportfs will need to find out if a given dentry is already mounted. This can be done with the function lookup_mnt(), so export that to make it available. Signed-off-by: NeilBrown <neilb@xxxxxxx> --- fs/internal.h | 1 - fs/namespace.c | 1 + include/linux/mount.h | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/internal.h b/fs/internal.h index 3ce8edbaa3ca..0feb2722d2e5 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -81,7 +81,6 @@ int do_renameat2(int olddfd, struct filename *oldname, int newdfd, /* * namespace.c */ -extern struct vfsmount *lookup_mnt(const struct path *); extern int finish_automount(struct vfsmount *, struct path *); extern int sb_prepare_remount_readonly(struct super_block *); diff --git a/fs/namespace.c b/fs/namespace.c index 81b0f2b2e701..73bbdb921e24 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -662,6 +662,7 @@ struct vfsmount *lookup_mnt(const struct path *path) rcu_read_unlock(); return m; } +EXPORT_SYMBOL(lookup_mnt); static inline void lock_ns_list(struct mnt_namespace *ns) { diff --git a/include/linux/mount.h b/include/linux/mount.h index 5d92a7e1a742..1d3daed88f83 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -118,6 +118,8 @@ extern unsigned int sysctl_mount_max; extern bool path_is_mountpoint(const struct path *path); +extern struct vfsmount *lookup_mnt(const struct path *); + extern void kern_unmount_array(struct vfsmount *mnt[], unsigned int num); #endif /* _LINUX_MOUNT_H */