Commit 0efaf212 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Clean code a bit

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c5d2386a
......@@ -285,8 +285,8 @@ static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id)
{
struct ghost_file *gf;
RemapFilePathEntry rpe = REMAP_FILE_PATH_ENTRY__INIT;
dev_t phys_dev = phys_stat_resolve_dev(st->st_dev, path);
dev_t phys_dev;
pr_info("Dumping ghost file for fd %d id %#x\n", lfd, id);
if (st->st_size > MAX_GHOST_FILE_SIZE) {
......@@ -295,6 +295,7 @@ static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id)
return -1;
}
phys_dev = phys_stat_resolve_dev(st->st_dev, path);
list_for_each_entry(gf, &ghost_files, list)
if ((gf->dev == phys_dev) && (gf->ino == st->st_ino))
goto dump_entry;
......
......@@ -149,7 +149,9 @@ static struct mount_info *mount_resolve_path(const char *path)
dev_t phys_stat_resolve_dev(dev_t st_dev, const char *path)
{
struct mount_info *m = mount_resolve_path(path);
struct mount_info *m;
m = mount_resolve_path(path);
/*
* BTRFS returns subvolume dev-id instead of
* superblock dev-id, in such case return device
......@@ -162,6 +164,7 @@ bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev, const char *path)
{
if (st_dev == phys_dev)
return true;
return phys_dev == phys_stat_resolve_dev(st_dev, path);
}
......
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