Commit 090587e1 authored by Pavel Emelyanov's avatar Pavel Emelyanov

stat: Pass namespace into phys_stat_dev_match, not mnt tree

This makes the API simpler.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ef39c465
......@@ -28,8 +28,8 @@ extern struct ns_desc mnt_ns_desc;
extern dev_t phys_stat_resolve_dev(struct mount_info *tree,
dev_t st_dev, const char *path);
extern bool phys_stat_dev_match(struct mount_info *tree, dev_t st_dev,
dev_t phys_dev, const char *path);
extern bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev,
struct ns_id *, const char *path);
struct pstree_item;
extern int restore_task_mnt_ns(struct pstree_item *);
......
......@@ -207,13 +207,13 @@ dev_t phys_stat_resolve_dev(struct mount_info *tree,
MKKDEV(major(st_dev), minor(st_dev)) : m->s_dev;
}
bool phys_stat_dev_match(struct mount_info *tree, dev_t st_dev,
dev_t phys_dev, const char *path)
bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev,
struct ns_id *ns, const char *path)
{
if (st_dev == kdev_to_odev(phys_dev))
return true;
return phys_dev == phys_stat_resolve_dev(tree, st_dev, path);
return phys_dev == phys_stat_resolve_dev(ns->mnt.mntinfo_tree, st_dev, path);
}
/*
......
......@@ -440,8 +440,8 @@ static int unix_collect_one(const struct unix_diag_msg *m,
name, m->udiag_ino);
drop_path = true;
} else if ((st.st_ino != uv->udiag_vfs_ino) ||
!phys_stat_dev_match(ns->mnt.mntinfo_tree, st.st_dev,
uv->udiag_vfs_dev, name)) {
!phys_stat_dev_match(st.st_dev,
uv->udiag_vfs_dev, ns, name)) {
pr_info("unix: Dropping path %s for "
"unlinked bound "
"sk %#x.%#x real %#x.%#x\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment