All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] f2fs: compress: Allow modular (de)compression algorithms
Date: Mon, 22 Feb 2021 13:59:16 +0100	[thread overview]
Message-ID: <20210222125916.4168804-1-geert@linux-m68k.org> (raw)

If F2FS_FS is modular, enabling the compressions options
F2FS_FS_{LZ4,LZ4HZ,LZO,LZORLE,ZSTD} will make the (de)compression
algorithms {LZ4,LZ4HC,LZO,ZSTD}_{,DE}COMPRESS builtin instead of
modular, as the former depend on an intermediate boolean
F2FS_FS_COMPRESSION, which in-turn depends on tristate F2FS_FS.

Indeed, if a boolean symbol A depends directly on a tristate symbol B
and selects another tristate symbol C:

    tristate B

    tristate C

    bool A
      depends on B
      select C

and B is modular, then C will also be modular.

However, if there is an intermediate boolean D in the dependency chain
between A and B:

    tristate B

    tristate C

    bool D
      depends on B

    bool A
      depends on D
      select C

then the modular state won't propagate from B to C, and C will be
builtin instead of modular.

Fix this by making the various compression options depend directly on
F2FS_FS using a big if/endif block.  Drop the now superfluous
dependencies on F2FS_FS from individual symbols.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Perhaps the propagation logic in Kconfig should be fixed instead?
Else people may reintroduce this issue when removing seemingly-unneeded
dependencies.
---
 fs/f2fs/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig
index 62e638a49bbf089a..20a82ecb72b42f84 100644
--- a/fs/f2fs/Kconfig
+++ b/fs/f2fs/Kconfig
@@ -20,9 +20,10 @@ config F2FS_FS
 
 	  If unsure, say N.
 
+if F2FS_FS
+
 config F2FS_STAT_FS
 	bool "F2FS Status Information"
-	depends on F2FS_FS
 	default y
 	help
 	  /sys/kernel/debug/f2fs/ contains information about all the partitions
@@ -35,7 +36,6 @@ config F2FS_STAT_FS
 
 config F2FS_FS_XATTR
 	bool "F2FS extended attributes"
-	depends on F2FS_FS
 	default y
 	help
 	  Extended attributes are name:value pairs associated with inodes by
@@ -70,7 +70,6 @@ config F2FS_FS_SECURITY
 
 config F2FS_CHECK_FS
 	bool "F2FS consistency checking feature"
-	depends on F2FS_FS
 	help
 	  Enables BUG_ONs which check the filesystem consistency in runtime.
 
@@ -78,7 +77,6 @@ config F2FS_CHECK_FS
 
 config F2FS_FAULT_INJECTION
 	bool "F2FS fault injection facility"
-	depends on F2FS_FS
 	help
 	  Test F2FS to inject faults such as ENOMEM, ENOSPC, and so on.
 
@@ -86,7 +84,6 @@ config F2FS_FAULT_INJECTION
 
 config F2FS_FS_COMPRESSION
 	bool "F2FS compression feature"
-	depends on F2FS_FS
 	help
 	  Enable filesystem-level compression on f2fs regular files,
 	  multiple back-end compression algorithms are supported.
@@ -137,3 +134,5 @@ config F2FS_FS_LZORLE
 	default y
 	help
 	  Support LZO-RLE compress algorithm, if unsure, say Y.
+
+endif
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kbuild@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] f2fs: compress: Allow modular (de)compression algorithms
Date: Mon, 22 Feb 2021 13:59:16 +0100	[thread overview]
Message-ID: <20210222125916.4168804-1-geert@linux-m68k.org> (raw)

If F2FS_FS is modular, enabling the compressions options
F2FS_FS_{LZ4,LZ4HZ,LZO,LZORLE,ZSTD} will make the (de)compression
algorithms {LZ4,LZ4HC,LZO,ZSTD}_{,DE}COMPRESS builtin instead of
modular, as the former depend on an intermediate boolean
F2FS_FS_COMPRESSION, which in-turn depends on tristate F2FS_FS.

Indeed, if a boolean symbol A depends directly on a tristate symbol B
and selects another tristate symbol C:

    tristate B

    tristate C

    bool A
      depends on B
      select C

and B is modular, then C will also be modular.

However, if there is an intermediate boolean D in the dependency chain
between A and B:

    tristate B

    tristate C

    bool D
      depends on B

    bool A
      depends on D
      select C

then the modular state won't propagate from B to C, and C will be
builtin instead of modular.

Fix this by making the various compression options depend directly on
F2FS_FS using a big if/endif block.  Drop the now superfluous
dependencies on F2FS_FS from individual symbols.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
Perhaps the propagation logic in Kconfig should be fixed instead?
Else people may reintroduce this issue when removing seemingly-unneeded
dependencies.
---
 fs/f2fs/Kconfig | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig
index 62e638a49bbf089a..20a82ecb72b42f84 100644
--- a/fs/f2fs/Kconfig
+++ b/fs/f2fs/Kconfig
@@ -20,9 +20,10 @@ config F2FS_FS
 
 	  If unsure, say N.
 
+if F2FS_FS
+
 config F2FS_STAT_FS
 	bool "F2FS Status Information"
-	depends on F2FS_FS
 	default y
 	help
 	  /sys/kernel/debug/f2fs/ contains information about all the partitions
@@ -35,7 +36,6 @@ config F2FS_STAT_FS
 
 config F2FS_FS_XATTR
 	bool "F2FS extended attributes"
-	depends on F2FS_FS
 	default y
 	help
 	  Extended attributes are name:value pairs associated with inodes by
@@ -70,7 +70,6 @@ config F2FS_FS_SECURITY
 
 config F2FS_CHECK_FS
 	bool "F2FS consistency checking feature"
-	depends on F2FS_FS
 	help
 	  Enables BUG_ONs which check the filesystem consistency in runtime.
 
@@ -78,7 +77,6 @@ config F2FS_CHECK_FS
 
 config F2FS_FAULT_INJECTION
 	bool "F2FS fault injection facility"
-	depends on F2FS_FS
 	help
 	  Test F2FS to inject faults such as ENOMEM, ENOSPC, and so on.
 
@@ -86,7 +84,6 @@ config F2FS_FAULT_INJECTION
 
 config F2FS_FS_COMPRESSION
 	bool "F2FS compression feature"
-	depends on F2FS_FS
 	help
 	  Enable filesystem-level compression on f2fs regular files,
 	  multiple back-end compression algorithms are supported.
@@ -137,3 +134,5 @@ config F2FS_FS_LZORLE
 	default y
 	help
 	  Support LZO-RLE compress algorithm, if unsure, say Y.
+
+endif
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

             reply	other threads:[~2021-02-22 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 12:59 Geert Uytterhoeven [this message]
2021-02-22 12:59 ` [f2fs-dev] [PATCH] f2fs: compress: Allow modular (de)compression algorithms Geert Uytterhoeven
2021-02-23  6:30 ` Masahiro Yamada
2021-02-23  6:30   ` [f2fs-dev] " Masahiro Yamada
2021-02-23  7:42   ` Geert Uytterhoeven
2021-02-23  7:42     ` [f2fs-dev] " Geert Uytterhoeven
2021-02-26  2:14     ` Chao Yu
2021-02-26  2:14       ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210222125916.4168804-1-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.