[CRIU] [PATCH 1/7] irmap: use kdev everywere

Andrey Vagin avagin at openvz.org
Tue Mar 8 10:43:59 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Currently we kdev and odev together and try to compare them without
converting to the one type.

Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/irmap.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/criu/irmap.c b/criu/irmap.c
index 1501887..c93a995 100644
--- a/criu/irmap.c
+++ b/criu/irmap.c
@@ -88,7 +88,7 @@ static int irmap_update_stat(struct irmap *i)
 	}
 
 	i->revalidate = false;
-	i->dev = st.st_dev;
+	i->dev = MKKDEV(major(st.st_dev), minor(st.st_dev));
 	i->ino = st.st_ino;
 	if (!S_ISDIR(st.st_mode))
 		i->nr_kids = 0; /* don't irmap_update_dir */
@@ -203,7 +203,7 @@ static int irmap_revalidate(struct irmap *c, struct irmap **p)
 		goto invalid;
 	}
 
-	if (c->dev != st.st_dev)
+	if (c->dev != MKKDEV(major(st.st_dev), minor(st.st_dev)))
 		goto invalid;
 	if (c->ino != st.st_ino)
 		goto invalid;
@@ -228,8 +228,6 @@ char *irmap_lookup(unsigned int s_dev, unsigned long i_ino)
 	int hv;
 	struct irmap_path_opt *o;
 
-	s_dev = kdev_to_odev(s_dev);
-
 	pr_debug("Resolving %x:%lx path\n", s_dev, i_ino);
 
 	/*
-- 
2.5.0



More information about the CRIU mailing list