From patchwork Thu Apr 23 23:04:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lin X-Patchwork-Id: 6265661 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26D8FBF4A6 for ; Thu, 23 Apr 2015 23:06:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69DE9203AD for ; Thu, 23 Apr 2015 23:05:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7889A20138 for ; Thu, 23 Apr 2015 23:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031314AbbDWXFU (ORCPT ); Thu, 23 Apr 2015 19:05:20 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:45124 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031303AbbDWXFP (ORCPT ); Thu, 23 Apr 2015 19:05:15 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NNA009TD84Q0OB0@mailout4.samsung.com>; Fri, 24 Apr 2015 08:05:14 +0900 (KST) X-AuditID: cbfee61a-f79516d000006302-09-55397aaad986 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id EE.88.25346.AAA79355; Fri, 24 Apr 2015 08:05:14 +0900 (KST) Received: from localhost.localdomain ([105.128.19.153]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NNA00IAW83XRM70@mmp2.samsung.com>; Fri, 24 Apr 2015 08:05:14 +0900 (KST) From: Ming Lin To: linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Kent Overstreet , Jens Axboe , Dongsu Park , Al Viro , linux-fsdevel@vger.kernel.org, Ming Lin Subject: [PATCH v3 3/4] fs: make _submit_bh consistent with generic bio chaining Date: Thu, 23 Apr 2015 16:04:34 -0700 Message-id: <1429830275-6792-4-git-send-email-mlin@kernel.org> X-Mailer: git-send-email 1.9.1 In-reply-to: <1429830275-6792-1-git-send-email-mlin@kernel.org> References: <1429830275-6792-1-git-send-email-mlin@kernel.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrALMWRmVeSWpSXmKPExsVy+t9jQd1VVZahBi+2iVusvtvPZnF59Sp2 i9MTFjFZHGmqstiz9ySLxeVdc9gszm87yWpx/u9xVgcOj52z7rJ7bF6h5XH5bKnHplWdbB5/ /nxm9vi8Sc5j05O3TAHsUVw2Kak5mWWpRfp2CVwZDX3rWApOc1VM/WHbwPiOo4uRk0NCwETi ycz57BC2mMSFe+vZuhi5OIQEpjNKrNu/A8r5ySgxfcoqJpAqNgEFiYPrNoDZIkD25t5nrCBF zAItTBK/Xs0ESwgLBEj8bHgBZrMIqEqsmvKdGcTmFbCTWHJpLRvEOjmJk8cms4LYnAL2El9P PgaLCwHVrLw9hWkCI+8CRoZVjKKpBckFxUnpuYZ6xYm5xaV56XrJ+bmbGMHh9kxqB+PKBotD jAIcjEo8vB+KLEKFWBPLiitzDzFKcDArifCyl1uGCvGmJFZWpRblxxeV5qQWH2KU5mBREued oysXKiSQnliSmp2aWpBaBJNl4uCUamDcofNuscTnNWU8r5cxl7cHfXnXmj+3XYdZp/fBu8tR AZ47r3CVXa3nPfSncMtM12PTj91f2Hm1cOdJHo2y7WaahtPYmx+fceEXCvDb4yzWY2ntpbO0 ovKTePzXs30MoX/r1sXauHHtWflog6n7TRex2zLL2XYLb41SW6+YvPemVuvrbRtabtkrsRRn JBpqMRcVJwIAEjbLqzMCAAA= Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kent Overstreet Make _submit_bh() handle refcounting by increasing bio->bi_remaining, followed by bio_endio(). Since bio chaining was introduced with 196d38bccfcf ("block: Generic bio chaining"), refcounting should be done on bi_remaining instead of ancient bio_cnt. Doing that, calling convention can be consistent with the immutable biovecs API. Cc: Christoph Hellwig Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Kent Overstreet [dpark: add more description in commit message] [mlin: rebase as Jens is changing the bi_remaining rules] Signed-off-by: Dongsu Park Signed-off-by: Ming Lin --- fs/buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index c7a5602..c1c0e0d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3041,13 +3041,13 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) if (buffer_prio(bh)) rw |= REQ_PRIO; - bio_get(bio); + bio_inc_remaining(bio); submit_bio(rw, bio); if (bio_flagged(bio, BIO_EOPNOTSUPP)) ret = -EOPNOTSUPP; - bio_put(bio); + bio_endio(bio, 0); return ret; } EXPORT_SYMBOL_GPL(_submit_bh);