fs/ocfs2/cluster: use offset_in_page() macro
authorGeliang Tang <geliangtang@gmail.com>
Wed, 3 May 2017 21:51:44 +0000 (14:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 May 2017 22:52:07 +0000 (15:52 -0700)
Use offset_in_page() macro instead of open-coding.

Link: http://lkml.kernel.org/r/4dbc77ccaaed98b183cf4dba58a4fa325fd65048.1492758503.git.geliangtang@gmail.com
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Cc: Mark Fasheh <mfasheh@versity.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/cluster/tcp.c

index a4a6ba23b9a6993d53fd3dd6464d5de5dc9ecb23..8d779227370ab1d121fdc2fc6f546f7844e95a5b 100644 (file)
@@ -955,7 +955,7 @@ static void o2net_sendpage(struct o2net_sock_container *sc,
                mutex_lock(&sc->sc_send_lock);
                ret = sc->sc_sock->ops->sendpage(sc->sc_sock,
                                                 virt_to_page(kmalloced_virt),
-                                                (long)kmalloced_virt & ~PAGE_MASK,
+                                                offset_in_page(kmalloced_virt),
                                                 size, MSG_DONTWAIT);
                mutex_unlock(&sc->sc_send_lock);
                if (ret == size)