Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbbEYKCy (ORCPT ); Mon, 25 May 2015 06:02:54 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:62116 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752148AbbEYKCu (ORCPT ); Mon, 25 May 2015 06:02:50 -0400 X-AuditID: cbfee61b-f79416d0000014c0-33-5562f34824e8 From: Chao Yu To: "'Jaegeuk Kim'" Cc: "'Changman Lee'" , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <005d01d09217$c0df57f0$429e07d0$@samsung.com> <20150519174851.GC42970@jaegeuk-mac02.mot.com> In-reply-to: <20150519174851.GC42970@jaegeuk-mac02.mot.com> Subject: RE: [PATCH 1/2] f2fs: avoid duplicated code by reusing f2fs_read_end_io Date: Mon, 25 May 2015 18:02:03 +0800 Message-id: <00d201d096d1$f44d43e0$dce7cba0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQIIjajk5vkyrx3hGmMShTh/QtP4hwG+ZIPxnQ51oyA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJLMWRmVeSWpSXmKPExsVy+t9jQV2Pz0mhBpcfGlpc29fIZPFk/Sxm i0uL3C0u75rD5sDisWlVJ5vH7gWfmTz6tqxi9Pi8SS6AJYrLJiU1J7MstUjfLoEr48PejSwF S/krblx4zNTA+Ja7i5GTQ0LAROLfhLNMELaYxIV769m6GLk4hASmM0o837UJynnFKPFkwSew KjYBFYnlHf/BbBEBNYnefVOAbA4OZoEiiVUrBEDCQgJZEuuungULcwpYS1zYVwoSFhYIkHj6 5BEziM0ioCqx6vRiRhCbV8BSYkn3RRYIW1Dix+R7YDazgJbE+p3HmSBseYnNa94yQ9ypILHj 7GtGiAusJBbPWMEMUSMusfHILZYJjEKzkIyahWTULCSjZiFpWcDIsopRNLUguaA4KT3XSK84 Mbe4NC9dLzk/dxMjOAKeSe9gXNVgcYhRgINRiYc3IiMpVIg1say4MvcQowQHs5IIb8hHoBBv SmJlVWpRfnxRaU5q8SFGaQ4WJXHek/k+oUIC6YklqdmpqQWpRTBZJg5OqQbGSOUjptLO84Ja 9iRMMY84ZbH/VVLyp78Z/uced85nSj6v73yn4PoGBR/b+2sn7J913OVlY2Wu2tdJTH3TNILu b3j4/egeXvZNfSY8ryev4rhxv8JBvYn1JDNjfXxt7dZ+6e8P97S8D/qtve56A/tznaTafxcK F/3rmvCp23LOFMVD32WTJzXNUmIpzkg01GIuKk4EAP3x3yZ8AgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2135 Lines: 72 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Wednesday, May 20, 2015 1:49 AM > To: Chao Yu > Cc: Changman Lee; linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org > Subject: Re: [PATCH 1/2] f2fs: avoid duplicated code by reusing f2fs_read_end_io > > Hi Chao, > > On Tue, May 19, 2015 at 05:38:56PM +0800, Chao Yu wrote: > > This patch tries to clean up code as part code of f2fs_read_end_io > > and mpage_end_io are the same, so it's better to merge and reuse them. > > > > Signed-off-by: Chao Yu > > --- > > fs/f2fs/data.c | 35 +++++------------------------------ > > 1 file changed, 5 insertions(+), 30 deletions(-) > > > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > > index 8d04e24..5173d0f 100644 > > --- a/fs/f2fs/data.c > > +++ b/fs/f2fs/data.c > > @@ -34,40 +34,16 @@ static void f2fs_read_end_io(struct bio *bio, int err) > > struct bio_vec *bvec; > > int i; > > > > - bio_for_each_segment_all(bvec, bio, i) { > > - struct page *page = bvec->bv_page; > > - > > - if (!err) { > > - SetPageUptodate(page); > > - } else { > > - ClearPageUptodate(page); > > - SetPageError(page); > > - } > > - unlock_page(page); > > - } > > - bio_put(bio); > > -} > > - > > -/* > > - * I/O completion handler for multipage BIOs. > > - * copied from fs/mpage.c > > - */ > > -static void mpage_end_io(struct bio *bio, int err) > > -{ > > - struct bio_vec *bv; > > - int i; > > - > > if (f2fs_bio_encrypted(bio)) { > > if (err) { > > f2fs_release_crypto_ctx(bio->bi_private); > > } else { > > - f2fs_end_io_crypto_work(bio->bi_private, bio); > > - return; > > + return f2fs_end_io_crypto_work(bio->bi_private, bio); > > IMO, it'd better remain the previous one to make clear that > f2fs_en_io_crypto_work defines a void return. > How about that? OK, will do. Thanks, -- 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/