Signed-off-by: Masatake YAMATO <yamato@redhat.com>
f->map_end = end;
f->pos = offset;
+ f->mnt_id = 0;
+#if defined(HAVE_STATX) && defined(HAVE_STRUCT_STATX_STX_MNT_ID)
+ {
+ struct statx stx;
+ if (ul_path_statxf(pc, &stx, AT_NO_AUTOMOUNT|AT_STATX_DONT_SYNC,
+ STATX_MNT_ID,
+ "map_files/%"PRIx64"-%"PRIx64, start, end) == 0)
+ f->mnt_id = stx.stx_mnt_id;
+ }
+#endif /* defined(HAVE_STATX) && defined(HAVE_STRUCT_STATX_STX_MNT_ID) */
+
file_init_content(f);
}
#define is_opened_file(_f) ((_f)->association >= 0)
#define is_mapped_file(_f) (is_association((_f), SHM) || is_association((_f), MEM))
#define is_association(_f, a) ((_f)->association < 0 && (_f)->association == -ASSOC_ ## a)
-#define has_mnt_id(_f) (is_opened_file(_f))
+#define has_mnt_id(_f) (is_opened_file(_f) || is_mapped_file(_f))
struct file_class {
const struct file_class *super;