Skip to contentSkip to conversation

jffs2: Allow selection of compression mode via a sysfs attribute

PATCH In review Richard Purdie 2 participants 2 messages Jul 10, 2007 – Jul 11, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/3 jffs2: Allow selection of compression mode via a sysfs attribute

Allow selection of the compression mode for jffs2 via a sysfs attribute. This establishes a sysfs presence for jffs2 through which other compression options could easily be exported too.

---
 fs/Kconfig       |    9 ++++++++
 fs/jffs2/compr.c |   41 ++++++++++++++++++++++++++++++++++++
 fs/jffs2/compr.h |    6 +++++
 fs/jffs2/super.c |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 117 insertions(+)
fs/Kconfig +9 -0
Index: linux/fs/Kconfig
===================================================================
@@ -1279,6 +1279,15 @@ config JFFS2_FS_SECURITY
 	  If you are not using a security module that requires using
 	  extended attributes for file security labels, say N.
 
+config JFFS2_SYSFS
+	bool "JFFS2 sysfs attributes"
+	depends on JFFS2_FS
+	default n
+	help
+	  Enable control of jffs2 features through sysfs.
+
+	  If unsure, say 'N'.
+
 config JFFS2_COMPRESSION_OPTIONS
 	bool "Advanced compression options for JFFS2"
 	depends on JFFS2_FS
fs/jffs2/compr.c +41 -0

53 lines not on this page · raw message

fs/jffs2/compr.h +6 -0
Index: linux/fs/jffs2/compr.h
===================================================================
@@ -77,6 +77,12 @@ int jffs2_decompress(struct jffs2_sb_inf
 
 void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig);
 
+#ifdef CONFIG_JFFS2_SYSFS
+int jffs2_set_compression_mode_name(const char *mode_name);
+char *jffs2_get_compression_mode_name(void);
+#endif
+
+
 /* Compressor modules */
 /* These functions will be called by jffs2_compressors_init/exit */
 
fs/jffs2/super.c +61 -0

79 lines not on this page · raw message

maintainer
#1 lore raw
Quoted 3 lines · Richard Purdie

Allow selection of the compression mode for jffs2 via a sysfs attribute. This establishes a sysfs presence for jffs2 through which other compression options could easily be exported too.

Hm, shouldn't this be per-filesystem rather than global? That way, stuff like free space tuning &c could be exposed too.

Maybe the compression mode could be done as a mount option anyway?

Signature · 1 line
dwmw2