Skip to content

Commit 40efc4d

Browse files
Coly Lidavem330
authored andcommitted
libceph: use sendpage_ok() in ceph_tcp_sendpage()
In libceph, ceph_tcp_sendpage() does the following checks before handle the page by network layer's zero copy sendpage method, if (page_count(page) >= 1 && !PageSlab(page)) This check is exactly what sendpage_ok() does. This patch replace the open coded checks by sendpage_ok() as a code cleanup. Signed-off-by: Coly Li <colyli@suse.de> Acked-by: Jeff Layton <jlayton@kernel.org> Cc: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6aa25c7 commit 40efc4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/ceph/messenger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ static int ceph_tcp_sendpage(struct socket *sock, struct page *page,
575575
* coalescing neighboring slab objects into a single frag which
576576
* triggers one of hardened usercopy checks.
577577
*/
578-
if (page_count(page) >= 1 && !PageSlab(page))
578+
if (sendpage_ok(page))
579579
sendpage = sock->ops->sendpage;
580580
else
581581
sendpage = sock_no_sendpage;

0 commit comments

Comments
 (0)