public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Richard Purdie <rpurdie@openedhand.com>
Cc: linux-crypto@vger.kernel.org,
	linux-mtd <linux-mtd@lists.infradead.org>,
	David Woodhouse <dwmw2@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	herbert@gondor.apana.org.au
Subject: Re: [PATCH 4/5] jffs2: Allow selection of compression mode via a sysfs attribute
Date: Tue, 1 May 2007 13:08:11 -0700	[thread overview]
Message-ID: <20070501130811.5c9c9f7d.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1178030839.5883.56.camel@localhost.localdomain>

On Tue, 01 May 2007 15:47:19 +0100 Richard Purdie wrote:

> 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.
> 
> Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
> ---
>  fs/Kconfig       |    9 ++++++++
>  fs/jffs2/compr.c |   41 ++++++++++++++++++++++++++++++++++++
>  fs/jffs2/compr.h |    6 +++++
>  fs/jffs2/super.c |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 117 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 328a62f..9da136b 100644
> diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c
> index fdb0efd..8c57dc7 100644
> --- a/fs/jffs2/compr.c
> +++ b/fs/jffs2/compr.c
> @@ -11,6 +11,7 @@
>   *
>   */
>  
> +#include <linux/kobject.h>

is that used/needed in this source file?

>  #include "compr.h"
>  
>  static DEFINE_SPINLOCK(jffs2_compressor_list_lock);
> @@ -296,6 +297,46 @@ int jffs2_unregister_compressor(struct jffs2_compressor *comp)
>          return 0;
>  }
>  
> +#ifdef CONFIG_JFFS2_SYSFS
> +
> +char *jffs2_get_compression_mode_name(void)
> +{
> +        switch (jffs2_compression_mode) {
> +        case JFFS2_COMPR_MODE_NONE:
> +                return "none";
> +        case JFFS2_COMPR_MODE_PRIORITY:
> +                return "priority";
> +        case JFFS2_COMPR_MODE_SIZE:
> +                return "size";
> +	case JFFS2_COMPR_MODE_FAVOURLZO:
> +		return "favourlzo";
> +        }
> +        return "unkown";

Lots of whitespace damage above (needs tabs).

> +}
> +
> +int jffs2_set_compression_mode_name(const char *name)
> +{
> +        if (!strncmp("none", name, 4)) {
> +                jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
> +                return 0;
> +        }
> +        if (!strncmp("priority", name, 8)) {
> +                jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
> +                return 0;
> +        }
> +        if (!strncmp("size", name, 4)) {
> +                jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE;
> +                return 0;
> +        }
> +	if (!strncmp("favourlzo", name, 9)) {
> +		jffs2_compression_mode = JFFS2_COMPR_MODE_FAVOURLZO;
> +		return 0;
> +	}
> +        return -EINVAL;

Lots of tabs needed above also.

> +}
> +
> +#endif
> +
>  void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
>  {
>          if (orig != comprbuf)


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  reply	other threads:[~2007-05-01 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-01 14:47 [PATCH 4/5] jffs2: Allow selection of compression mode via a sysfs attribute Richard Purdie
2007-05-01 20:08 ` Randy Dunlap [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-05-04 11:31 Richard Purdie

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=20070501130811.5c9c9f7d.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=dwmw2@infradead.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rpurdie@openedhand.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox