Commit 06b3bec8 authored by Chaitanya Kulkarni's avatar Chaitanya Kulkarni Committed by Christoph Hellwig

nvmet: remove op_flags for passthru commands

For passthru commands setting op_flags has no meaning. Remove the code
that sets the op flags in nvmet_passthru_map_sg().
Signed-off-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 39dfe844
...@@ -188,21 +188,15 @@ static void nvmet_passthru_req_done(struct request *rq, ...@@ -188,21 +188,15 @@ static void nvmet_passthru_req_done(struct request *rq,
static int nvmet_passthru_map_sg(struct nvmet_req *req, struct request *rq) static int nvmet_passthru_map_sg(struct nvmet_req *req, struct request *rq)
{ {
struct scatterlist *sg; struct scatterlist *sg;
int op_flags = 0;
struct bio *bio; struct bio *bio;
int i, ret; int i, ret;
if (req->sg_cnt > BIO_MAX_PAGES) if (req->sg_cnt > BIO_MAX_PAGES)
return -EINVAL; return -EINVAL;
if (req->cmd->common.opcode == nvme_cmd_flush)
op_flags = REQ_FUA;
else if (nvme_is_write(req->cmd))
op_flags = REQ_SYNC | REQ_IDLE;
bio = bio_alloc(GFP_KERNEL, req->sg_cnt); bio = bio_alloc(GFP_KERNEL, req->sg_cnt);
bio->bi_end_io = bio_put; bio->bi_end_io = bio_put;
bio->bi_opf = req_op(rq) | op_flags; bio->bi_opf = req_op(rq);
for_each_sg(req->sg, sg, req->sg_cnt, i) { for_each_sg(req->sg, sg, req->sg_cnt, i) {
if (bio_add_pc_page(rq->q, bio, sg_page(sg), sg->length, if (bio_add_pc_page(rq->q, bio, sg_page(sg), sg->length,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment