diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index c7b6c61a3..d7e1f46bc 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -478,7 +478,7 @@ void cmnd_done(struct iscsi_cmnd *cmnd) if (cmnd->own_sg) { TRACE_DBG("own_sg for req %p", cmnd); if (cmnd->sg != &dummy_sg) - scst_free(cmnd->sg, cmnd->sg_cnt); + scst_free_sg(cmnd->sg, cmnd->sg_cnt); #ifdef CONFIG_SCST_DEBUG cmnd->own_sg = 0; cmnd->sg = NULL; @@ -501,7 +501,7 @@ void cmnd_done(struct iscsi_cmnd *cmnd) if (cmnd->own_sg) { TRACE_DBG("own_sg for rsp %p", cmnd); if ((cmnd->sg != &dummy_sg) && (cmnd->sg != cmnd->rsp_sg)) - scst_free(cmnd->sg, cmnd->sg_cnt); + scst_free_sg(cmnd->sg, cmnd->sg_cnt); #ifdef CONFIG_SCST_DEBUG cmnd->own_sg = 0; cmnd->sg = NULL; @@ -1713,7 +1713,7 @@ static int nop_out_start(struct iscsi_cmnd *cmnd) if (cmnd->pdu.bhs.itt != ISCSI_RESERVED_TAG) { struct scatterlist *sg; - cmnd->sg = sg = scst_alloc(size, GFP_KERNEL, + cmnd->sg = sg = scst_alloc_sg(size, GFP_KERNEL, &cmnd->sg_cnt); if (sg == NULL) { TRACE(TRACE_OUT_OF_MEM, "Allocation of buffer " diff --git a/scst/include/scst.h b/scst/include/scst.h index 10ad58c0c..4e10e2c6c 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -4158,8 +4158,8 @@ void scst_set_resp_data_len(struct scst_cmd *cmd, int resp_data_len); void scst_cmd_get(struct scst_cmd *cmd); void scst_cmd_put(struct scst_cmd *cmd); -struct scatterlist *scst_alloc(int size, gfp_t gfp_mask, int *count); -void scst_free(struct scatterlist *sg, int count); +struct scatterlist *scst_alloc_sg(int size, gfp_t gfp_mask, int *count); +void scst_free_sg(struct scatterlist *sg, int count); int scst_calc_block_shift(int sector_size); int scst_sbc_generic_parse(struct scst_cmd *cmd); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 8d7e87257..a954c5e02 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -1429,7 +1429,7 @@ static int scst_set_lun_not_supported_request_sense(struct scst_cmd *cmd, if (cmd->bufflen == 0) cmd->bufflen = cmd->cdb[4]; - cmd->sg = scst_alloc(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); + cmd->sg = scst_alloc_sg(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); if (cmd->sg == NULL) { PRINT_ERROR("Unable to alloc sg for REQUEST SENSE" "(sense %x/%x/%x)", key, asc, ascq); @@ -1497,7 +1497,7 @@ static int scst_set_lun_not_supported_inquiry(struct scst_cmd *cmd) if (cmd->bufflen == 0) cmd->bufflen = min_t(int, 36, get_unaligned_be16(&cmd->cdb[3])); - cmd->sg = scst_alloc(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); + cmd->sg = scst_alloc_sg(cmd->bufflen, GFP_ATOMIC, &cmd->sg_cnt); if (cmd->sg == NULL) { PRINT_ERROR("%s", "Unable to alloc sg for INQUIRY " "for not supported LUN"); @@ -5099,7 +5099,7 @@ static void scst_release_space(struct scst_cmd *cmd) !(cmd->tgt_data_buf_alloced || cmd->dh_data_buf_alloced)) { TRACE_MEM("Freeing sg %p for cmd %p (cnt %d)", cmd->sg, cmd, cmd->sg_cnt); - scst_free(cmd->sg, cmd->sg_cnt); + scst_free_sg(cmd->sg, cmd->sg_cnt); goto out_zero; } else goto out; diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 9f0ca3178..b6127b510 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1239,13 +1239,13 @@ void sgv_pool_free(struct sgv_pool_obj *obj, struct scst_mem_lim *mem_lim) EXPORT_SYMBOL_GPL(sgv_pool_free); /** - * scst_alloc() - allocates an SG vector + * scst_alloc_sg() - allocates an SG vector * * Allocates and returns pointer to SG vector with data size "size". * In *count returned the count of entries in the vector. * Returns NULL for failure. */ -struct scatterlist *scst_alloc(int size, gfp_t gfp_mask, int *count) +struct scatterlist *scst_alloc_sg(int size, gfp_t gfp_mask, int *count) { struct scatterlist *res; int pages = PAGE_ALIGN(size) >> PAGE_SHIFT; @@ -1283,7 +1283,7 @@ struct scatterlist *scst_alloc(int size, gfp_t gfp_mask, int *count) /* * If we allow use clustering here, we will have troubles in - * scst_free() to figure out how many pages are in the SG vector. + * scst_free_sg() to figure out how many pages are in the SG vector. * So, let's always don't use clustering. */ cnt = sgv_alloc_sg_entries(res, pages, gfp_mask, sgv_no_clustering, @@ -1310,14 +1310,14 @@ out_uncheck: sgv_hiwmk_uncheck(pages); goto out; } -EXPORT_SYMBOL_GPL(scst_alloc); +EXPORT_SYMBOL_GPL(scst_alloc_sg); /** - * scst_free() - frees SG vector + * scst_free_sg() - frees SG vector * - * Frees SG vector returned by scst_alloc(). + * Frees SG vector returned by scst_alloc_sg(). */ -void scst_free(struct scatterlist *sg, int count) +void scst_free_sg(struct scatterlist *sg, int count) { TRACE_MEM("Freeing sg=%p", sg); @@ -1327,7 +1327,7 @@ void scst_free(struct scatterlist *sg, int count) kfree(sg); return; } -EXPORT_SYMBOL_GPL(scst_free); +EXPORT_SYMBOL_GPL(scst_free_sg); /* Must be called under sgv_pools_mutex */ static void sgv_pool_init_cache(struct sgv_pool *pool, int cache_num)