Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions modules/cas_cache/volume/vol_block_dev_bottom.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright(c) 2012-2021 Intel Corporation
* Copyright(c) 2012-2022 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -353,6 +353,21 @@ static inline bool cas_bd_io_prepare(int *dir, struct ocf_io *io)
return true;
}

/*
* Returns only flags that are relevant to request's direction.
*/
static inline uint64_t filter_req_flags(int dir, uint64_t flags)
{
/* Remove REQ_RAHEAD flag from write request to cache which are a
result of a missed read-head request. This flag caused the nvme
driver to send write command with an access frequency value that
is reserved */
if (dir == WRITE)
flags &= ~REQ_RAHEAD;

return flags;
}

/*
*
*/
Expand Down Expand Up @@ -403,7 +418,7 @@ static void block_dev_submit_io(struct ocf_io *io)
CAS_BIO_BISECTOR(bio) = addr / SECTOR_SIZE;
bio->bi_next = NULL;
bio->bi_private = io;
CAS_BIO_OP_FLAGS(bio) |= io->flags;
CAS_BIO_OP_FLAGS(bio) |= filter_req_flags(dir, io->flags);
bio->bi_end_io = CAS_REFER_BLOCK_CALLBACK(cas_bd_io_end);

/* Add pages */
Expand Down