From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAF5BCCD187 for ; Tue, 14 Oct 2025 06:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:Message-ID:Date:To:Sender: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/4uId9+w7hzqYbLKLJGVDeCfgXqtqyCeQPxQ8x9WMR4=; b=WI5fvyAv+Bu4Y4jzEzcS1p4C2Z 6ii2aAzDXq4hnfTZoP3fUrdZr5I4vp+PA3gm7wooOEj6V4I5eBQmLtXDcsNSU/kc8x0UVZjFHtzgB +CQPUaqeYbCfpk0EfPG5RJnIA5ctv7xjqEW/xUKON1uCYg8nuwB+HeqXThs/B2sErKFI=; Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1v8YVI-0008H0-7A; Tue, 14 Oct 2025 06:27:24 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v8YVG-0008Gt-6h for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 06:27:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=w0UF21LErYax9FY/A7OAW/d7WDsDJg6ijqN1COXyeS8=; b=N1LumarAcwFgsrx9W+CrGHQeuh OuRqsJdTnaNlKwHKREE9sz7k8YKpxebJbPO+a2n1fT2S8r8tTUqFeSJqQ51JrMyI1qQWJkW3yw/cp 9pZ+/xYosrjDzNnRfgKiUk6rhF7lz/o+a6AEf6eHNciY6k4NyXeIepODDP/CsZKS2erQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=w0UF21LErYax9FY/A7OAW/d7WDsDJg6ijqN1COXyeS8=; b=F rF/I/8SuRdQ1K93SSk2G0dWDvYgjQOuadQ/NE1Za2AYXsAruaP9Uf8LY28p+s0wTId0mLhM4zaHnk aN4YQzdWtk5t0+K4DHcLaHM1btQv6RIpGLnrsyCWyBqPc8UhEcceVX6ROMkyEkw09oG8i4Z1KeT0N ccVN6mbzLSiwx8Cg=; Received: from tor.source.kernel.org ([172.105.4.254]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1v8YVE-0001hr-OE for linux-f2fs-devel@lists.sourceforge.net; Tue, 14 Oct 2025 06:27:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 1370D621BB for ; Tue, 14 Oct 2025 06:27:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D05F6C4CEE7; Tue, 14 Oct 2025 06:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760423229; bh=5l9A5JJC7HoCgkgNBAkY442qtM7rkd2EIFEaDAIJIMU=; h=From:To:Cc:Subject:Date:From; b=NPAacUhItq15Y9mwO0PO0P//CUmzJy6k1IhnUl5PjpBvJ8Rb2eiuMo99KULXjHr7m dmdH8LdDwV0m/q15FLtUZ6hwFPIaPOYcpNBKHNZ5MPVY7oYSV/sEk0i83/L3oDB5z5 lBalEoK1fTWkzJ7Vl2zQy0TKtPJWzPSYNal8eRvT8NI8RHJOrWuu+EFKatSim34P4b DxKFSaE+QDtyAfjQUXR7u5cd9dkNpdfR6CgrefVF3njgeWgleUTWGBdCE5ODQ+G97O ct85EqRY69qJaLBZUs02BcKTXOE8VFyHrr1/oaJufFnN5K7d1mvmkQl0d9WbcnqX3w laNZniYJxihxg== To: jaegeuk@kernel.org Date: Tue, 14 Oct 2025 14:27:01 +0800 Message-ID: <20251014062704.1734984-1-chao@kernel.org> X-Mailer: git-send-email 2.51.0.760.g7b8bcc2412-goog MIME-Version: 1.0 X-Headers-End: 1v8YVE-0001hr-OE Subject: [f2fs-dev] [PATCH 1/4] f2fs: clean up w/ bio_add_folio_nofail() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Chao Yu via Linux-f2fs-devel Reply-To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net In add_bio_entry(), adding a page to newly allocated bio should never fail, let's use bio_add_folio_nofail() instead of bio_add_page() & unnecessary error handling for cleanup. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 775aa4f63aa3..50538c26c1a1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -752,7 +752,7 @@ static bool io_is_mergeable(struct f2fs_sb_info *sbi, struct bio *bio, } static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio, - struct page *page, enum temp_type temp) + struct folio *folio, enum temp_type temp) { struct f2fs_bio_info *io = sbi->write_io[DATA] + temp; struct bio_entry *be; @@ -761,8 +761,7 @@ static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio, be->bio = bio; bio_get(bio); - if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) - f2fs_bug_on(sbi, 1); + bio_add_folio_nofail(bio, folio, folio_size(folio), 0); f2fs_down_write(&io->bio_list_lock); list_add_tail(&be->list, &io->bio_list); @@ -904,7 +903,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio) f2fs_set_bio_crypt_ctx(bio, folio->mapping->host, folio->index, fio, GFP_NOIO); - add_bio_entry(fio->sbi, bio, &data_folio->page, fio->temp); + add_bio_entry(fio->sbi, bio, data_folio, fio->temp); } else { if (add_ipu_page(fio, &bio, &data_folio->page)) goto alloc_new; -- 2.49.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 557D429E110 for ; Tue, 14 Oct 2025 06:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760423230; cv=none; b=s+jGhQ+8bbshl+dW6SASOfJ1VgUTNZAkhk0UwxdnBvl/9Tb2ZkqUQeNWe3WsrImRs+ywG/2LlJvE5Wssf7btLtifZXyWMCX1Sf+gzC8NkK4WGjcJ6Crh9d73BFyPJzchyYmfnSAwX3a4ys1WgDd93EZ+VY9ak9pcBJZMPFUCq8g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760423230; c=relaxed/simple; bh=5l9A5JJC7HoCgkgNBAkY442qtM7rkd2EIFEaDAIJIMU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=axeo1FDV7Tg0bQW4o4eFj7aZ9d7pd5UYxFCzggNEaqLHyOojdEdoMxrM9rgybDDivWx9XEiVxdE0LTVXilmhiA8xxE8ljaFIZ4akuE9fQuvySxBFIrUVeStG97rN+QtjesQ7ZKTv/AgCZ+nD/PkSoet0qJAnWuQ89o78XQUplpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NPAacUhI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NPAacUhI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D05F6C4CEE7; Tue, 14 Oct 2025 06:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1760423229; bh=5l9A5JJC7HoCgkgNBAkY442qtM7rkd2EIFEaDAIJIMU=; h=From:To:Cc:Subject:Date:From; b=NPAacUhItq15Y9mwO0PO0P//CUmzJy6k1IhnUl5PjpBvJ8Rb2eiuMo99KULXjHr7m dmdH8LdDwV0m/q15FLtUZ6hwFPIaPOYcpNBKHNZ5MPVY7oYSV/sEk0i83/L3oDB5z5 lBalEoK1fTWkzJ7Vl2zQy0TKtPJWzPSYNal8eRvT8NI8RHJOrWuu+EFKatSim34P4b DxKFSaE+QDtyAfjQUXR7u5cd9dkNpdfR6CgrefVF3njgeWgleUTWGBdCE5ODQ+G97O ct85EqRY69qJaLBZUs02BcKTXOE8VFyHrr1/oaJufFnN5K7d1mvmkQl0d9WbcnqX3w laNZniYJxihxg== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH 1/4] f2fs: clean up w/ bio_add_folio_nofail() Date: Tue, 14 Oct 2025 14:27:01 +0800 Message-ID: <20251014062704.1734984-1-chao@kernel.org> X-Mailer: git-send-email 2.51.0.760.g7b8bcc2412-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In add_bio_entry(), adding a page to newly allocated bio should never fail, let's use bio_add_folio_nofail() instead of bio_add_page() & unnecessary error handling for cleanup. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 775aa4f63aa3..50538c26c1a1 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -752,7 +752,7 @@ static bool io_is_mergeable(struct f2fs_sb_info *sbi, struct bio *bio, } static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio, - struct page *page, enum temp_type temp) + struct folio *folio, enum temp_type temp) { struct f2fs_bio_info *io = sbi->write_io[DATA] + temp; struct bio_entry *be; @@ -761,8 +761,7 @@ static void add_bio_entry(struct f2fs_sb_info *sbi, struct bio *bio, be->bio = bio; bio_get(bio); - if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) - f2fs_bug_on(sbi, 1); + bio_add_folio_nofail(bio, folio, folio_size(folio), 0); f2fs_down_write(&io->bio_list_lock); list_add_tail(&be->list, &io->bio_list); @@ -904,7 +903,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio) f2fs_set_bio_crypt_ctx(bio, folio->mapping->host, folio->index, fio, GFP_NOIO); - add_bio_entry(fio->sbi, bio, &data_folio->page, fio->temp); + add_bio_entry(fio->sbi, bio, data_folio, fio->temp); } else { if (add_ipu_page(fio, &bio, &data_folio->page)) goto alloc_new; -- 2.49.0