Skip to content

Commit 6aa25c7

Browse files
Coly Lidavem330
authored andcommitted
scsi: libiscsi: use sendpage_ok() in iscsi_tcp_segment_map()
In iscsci driver, iscsi_tcp_segment_map() uses the following code to check whether the page should or not be handled by sendpage: if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg))) The "page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg)" part is to make sure the page can be sent to network layer's zero copy path. This part is exactly what sendpage_ok() does. This patch uses use sendpage_ok() in iscsi_tcp_segment_map() to replace the original open coded checks. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Lee Duncan <lduncan@suse.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Cc: Vasily Averin <vvs@virtuozzo.com> Cc: Cong Wang <amwang@redhat.com> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: Chris Leech <cleech@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fb25ebe commit 6aa25c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/libiscsi_tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ static void iscsi_tcp_segment_map(struct iscsi_segment *segment, int recv)
128128
* coalescing neighboring slab objects into a single frag which
129129
* triggers one of hardened usercopy checks.
130130
*/
131-
if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg)))
131+
if (!recv && sendpage_ok(sg_page(sg)))
132132
return;
133133

134134
if (recv) {

0 commit comments

Comments
 (0)