diff options
author | Qu Wenruo <wqu@suse.com> | 2018-02-28 10:32:47 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2018-04-03 22:04:17 +0300 |
commit | e5c4cb9b1b78edb5bd42a9bd7315a0d7b842ac71 (patch) | |
tree | 7550494a031b4431d62e596dbcc13223a8166dc6 /drivers/md/dm-log-writes.c | |
parent | e16b4f99f0f79682a7efe191a8ce694d87ca9fc8 (diff) | |
download | linux-e5c4cb9b1b78edb5bd42a9bd7315a0d7b842ac71.tar.xz |
dm log writes: record metadata flag for better flags record
So developer could distinguish data and metadata bios easier.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-log-writes.c')
-rw-r--r-- | drivers/md/dm-log-writes.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/md/dm-log-writes.c b/drivers/md/dm-log-writes.c index e4c015dfef43..fefe6719a64d 100644 --- a/drivers/md/dm-log-writes.c +++ b/drivers/md/dm-log-writes.c @@ -52,10 +52,11 @@ * in fact we want to do the data and the discard in the order that they * completed. */ -#define LOG_FLUSH_FLAG (1 << 0) -#define LOG_FUA_FLAG (1 << 1) -#define LOG_DISCARD_FLAG (1 << 2) -#define LOG_MARK_FLAG (1 << 3) +#define LOG_FLUSH_FLAG (1 << 0) +#define LOG_FUA_FLAG (1 << 1) +#define LOG_DISCARD_FLAG (1 << 2) +#define LOG_MARK_FLAG (1 << 3) +#define LOG_METADATA_FLAG (1 << 4) #define WRITE_LOG_VERSION 1ULL #define WRITE_LOG_MAGIC 0x6a736677736872ULL @@ -699,6 +700,7 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio) bool flush_bio = (bio->bi_opf & REQ_PREFLUSH); bool fua_bio = (bio->bi_opf & REQ_FUA); bool discard_bio = (bio_op(bio) == REQ_OP_DISCARD); + bool meta_bio = (bio->bi_opf & REQ_META); pb->block = NULL; @@ -743,6 +745,8 @@ static int log_writes_map(struct dm_target *ti, struct bio *bio) block->flags |= LOG_FUA_FLAG; if (discard_bio) block->flags |= LOG_DISCARD_FLAG; + if (meta_bio) + block->flags |= LOG_METADATA_FLAG; block->sector = bio_to_dev_sectors(lc, bio->bi_iter.bi_sector); block->nr_sectors = bio_to_dev_sectors(lc, bio_sectors(bio)); |