mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-12 03:37:57 +07:00
mount options: fix hostfs
Add the "host path" option to /proc/mounts for UML hostfs filesystems. The mount source (mnt_devname) should really be used for this, but not easy to change now in a backward compatible way. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d1875dbaa5
commit
dd2cc4dff3
@ -11,6 +11,7 @@
|
|||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
#include <linux/pagemap.h>
|
#include <linux/pagemap.h>
|
||||||
#include <linux/statfs.h>
|
#include <linux/statfs.h>
|
||||||
|
#include <linux/seq_file.h>
|
||||||
#include "hostfs.h"
|
#include "hostfs.h"
|
||||||
#include "init.h"
|
#include "init.h"
|
||||||
#include "kern.h"
|
#include "kern.h"
|
||||||
@ -322,12 +323,25 @@ static void hostfs_destroy_inode(struct inode *inode)
|
|||||||
kfree(HOSTFS_I(inode));
|
kfree(HOSTFS_I(inode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
|
||||||
|
{
|
||||||
|
struct inode *root = vfs->mnt_sb->s_root->d_inode;
|
||||||
|
const char *root_path = HOSTFS_I(root)->host_filename;
|
||||||
|
size_t offset = strlen(root_ino) + 1;
|
||||||
|
|
||||||
|
if (strlen(root_path) > offset)
|
||||||
|
seq_printf(seq, ",%s", root_path + offset);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct super_operations hostfs_sbops = {
|
static const struct super_operations hostfs_sbops = {
|
||||||
.alloc_inode = hostfs_alloc_inode,
|
.alloc_inode = hostfs_alloc_inode,
|
||||||
.drop_inode = generic_delete_inode,
|
.drop_inode = generic_delete_inode,
|
||||||
.delete_inode = hostfs_delete_inode,
|
.delete_inode = hostfs_delete_inode,
|
||||||
.destroy_inode = hostfs_destroy_inode,
|
.destroy_inode = hostfs_destroy_inode,
|
||||||
.statfs = hostfs_statfs,
|
.statfs = hostfs_statfs,
|
||||||
|
.show_options = hostfs_show_options,
|
||||||
};
|
};
|
||||||
|
|
||||||
int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
|
int hostfs_readdir(struct file *file, void *ent, filldir_t filldir)
|
||||||
|
Loading…
Reference in New Issue
Block a user