提交 6917f83f 编写于 作者: L Liu Yuan 提交者: Rusty Russell

drivers, block: virtio_blk: Replace cryptic number with the macro

It is easier to figure out the context by reading SCSI_SENSE_BUFFERSIZE
instead of plain '96'.
Signed-off-by: NLiu Yuan <tailai.ly@taobao.com>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
上级 7a7c924c
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/virtio_blk.h> #include <linux/virtio_blk.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/string_helpers.h> #include <linux/string_helpers.h>
#include <scsi/scsi_cmnd.h>
#define PART_BITS 4 #define PART_BITS 4
...@@ -146,7 +147,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk, ...@@ -146,7 +147,7 @@ static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
num = blk_rq_map_sg(q, vbr->req, vblk->sg + out); num = blk_rq_map_sg(q, vbr->req, vblk->sg + out);
if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) { if (vbr->req->cmd_type == REQ_TYPE_BLOCK_PC) {
sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, 96); sg_set_buf(&vblk->sg[num + out + in++], vbr->req->sense, SCSI_SENSE_BUFFERSIZE);
sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr, sg_set_buf(&vblk->sg[num + out + in++], &vbr->in_hdr,
sizeof(vbr->in_hdr)); sizeof(vbr->in_hdr));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册