scsi: bsg: Move the whole request execution into the SCSI/transport handlers

Remove the amount of indirect calls by making the handler responsible for
the entire execution of the request.

Link: https://lore.kernel.org/r/20210729064845.1044147-5-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Christoph Hellwig 2021-07-29 08:48:45 +02:00 committed by Martin K. Petersen
parent 1e61c1a804
commit 75ca56409e
4 changed files with 99 additions and 134 deletions

View file

@ -6,20 +6,14 @@
struct bsg_device;
struct device;
struct request;
struct request_queue;
struct bsg_ops {
int (*check_proto)(struct sg_io_v4 *hdr);
int (*fill_hdr)(struct request *rq, struct sg_io_v4 *hdr,
fmode_t mode);
int (*complete_rq)(struct request *rq, struct sg_io_v4 *hdr);
void (*free_rq)(struct request *rq);
};
typedef int (bsg_sg_io_fn)(struct request_queue *, struct sg_io_v4 *hdr,
fmode_t mode, unsigned int timeout);
struct bsg_device *bsg_register_queue(struct request_queue *q,
struct device *parent, const char *name,
const struct bsg_ops *ops);
bsg_sg_io_fn *sg_io_fn);
void bsg_unregister_queue(struct bsg_device *bcd);
#endif /* _LINUX_BSG_H */