scsi: target: core: Add gfp_t arg to target_cmd_init_cdb()
tcm_loop could be used like a normal block device, so we can't use GFP_KERNEL and should use GFP_NOIO. This adds a gfp_t arg to target_cmd_init_cdb() and converts the users. For every driver but loop GFP_KERNEL is kept. This will also be useful in subsequent patches where loop needs to do target_submit_prep() from interrupt context to get a ref to the se_device, and so it will need to use GFP_ATOMIC. Link: https://lore.kernel.org/r/20210227170006.5077-16-michael.christie@oracle.com Tested-by: Laurence Oberman <loberman@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
0fa50a8b12
commit
0869419947
@@ -157,10 +157,11 @@ int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
|
||||
int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb,
|
||||
struct scatterlist *sgl, u32 sgl_count,
|
||||
struct scatterlist *sgl_bidi, u32 sgl_bidi_count,
|
||||
struct scatterlist *sgl_prot, u32 sgl_prot_count);
|
||||
struct scatterlist *sgl_prot, u32 sgl_prot_count, gfp_t gfp);
|
||||
void target_submit(struct se_cmd *se_cmd);
|
||||
sense_reason_t transport_lookup_cmd_lun(struct se_cmd *);
|
||||
sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *);
|
||||
sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb,
|
||||
gfp_t gfp);
|
||||
sense_reason_t target_cmd_parse_cdb(struct se_cmd *);
|
||||
void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
|
||||
unsigned char *, u64, u32, int, int, int);
|
||||
|
||||
Reference in New Issue
Block a user