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 6C253C4332F for ; Mon, 11 Dec 2023 22:09:04 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rCoST-0000Zf-JL; Mon, 11 Dec 2023 22:09:02 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rCoSS-0000ZT-Ca for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Dec 2023 22:09:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=lR/kHrVxxwerJc4qdtqz651mTxbMyDNBs9XegadSoD4=; b=ZQQCIB++g4kCrK+lLNYUtlhpme lF4r//OpOmXMHth/Hx/EQQGlOUi8GQMmy+HbIB6z2RCtxXPddehtKVpnAsUv1gxBwZd1BYWhKKCSf nf8q2qtRU3KEOBez/EGshGebXR5Ti5ImafX154nAf07jRCqpHAD//3yxFVP3hjFr48wQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=lR/kHrVxxwerJc4qdtqz651mTxbMyDNBs9XegadSoD4=; b=gCBH1ndF/I4ObWj5WPibCuSPPB PVyjGT9EmhPUQoA9/ODJmtc36yI9ryKk/mqC6G9ZE5BBRPwiYaoVbdmad5pLDYr1AVY2nLxv3bbXW wG4dsFSDuEELVYoY/jwRQ9qTcLvkj5ubS3axyn/c7CEQ16+zwqSBwYCdUsC72nsyVOnk=; Received: from ams.source.kernel.org ([145.40.68.75]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rCoSO-0005mB-C1 for linux-f2fs-devel@lists.sourceforge.net; Mon, 11 Dec 2023 22:09:00 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 47486B810B5; Mon, 11 Dec 2023 22:08:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F5B2C433C9; Mon, 11 Dec 2023 22:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702332523; bh=iDewZAyJOxIOJgkget2tmiP/MAlk2VhzGLtGrH05aaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e3Z4OEv/bQCRGBikvcKo6n6zysKC22iBZJFAOV4Q5sUkus013tBJ2R7dpS9Ujl4uO DvNriuKSqj1YuhXUgGY6Jtt4HeNFcgNHmQwwpgVZIsj5Fq3bd2zHsv70PMaXpD18SW wbKRGGr4gxZwGDqGGevLKqD7qrWRAY8b1k5RAu9DemcVqULnc4P886MT9SIZJmICuf dqFPoIo0vzPFnXk5nyP7RYEZERK7yfNacfklZVIv0sj26HA8Fc11Or9XmCxWvlZCTk 6VEytIPHy3NkTea2rTsJlLy6R16JcyNBu8QYzplFVlo5aXqJLNKtVLvrO1a1WQk51R KkNf8E+5eMVag== Date: Mon, 11 Dec 2023 14:08:41 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20231210113547.3412782-1-chao@kernel.org> <20231210113547.3412782-4-chao@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231210113547.3412782-4-chao@kernel.org> X-Headers-End: 1rCoSO-0005mB-C1 Subject: Re: [f2fs-dev] [PATCH 4/6] f2fs: don't set FI_PREALLOCATED_ALL for partial write 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: , Cc: Eric Biggers , 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 On 12/10, Chao Yu wrote: > In f2fs_preallocate_blocks(), if it is partial write in 4KB, it's not > necessary to call f2fs_map_blocks() and set FI_PREALLOCATED_ALL flag. > > Cc: Eric Biggers > Signed-off-by: Chao Yu > --- > fs/f2fs/file.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index 5c2f99ada6be..1a3c29a9a6a0 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -4561,13 +4561,14 @@ static int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *iter, > return ret; > } > > - /* Do not preallocate blocks that will be written partially in 4KB. */ > map.m_lblk = F2FS_BLK_ALIGN(pos); > map.m_len = F2FS_BYTES_TO_BLK(pos + count); > - if (map.m_len > map.m_lblk) > - map.m_len -= map.m_lblk; > - else return 0; We just need the above? > - map.m_len = 0; > + > + /* Do not preallocate blocks that will be written partially in 4KB. */ > + if (map.m_len <= map.m_lblk) > + return 0; > + > + map.m_len -= map.m_lblk; > map.m_may_create = true; > if (dio) { > map.m_seg_type = f2fs_rw_hint_to_seg_type(inode->i_write_hint); > -- > 2.40.1 _______________________________________________ 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 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BE9FC4332F for ; Mon, 11 Dec 2023 22:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345561AbjLKWIl (ORCPT ); Mon, 11 Dec 2023 17:08:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345555AbjLKWIh (ORCPT ); Mon, 11 Dec 2023 17:08:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043DAC7 for ; Mon, 11 Dec 2023 14:08:44 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F5B2C433C9; Mon, 11 Dec 2023 22:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702332523; bh=iDewZAyJOxIOJgkget2tmiP/MAlk2VhzGLtGrH05aaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e3Z4OEv/bQCRGBikvcKo6n6zysKC22iBZJFAOV4Q5sUkus013tBJ2R7dpS9Ujl4uO DvNriuKSqj1YuhXUgGY6Jtt4HeNFcgNHmQwwpgVZIsj5Fq3bd2zHsv70PMaXpD18SW wbKRGGr4gxZwGDqGGevLKqD7qrWRAY8b1k5RAu9DemcVqULnc4P886MT9SIZJmICuf dqFPoIo0vzPFnXk5nyP7RYEZERK7yfNacfklZVIv0sj26HA8Fc11Or9XmCxWvlZCTk 6VEytIPHy3NkTea2rTsJlLy6R16JcyNBu8QYzplFVlo5aXqJLNKtVLvrO1a1WQk51R KkNf8E+5eMVag== Date: Mon, 11 Dec 2023 14:08:41 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Eric Biggers Subject: Re: [PATCH 4/6] f2fs: don't set FI_PREALLOCATED_ALL for partial write Message-ID: References: <20231210113547.3412782-1-chao@kernel.org> <20231210113547.3412782-4-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231210113547.3412782-4-chao@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/10, Chao Yu wrote: > In f2fs_preallocate_blocks(), if it is partial write in 4KB, it's not > necessary to call f2fs_map_blocks() and set FI_PREALLOCATED_ALL flag. > > Cc: Eric Biggers > Signed-off-by: Chao Yu > --- > fs/f2fs/file.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index 5c2f99ada6be..1a3c29a9a6a0 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -4561,13 +4561,14 @@ static int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *iter, > return ret; > } > > - /* Do not preallocate blocks that will be written partially in 4KB. */ > map.m_lblk = F2FS_BLK_ALIGN(pos); > map.m_len = F2FS_BYTES_TO_BLK(pos + count); > - if (map.m_len > map.m_lblk) > - map.m_len -= map.m_lblk; > - else return 0; We just need the above? > - map.m_len = 0; > + > + /* Do not preallocate blocks that will be written partially in 4KB. */ > + if (map.m_len <= map.m_lblk) > + return 0; > + > + map.m_len -= map.m_lblk; > map.m_may_create = true; > if (dio) { > map.m_seg_type = f2fs_rw_hint_to_seg_type(inode->i_write_hint); > -- > 2.40.1