fscrypt, pfk, ice: cover ICE-related data structures in CONFIG_PFK
This patch makes CONFIG_PFK cover all the per-file key structures.
Otherwise, for example, f2fs will set DUN, resulting in IO fragmentation,
even if PFK is not set.
Bug: 68721442
Change-Id: I93808db0b00feae53888fd9ae6c91fc2727ffca9
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
diff --git a/block/blk-core.c b/block/blk-core.c
index ff2e4fd..68ec55a 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1529,7 +1529,9 @@
bio->bi_next = req->bio;
req->bio = bio;
+#ifdef CONFIG_PFK
WARN_ON(req->__dun || bio->bi_iter.bi_dun);
+#endif
req->__sector = bio->bi_iter.bi_sector;
req->__data_len += bio->bi_iter.bi_size;
req->ioprio = ioprio_best(req->ioprio, bio_prio(bio));
@@ -1645,7 +1647,9 @@
req->errors = 0;
req->__sector = bio->bi_iter.bi_sector;
+#ifdef CONFIG_PFK
req->__dun = bio->bi_iter.bi_dun;
+#endif
req->ioprio = bio_prio(bio);
blk_rq_bio_prep(req->q, req, bio);
}
@@ -2650,8 +2654,10 @@
/* update sector only for requests with clear definition of sector */
if (req->cmd_type == REQ_TYPE_FS) {
req->__sector += total_bytes >> 9;
+#ifdef CONFIG_PFK
if (req->__dun)
req->__dun += total_bytes >> 12;
+#endif
}
/* mixed attributes always follow the first bio */
@@ -3053,7 +3059,9 @@
(src->cmd_flags & REQ_CLONE_MASK) | REQ_NOMERGE);
dst->cmd_type = src->cmd_type;
dst->__sector = blk_rq_pos(src);
+#ifdef CONFIG_PFK
dst->__dun = blk_rq_dun(src);
+#endif
dst->__data_len = blk_rq_bytes(src);
dst->nr_phys_segments = src->nr_phys_segments;
dst->ioprio = src->ioprio;