2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

stat: Pass namespace into phys_stat_dev_match, not mnt tree

This makes the API simpler.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2014-08-06 10:57:25 +04:00
parent ef39c4657b
commit 090587e1a1
3 changed files with 7 additions and 7 deletions

View File

@ -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 *);

View File

@ -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);
}
/*

View File

@ -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",