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 D180EC433EF for ; Thu, 12 May 2022 04:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346811AbiELEz1 (ORCPT ); Thu, 12 May 2022 00:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238350AbiELEz0 (ORCPT ); Thu, 12 May 2022 00:55:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7CF7485B for ; Wed, 11 May 2022 21:55:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE0DE61B9A for ; Thu, 12 May 2022 04:55:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F5FC385B8; Thu, 12 May 2022 04:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652331324; bh=LjJkrm4cL0YKX8d0K1tDmCRcU9xobTmXP7lqKvNMgzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CUbZiuT2sGtwfXmUDmNN0ngEkt+xo7xEuqs3rQTzLZuKRuxIxqou1ZKgZgjwoDTZB vYtty0AoC7G1D9gz3Z0p57cott30zT19BGmpbcfYG1qMisR6fCuk+nl3vjPtGZvTFn CtiLqgNdAJ0xhcHMVNRYWDLDdeXDKXfziS+ptf3JEif5NtnOyochFV/vBD4V6CurW5 Wn0AvFcM4rqhkfa1k+pC2FfdGA6UDeHw+sU1iSxv3uPsPtYEBzTwRhAolUs9LeWeWb USLZqrMTSFzCOOon2I4ouQhthRK3eW8oY/4TFLixzJdoImZot/wkSJf93yNJn4FuvR eMbosi09CDTTQ== Date: Wed, 11 May 2022 21:55:22 -0700 From: Eric Biggers To: Gabriel Krisman Bertazi Cc: tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel@collabora.com Subject: Re: [PATCH v4 10/10] f2fs: Move CONFIG_UNICODE defguards into the code flow Message-ID: References: <20220511193146.27526-1-krisman@collabora.com> <20220511193146.27526-11-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220511193146.27526-11-krisman@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, May 11, 2022 at 03:31:46PM -0400, Gabriel Krisman Bertazi wrote: > @@ -293,10 +294,6 @@ static void f2fs_destroy_casefold_cache(void) > { > kmem_cache_destroy(f2fs_cf_name_slab); > } > -#else > -static int __init f2fs_create_casefold_cache(void) { return 0; } > -static void f2fs_destroy_casefold_cache(void) { } > -#endif [...] > @@ -4611,7 +4608,10 @@ static int __init init_f2fs_fs(void) > err = f2fs_init_compress_cache(); > if (err) > goto free_compress_mempool; > - err = f2fs_create_casefold_cache(); > + > + if (IS_ENABLED(CONFIG_UNICODE)) > + err = f2fs_create_casefold_cache(); > + > if (err) > goto free_compress_cache; > return 0; > @@ -4654,7 +4654,9 @@ static int __init init_f2fs_fs(void) > > static void __exit exit_f2fs_fs(void) > { > - f2fs_destroy_casefold_cache(); > + if (IS_ENABLED(CONFIG_UNICODE)) > + f2fs_destroy_casefold_cache(); > + I don't think the above two changes are actually an improvement. It's cleaner to use stub functions to keep the callers simpler, as the original code did. - Eric 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 D9197C433F5 for ; Thu, 12 May 2022 04:55:36 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1np0rN-0000IN-E4; Thu, 12 May 2022 04:55:33 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1np0rM-0000IG-OP for linux-f2fs-devel@lists.sourceforge.net; Thu, 12 May 2022 04:55:33 +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=tsCAEO8I3kuEqKM40i6OYMx0TbeMg0serI2CdlkRbtc=; b=PCAO+ULHtgyNj46cuJD7DynKJd P2jwnSiQN7r/O6s/yVyuL3x23XTB8XwDF9icrSuvzPKXawjAT6d7psegAuI3d/0ZY36NUetxaA73Z EMFPY94ot9Fi/23pNSHbcfVvuMlV7oeiFT6xnMBOREF0hV3zceRm9NgEjuLHl/pEEnj0=; 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=tsCAEO8I3kuEqKM40i6OYMx0TbeMg0serI2CdlkRbtc=; b=HY5rhWZjLtgmKFwUtp0U4E6Yxo lDUGSh3Q+hJEWbcD91JLwym+YMFO70dipb52SYRN795TxcT2RWNCvburlTOSXo4dlIqCvYzFNPfZW k/geqcU7R2xWeo2Cjn/zmno2ix5uHU0Msh3EmxpSkMR0mlvQRc/Zc2dajSfxzr6clqBU=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1np0rL-0005eG-5E for linux-f2fs-devel@lists.sourceforge.net; Thu, 12 May 2022 04:55:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1C0B61A78; Thu, 12 May 2022 04:55:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1F5FC385B8; Thu, 12 May 2022 04:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652331324; bh=LjJkrm4cL0YKX8d0K1tDmCRcU9xobTmXP7lqKvNMgzk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CUbZiuT2sGtwfXmUDmNN0ngEkt+xo7xEuqs3rQTzLZuKRuxIxqou1ZKgZgjwoDTZB vYtty0AoC7G1D9gz3Z0p57cott30zT19BGmpbcfYG1qMisR6fCuk+nl3vjPtGZvTFn CtiLqgNdAJ0xhcHMVNRYWDLDdeXDKXfziS+ptf3JEif5NtnOyochFV/vBD4V6CurW5 Wn0AvFcM4rqhkfa1k+pC2FfdGA6UDeHw+sU1iSxv3uPsPtYEBzTwRhAolUs9LeWeWb USLZqrMTSFzCOOon2I4ouQhthRK3eW8oY/4TFLixzJdoImZot/wkSJf93yNJn4FuvR eMbosi09CDTTQ== Date: Wed, 11 May 2022 21:55:22 -0700 From: Eric Biggers To: Gabriel Krisman Bertazi Message-ID: References: <20220511193146.27526-1-krisman@collabora.com> <20220511193146.27526-11-krisman@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220511193146.27526-11-krisman@collabora.com> X-Headers-End: 1np0rL-0005eG-5E Subject: Re: [f2fs-dev] [PATCH v4 10/10] f2fs: Move CONFIG_UNICODE defguards into the code flow 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: linux-ext4@vger.kernel.org, tytso@mit.edu, linux-f2fs-devel@lists.sourceforge.net, adilger.kernel@dilger.ca, jaegeuk@kernel.org, kernel@collabora.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Wed, May 11, 2022 at 03:31:46PM -0400, Gabriel Krisman Bertazi wrote: > @@ -293,10 +294,6 @@ static void f2fs_destroy_casefold_cache(void) > { > kmem_cache_destroy(f2fs_cf_name_slab); > } > -#else > -static int __init f2fs_create_casefold_cache(void) { return 0; } > -static void f2fs_destroy_casefold_cache(void) { } > -#endif [...] > @@ -4611,7 +4608,10 @@ static int __init init_f2fs_fs(void) > err = f2fs_init_compress_cache(); > if (err) > goto free_compress_mempool; > - err = f2fs_create_casefold_cache(); > + > + if (IS_ENABLED(CONFIG_UNICODE)) > + err = f2fs_create_casefold_cache(); > + > if (err) > goto free_compress_cache; > return 0; > @@ -4654,7 +4654,9 @@ static int __init init_f2fs_fs(void) > > static void __exit exit_f2fs_fs(void) > { > - f2fs_destroy_casefold_cache(); > + if (IS_ENABLED(CONFIG_UNICODE)) > + f2fs_destroy_casefold_cache(); > + I don't think the above two changes are actually an improvement. It's cleaner to use stub functions to keep the callers simpler, as the original code did. - Eric _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel