mount: don't use phys_stat_resolve_dev() in open_mount()

Submitted by Andrei Vagin on June 6, 2017, 6:50 a.m.

Details

Message ID 20170606065057.13027-1-avagin@openvz.org
State Accepted
Series "mount: don't use phys_stat_resolve_dev() in open_mount()"
Commit b600a7c3a0d46fad863f443d9a1eb71c71f6e12d
Headers show

Commit Message

Andrei Vagin June 6, 2017, 6:50 a.m.
From: Andrei Vagin <avagin@virtuozzo.com>

We don't need to look up a mount info element, because
we already have it there.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/mount.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index b7c4785..3f56aff 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1020,8 +1020,8 @@  int mnt_is_dir(struct mount_info *pm)
  */
 int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 {
-	dev_t dev;
 	struct stat st;
+	int dev;
 	int ret;
 
 	if (mnt_fd == -1) {
@@ -1050,7 +1050,7 @@  int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 		goto err;
 	}
 
-	dev = phys_stat_resolve_dev(pm->nsid, st.st_dev, pm->ns_mountpoint + 1);
+	dev = MKKDEV(major(st.st_dev), minor(st.st_dev));
 	/*
 	 * Always check for @s_dev_rt here, because the @s_dev
 	 * from the image (in case of restore) has all rights
@@ -1059,7 +1059,7 @@  int __open_mountpoint(struct mount_info *pm, int mnt_fd)
 	 */
 	if (dev != pm->s_dev_rt) {
 		pr_err("The file system %#x %#x (%#x) %s %s is inaccessible\n",
-		       pm->s_dev, pm->s_dev_rt, (int)dev,
+		       pm->s_dev, pm->s_dev_rt, dev,
 		       pm->fstype->name, pm->ns_mountpoint);
 		goto err;
 	}