Loading block/bio.c +3 −1 Original line number Diff line number Diff line Loading @@ -570,8 +570,8 @@ static inline void bio_clone_crypt_key(struct bio *dst, const struct bio *src) #ifdef CONFIG_PFK dst->bi_crypt_key = src->bi_crypt_key; dst->bi_iter.bi_dun = src->bi_iter.bi_dun; #endif dst->bi_dio_inode = src->bi_dio_inode; #endif } /** Loading @@ -598,7 +598,9 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) bio->bi_opf = bio_src->bi_opf; bio->bi_iter = bio_src->bi_iter; bio->bi_io_vec = bio_src->bi_io_vec; #ifdef CONFIG_PFK bio->bi_dio_inode = bio_src->bi_dio_inode; #endif bio_clone_crypt_key(bio, bio_src); bio_clone_blkcg_association(bio, bio_src); } Loading block/blk-core.c +8 −0 Original line number Diff line number Diff line Loading @@ -1529,7 +1529,9 @@ bool bio_attempt_front_merge(struct request_queue *q, struct request *req, 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)); Loading Loading @@ -1645,7 +1647,9 @@ void init_request_from_bio(struct request *req, struct bio *bio) 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); } Loading Loading @@ -2650,8 +2654,10 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) /* 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 */ Loading Loading @@ -3053,7 +3059,9 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) (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; Loading block/blk-merge.c +2 −0 Original line number Diff line number Diff line Loading @@ -876,8 +876,10 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) int blk_try_merge(struct request *rq, struct bio *bio) { #ifdef CONFIG_PFK if (blk_rq_dun(rq) || bio_dun(bio)) return ELEVATOR_NO_MERGE; #endif if (blk_rq_pos(rq) + blk_rq_sectors(rq) == bio->bi_iter.bi_sector) return ELEVATOR_BACK_MERGE; else if (blk_rq_pos(rq) - bio_sectors(bio) == bio->bi_iter.bi_sector) Loading drivers/scsi/ufs/ufs-qcom.c +6 −1 Original line number Diff line number Diff line /* * Copyright (c) 2013-2017, Linux Foundation. All rights reserved. * Copyright (c) 2013-2018, Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -900,6 +900,7 @@ static int ufs_qcom_crypto_req_setup(struct ufs_hba *hba, /* Use request LBA or given dun as the DUN value */ if (req->bio) { #ifdef CONFIG_PFK if (bio_dun(req->bio)) { /* dun @bio can be split, so we have to adjust offset */ *dun = bio_dun(req->bio); Loading @@ -907,6 +908,10 @@ static int ufs_qcom_crypto_req_setup(struct ufs_hba *hba, *dun = req->bio->bi_iter.bi_sector; *dun >>= UFS_QCOM_ICE_TR_DATA_UNIT_4_KB; } #else *dun = req->bio->bi_iter.bi_sector; *dun >>= UFS_QCOM_ICE_TR_DATA_UNIT_4_KB; #endif } ret = ufs_qcom_ice_req_setup(host, lrbp->cmd, cc_index, enable); Loading fs/direct-io.c +6 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, sdio->logical_offset_in_bio = sdio->cur_page_fs_offset; } #ifdef CONFIG_PFK static bool is_inode_filesystem_type(const struct inode *inode, const char *fs_type) { Loading @@ -406,6 +407,7 @@ static bool is_inode_filesystem_type(const struct inode *inode, return (strcmp(inode->i_sb->s_type->name, fs_type) == 0); } #endif /* * In the AIO read case we speculatively dirty the pages before starting IO. Loading @@ -428,6 +430,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) if (dio->is_async && dio->op == REQ_OP_READ && dio->should_dirty) bio_set_pages_dirty(bio); #ifdef CONFIG_PFK bio->bi_dio_inode = dio->inode; /* iv sector for security/pfe/pfk_fscrypt.c and f2fs in fs/f2fs/f2fs.h.*/ Loading @@ -437,6 +440,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) if (is_inode_filesystem_type(dio->inode, "f2fs")) fscrypt_set_ice_dun(dio->inode, bio, PG_DUN_NEW(dio->inode, (sdio->logical_offset_in_bio >> PAGE_SHIFT))); #endif dio->bio_bdev = bio->bi_bdev; if (sdio->submit_io) { Loading @@ -457,7 +461,9 @@ struct inode *dio_bio_get_inode(struct bio *bio) if (bio == NULL) return NULL; #ifdef CONFIG_PFK inode = bio->bi_dio_inode; #endif return inode; } Loading Loading
block/bio.c +3 −1 Original line number Diff line number Diff line Loading @@ -570,8 +570,8 @@ static inline void bio_clone_crypt_key(struct bio *dst, const struct bio *src) #ifdef CONFIG_PFK dst->bi_crypt_key = src->bi_crypt_key; dst->bi_iter.bi_dun = src->bi_iter.bi_dun; #endif dst->bi_dio_inode = src->bi_dio_inode; #endif } /** Loading @@ -598,7 +598,9 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) bio->bi_opf = bio_src->bi_opf; bio->bi_iter = bio_src->bi_iter; bio->bi_io_vec = bio_src->bi_io_vec; #ifdef CONFIG_PFK bio->bi_dio_inode = bio_src->bi_dio_inode; #endif bio_clone_crypt_key(bio, bio_src); bio_clone_blkcg_association(bio, bio_src); } Loading
block/blk-core.c +8 −0 Original line number Diff line number Diff line Loading @@ -1529,7 +1529,9 @@ bool bio_attempt_front_merge(struct request_queue *q, struct request *req, 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)); Loading Loading @@ -1645,7 +1647,9 @@ void init_request_from_bio(struct request *req, struct bio *bio) 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); } Loading Loading @@ -2650,8 +2654,10 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes) /* 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 */ Loading Loading @@ -3053,7 +3059,9 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) (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; Loading
block/blk-merge.c +2 −0 Original line number Diff line number Diff line Loading @@ -876,8 +876,10 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) int blk_try_merge(struct request *rq, struct bio *bio) { #ifdef CONFIG_PFK if (blk_rq_dun(rq) || bio_dun(bio)) return ELEVATOR_NO_MERGE; #endif if (blk_rq_pos(rq) + blk_rq_sectors(rq) == bio->bi_iter.bi_sector) return ELEVATOR_BACK_MERGE; else if (blk_rq_pos(rq) - bio_sectors(bio) == bio->bi_iter.bi_sector) Loading
drivers/scsi/ufs/ufs-qcom.c +6 −1 Original line number Diff line number Diff line /* * Copyright (c) 2013-2017, Linux Foundation. All rights reserved. * Copyright (c) 2013-2018, Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -900,6 +900,7 @@ static int ufs_qcom_crypto_req_setup(struct ufs_hba *hba, /* Use request LBA or given dun as the DUN value */ if (req->bio) { #ifdef CONFIG_PFK if (bio_dun(req->bio)) { /* dun @bio can be split, so we have to adjust offset */ *dun = bio_dun(req->bio); Loading @@ -907,6 +908,10 @@ static int ufs_qcom_crypto_req_setup(struct ufs_hba *hba, *dun = req->bio->bi_iter.bi_sector; *dun >>= UFS_QCOM_ICE_TR_DATA_UNIT_4_KB; } #else *dun = req->bio->bi_iter.bi_sector; *dun >>= UFS_QCOM_ICE_TR_DATA_UNIT_4_KB; #endif } ret = ufs_qcom_ice_req_setup(host, lrbp->cmd, cc_index, enable); Loading
fs/direct-io.c +6 −0 Original line number Diff line number Diff line Loading @@ -392,6 +392,7 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, sdio->logical_offset_in_bio = sdio->cur_page_fs_offset; } #ifdef CONFIG_PFK static bool is_inode_filesystem_type(const struct inode *inode, const char *fs_type) { Loading @@ -406,6 +407,7 @@ static bool is_inode_filesystem_type(const struct inode *inode, return (strcmp(inode->i_sb->s_type->name, fs_type) == 0); } #endif /* * In the AIO read case we speculatively dirty the pages before starting IO. Loading @@ -428,6 +430,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) if (dio->is_async && dio->op == REQ_OP_READ && dio->should_dirty) bio_set_pages_dirty(bio); #ifdef CONFIG_PFK bio->bi_dio_inode = dio->inode; /* iv sector for security/pfe/pfk_fscrypt.c and f2fs in fs/f2fs/f2fs.h.*/ Loading @@ -437,6 +440,7 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) if (is_inode_filesystem_type(dio->inode, "f2fs")) fscrypt_set_ice_dun(dio->inode, bio, PG_DUN_NEW(dio->inode, (sdio->logical_offset_in_bio >> PAGE_SHIFT))); #endif dio->bio_bdev = bio->bi_bdev; if (sdio->submit_io) { Loading @@ -457,7 +461,9 @@ struct inode *dio_bio_get_inode(struct bio *bio) if (bio == NULL) return NULL; #ifdef CONFIG_PFK inode = bio->bi_dio_inode; #endif return inode; } Loading