Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751742AbbKQDYR (ORCPT ); Mon, 16 Nov 2015 22:24:17 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:32958 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbbKQDYQ (ORCPT ); Mon, 16 Nov 2015 22:24:16 -0500 From: yalin wang To: axboe@kernel.dk, linux-kernel@vger.kernel.org Cc: yalin wang Subject: [RFC] block: change to use atomic_inc_return_release() Date: Tue, 17 Nov 2015 11:24:10 +0800 Message-Id: <1447730650-23030-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 838 Lines: 29 Some arch define this atomic_inc_return_release() OP. Signed-off-by: yalin wang --- block/bio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/bio.c b/block/bio.c index fbc558b..b251857 100644 --- a/block/bio.c +++ b/block/bio.c @@ -310,8 +310,7 @@ static void bio_chain_endio(struct bio *bio, int error) static inline void bio_inc_remaining(struct bio *bio) { bio->bi_flags |= (1 << BIO_CHAIN); - smp_mb__before_atomic(); - atomic_inc(&bio->__bi_remaining); + atomic_inc_return_release(&bio->__bi_remaining); } /** -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/