mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
mount: Add phys_stat_dev_match helper
This helper serves to hide fs specifics (in particular btrfs) thus the caller won't need the details. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
c9069ba09f
commit
e54ad19a06
@@ -22,4 +22,6 @@ extern struct mount_info *lookup_mnt_sdev(unsigned int s_dev);
|
|||||||
|
|
||||||
extern struct ns_desc mnt_ns_desc;
|
extern struct ns_desc mnt_ns_desc;
|
||||||
|
|
||||||
|
extern bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev);
|
||||||
|
|
||||||
#endif /* __CR_MOUNT_H__ */
|
#endif /* __CR_MOUNT_H__ */
|
||||||
|
14
mount.c
14
mount.c
@@ -18,6 +18,7 @@
|
|||||||
#include "util-pie.h"
|
#include "util-pie.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "mount.h"
|
#include "mount.h"
|
||||||
|
#include "mount-btrfs.h"
|
||||||
#include "pstree.h"
|
#include "pstree.h"
|
||||||
#include "proc_parse.h"
|
#include "proc_parse.h"
|
||||||
#include "image.h"
|
#include "image.h"
|
||||||
@@ -97,6 +98,19 @@ struct mount_info *lookup_mnt_sdev(unsigned int s_dev)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev)
|
||||||
|
{
|
||||||
|
if (st_dev == phys_dev)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* BTRFS returns subvolume dev-id instead of
|
||||||
|
* superblock dev-id so we might need additional
|
||||||
|
* tests here.
|
||||||
|
*/
|
||||||
|
return is_btrfs_subvol(phys_dev, st_dev);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Comparer two mounts. Return true if only mount points are differ.
|
* Comparer two mounts. Return true if only mount points are differ.
|
||||||
* Don't care about root and mountpoints, if bind is true.
|
* Don't care about root and mountpoints, if bind is true.
|
||||||
|
Reference in New Issue
Block a user