diff mbox

[09/27] target: use bio_is_full()

Message ID 1459857443-20611-10-git-send-email-tom.leiming@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei April 5, 2016, 11:56 a.m. UTC
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 drivers/target/target_core_pscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoph Hellwig April 5, 2016, 1:02 p.m. UTC | #1
On Tue, Apr 05, 2016 at 07:56:54PM +0800, Ming Lei wrote:
> +++ b/drivers/target/target_core_pscsi.c
> @@ -951,7 +951,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
>  			pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
>  				bio->bi_vcnt, nr_vecs);
>  
> -			if (bio->bi_vcnt > nr_vecs) {
> +			if (bio_is_full(bio)) {
>  				pr_debug("PSCSI: Reached bio->bi_vcnt max:"
>  					" %d i: %d bio: %p, allocating another"
>  					" bio\n", bio->bi_vcnt, i, bio);

This check should be removed entirely - bio_add_pc_page takes care of
it.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ming Lei April 7, 2016, 4:07 a.m. UTC | #2
On Tue, Apr 5, 2016 at 9:02 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Tue, Apr 05, 2016 at 07:56:54PM +0800, Ming Lei wrote:
>> +++ b/drivers/target/target_core_pscsi.c
>> @@ -951,7 +951,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
>>                       pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
>>                               bio->bi_vcnt, nr_vecs);
>>
>> -                     if (bio->bi_vcnt > nr_vecs) {
>> +                     if (bio_is_full(bio)) {
>>                               pr_debug("PSCSI: Reached bio->bi_vcnt max:"
>>                                       " %d i: %d bio: %p, allocating another"
>>                                       " bio\n", bio->bi_vcnt, i, bio);
>
> This check should be removed entirely - bio_add_pc_page takes care of
> it.

OK.
diff mbox

Patch

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index de18790..24906c3 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -951,7 +951,7 @@  pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 			pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
 				bio->bi_vcnt, nr_vecs);
 
-			if (bio->bi_vcnt > nr_vecs) {
+			if (bio_is_full(bio)) {
 				pr_debug("PSCSI: Reached bio->bi_vcnt max:"
 					" %d i: %d bio: %p, allocating another"
 					" bio\n", bio->bi_vcnt, i, bio);