Skip to content

Commit

Permalink
[JFFS2] Clean up trailing white spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
KAGA-KOKO authored and Thomas Gleixner committed Nov 7, 2005
1 parent 97894cd commit 182ec4e
Show file tree
Hide file tree
Showing 36 changed files with 604 additions and 605 deletions.
10 changes: 5 additions & 5 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,10 @@ config JFFS2_ZLIB
default y
help
Zlib is designed to be a free, general-purpose, legally unencumbered,
lossless data-compression library for use on virtually any computer
lossless data-compression library for use on virtually any computer
hardware and operating system. See <http://www.gzip.org/zlib/> for
further information.

Say 'Y' if unsure.

config JFFS2_RTIME
Expand All @@ -1109,7 +1109,7 @@ choice
default JFFS2_CMODE_PRIORITY
depends on JFFS2_FS
help
You can set here the default compression mode of JFFS2 from
You can set here the default compression mode of JFFS2 from
the available compression modes. Don't touch if unsure.

config JFFS2_CMODE_NONE
Expand All @@ -1120,13 +1120,13 @@ config JFFS2_CMODE_NONE
config JFFS2_CMODE_PRIORITY
bool "priority"
help
Tries the compressors in a predefinied order and chooses the first
Tries the compressors in a predefinied order and chooses the first
successful one.

config JFFS2_CMODE_SIZE
bool "size (EXPERIMENTAL)"
help
Tries all compressors and chooses the one which has the smallest
Tries all compressors and chooses the one which has the smallest
result.

endchoice
Expand Down
4 changes: 2 additions & 2 deletions fs/jffs2/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c)
D1(printk(KERN_DEBUG "JFFS2: Garbage collect thread is pid %d\n", pid));
wait_for_completion(&c->gc_thread_start);
}

return ret;
}

Expand Down Expand Up @@ -101,7 +101,7 @@ static int jffs2_garbage_collect_thread(void *_c)

cond_resched();

/* Put_super will send a SIGKILL and then wait on the sem.
/* Put_super will send a SIGKILL and then wait on the sem.
*/
while (signal_pending(current)) {
siginfo_t info;
Expand Down
28 changes: 14 additions & 14 deletions fs/jffs2/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: build.c,v 1.84 2005/09/27 13:40:49 dedekind Exp $
* $Id: build.c,v 1.85 2005/11/07 11:14:38 gleixner Exp $
*
*/

Expand Down Expand Up @@ -129,10 +129,10 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
for_each_inode(i, c, ic) {
if (ic->nlink)
continue;

jffs2_build_remove_unlinked_inode(c, ic, &dead_fds);
cond_resched();
}
}

dbg_fsbuild("pass 2a starting\n");

Expand All @@ -149,7 +149,7 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)

dbg_fsbuild("pass 2a complete\n");
dbg_fsbuild("freeing temporary data structures\n");

/* Finally, we can scan again and free the dirent structs */
for_each_inode(i, c, ic) {
while(ic->scan_dents) {
Expand All @@ -161,7 +161,7 @@ static int jffs2_build_filesystem(struct jffs2_sb_info *c)
cond_resched();
}
c->flags &= ~JFFS2_SB_FLAG_BUILDING;

dbg_fsbuild("FS build complete\n");

/* Rotate the lists by some number to ensure wear levelling */
Expand Down Expand Up @@ -191,7 +191,7 @@ static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c,
struct jffs2_full_dirent *fd;

dbg_fsbuild("removing ino #%u with nlink == zero.\n", ic->ino);

raw = ic->nodes;
while (raw != (void *)ic) {
struct jffs2_raw_node_ref *next = raw->next_in_ino;
Expand Down Expand Up @@ -220,7 +220,7 @@ static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c,
whinged = 1;

dbg_fsbuild("removing child \"%s\", ino #%u\n", fd->name, fd->ino);

child_ic = jffs2_get_ino_cache(c, fd->ino);
if (!child_ic) {
dbg_fsbuild("cannot remove child \"%s\", ino #%u, because it doesn't exist\n",
Expand All @@ -229,11 +229,11 @@ static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c,
continue;
}

/* Reduce nlink of the child. If it's now zero, stick it on the
/* Reduce nlink of the child. If it's now zero, stick it on the
dead_fds list to be cleaned up later. Else just free the fd */

child_ic->nlink--;

if (!child_ic->nlink) {
dbg_fsbuild("inode #%u (\"%s\") has now got zero nlink, adding to dead_fds list.\n",
fd->ino, fd->name);
Expand All @@ -248,7 +248,7 @@ static void jffs2_build_remove_unlinked_inode(struct jffs2_sb_info *c,
}

/*
We don't delete the inocache from the hash list and free it yet.
We don't delete the inocache from the hash list and free it yet.
The erase code will do that, when all the nodes are completely gone.
*/
}
Expand All @@ -262,7 +262,7 @@ static void jffs2_calc_trigger_levels(struct jffs2_sb_info *c)
because there's not enough free space... */
c->resv_blocks_deletion = 2;

/* Be conservative about how much space we need before we allow writes.
/* Be conservative about how much space we need before we allow writes.
On top of that which is required for deletia, require an extra 2%
of the medium to be available, for overhead caused by nodes being
split across blocks, etc. */
Expand All @@ -277,7 +277,7 @@ static void jffs2_calc_trigger_levels(struct jffs2_sb_info *c)

c->resv_blocks_gctrigger = c->resv_blocks_write + 1;

/* When do we allow garbage collection to merge nodes to make
/* When do we allow garbage collection to merge nodes to make
long-term progress at the expense of short-term space exhaustion? */
c->resv_blocks_gcmerge = c->resv_blocks_deletion + 1;

Expand All @@ -303,7 +303,7 @@ static void jffs2_calc_trigger_levels(struct jffs2_sb_info *c)
c->resv_blocks_gcbad, c->resv_blocks_gcbad*c->sector_size/1024);
dbg_fsbuild("Amount of dirty space required to GC: %d bytes\n",
c->nospc_dirty_size);
}
}

int jffs2_do_mount_fs(struct jffs2_sb_info *c)
{
Expand Down Expand Up @@ -355,7 +355,7 @@ int jffs2_do_mount_fs(struct jffs2_sb_info *c)
#ifndef __ECOS
if (jffs2_blocks_use_vmalloc(c))
vfree(c->blocks);
else
else
#endif
kfree(c->blocks);

Expand Down
28 changes: 14 additions & 14 deletions fs/jffs2/compr.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
* $Id: compr.c,v 1.45 2005/07/26 13:24:40 havasi Exp $
* $Id: compr.c,v 1.46 2005/11/07 11:14:38 gleixner Exp $
*
*/

Expand All @@ -36,16 +36,16 @@ static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_co
* data.
*
* Returns: Lower byte to be stored with data indicating compression type used.
* Zero is used to show that the data could not be compressed - the
* Zero is used to show that the data could not be compressed - the
* compressed version was actually larger than the original.
* Upper byte will be used later. (soon)
*
* If the cdata buffer isn't large enough to hold all the uncompressed data,
* jffs2_compress should compress as much as will fit, and should set
* jffs2_compress should compress as much as will fit, and should set
* *datalen accordingly to show the amount of data which were compressed.
*/
uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
unsigned char *data_in, unsigned char **cpage_out,
unsigned char *data_in, unsigned char **cpage_out,
uint32_t *datalen, uint32_t *cdatalen)
{
int ret = JFFS2_COMPR_NONE;
Expand Down Expand Up @@ -164,7 +164,7 @@ uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
}

int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f,
uint16_t comprtype, unsigned char *cdata_in,
uint16_t comprtype, unsigned char *cdata_in,
unsigned char *data_out, uint32_t cdatalen, uint32_t datalen)
{
struct jffs2_compressor *this;
Expand Down Expand Up @@ -298,7 +298,7 @@ char *jffs2_stats(void)

act_buf += sprintf(act_buf,"JFFS2 compressor statistics:\n");
act_buf += sprintf(act_buf,"%10s ","none");
act_buf += sprintf(act_buf,"compr: %d blocks (%d) decompr: %d blocks\n", none_stat_compr_blocks,
act_buf += sprintf(act_buf,"compr: %d blocks (%d) decompr: %d blocks\n", none_stat_compr_blocks,
none_stat_compr_size, none_stat_decompr_blocks);
spin_lock(&jffs2_compressor_list_lock);
list_for_each_entry(this, &jffs2_compressor_list, list) {
Expand All @@ -307,8 +307,8 @@ char *jffs2_stats(void)
act_buf += sprintf(act_buf,"- ");
else
act_buf += sprintf(act_buf,"+ ");
act_buf += sprintf(act_buf,"compr: %d blocks (%d/%d) decompr: %d blocks ", this->stat_compr_blocks,
this->stat_compr_new_size, this->stat_compr_orig_size,
act_buf += sprintf(act_buf,"compr: %d blocks (%d/%d) decompr: %d blocks ", this->stat_compr_blocks,
this->stat_compr_new_size, this->stat_compr_orig_size,
this->stat_decompr_blocks);
act_buf += sprintf(act_buf,"\n");
}
Expand All @@ -317,7 +317,7 @@ char *jffs2_stats(void)
return buf;
}

char *jffs2_get_compression_mode_name(void)
char *jffs2_get_compression_mode_name(void)
{
switch (jffs2_compression_mode) {
case JFFS2_COMPR_MODE_NONE:
Expand All @@ -330,7 +330,7 @@ char *jffs2_get_compression_mode_name(void)
return "unkown";
}

int jffs2_set_compression_mode_name(const char *name)
int jffs2_set_compression_mode_name(const char *name)
{
if (!strcmp("none",name)) {
jffs2_compression_mode = JFFS2_COMPR_MODE_NONE;
Expand All @@ -355,7 +355,7 @@ static int jffs2_compressor_Xable(const char *name, int disabled)
if (!strcmp(this->name, name)) {
this->disabled = disabled;
spin_unlock(&jffs2_compressor_list_lock);
return 0;
return 0;
}
}
spin_unlock(&jffs2_compressor_list_lock);
Expand Down Expand Up @@ -385,7 +385,7 @@ int jffs2_set_compressor_priority(const char *name, int priority)
}
}
spin_unlock(&jffs2_compressor_list_lock);
printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name);
printk(KERN_WARNING "JFFS2: compressor %s not found.\n",name);
return 1;
reinsert:
/* list is sorted in the order of priority, so if
Expand All @@ -412,7 +412,7 @@ void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig)
kfree(comprbuf);
}

int jffs2_compressors_init(void)
int jffs2_compressors_init(void)
{
/* Registering compressors */
#ifdef CONFIG_JFFS2_ZLIB
Expand Down Expand Up @@ -440,7 +440,7 @@ int jffs2_compressors_init(void)
return 0;
}

int jffs2_compressors_exit(void)
int jffs2_compressors_exit(void)
{
/* Unregistering compressors */
#ifdef CONFIG_JFFS2_RUBIN
Expand Down
4 changes: 2 additions & 2 deletions fs/jffs2/compr.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* Copyright (C) 2004 Ferenc Havasi <[email protected]>,
* University of Szeged, Hungary
*
* For licensing information, see the file 'LICENCE' in the
* For licensing information, see the file 'LICENCE' in the
* jffs2 directory.
*
* $Id: compr.h,v 1.8 2005/07/26 13:24:40 havasi Exp $
* $Id: compr.h,v 1.9 2005/11/07 11:14:38 gleixner Exp $
*
*/

Expand Down
32 changes: 16 additions & 16 deletions fs/jffs2/compr_rtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/jffs2.h>
#include <linux/string.h>
#include <linux/jffs2.h>
#include "compr.h"

/* _compress returns the compressed size, -1 if bigger */
Expand All @@ -38,19 +38,19 @@ static int jffs2_rtime_compress(unsigned char *data_in,
int outpos = 0;
int pos=0;

memset(positions,0,sizeof(positions));
memset(positions,0,sizeof(positions));

while (pos < (*sourcelen) && outpos <= (*dstlen)-2) {
int backpos, runlen=0;
unsigned char value;

value = data_in[pos];

cpage_out[outpos++] = data_in[pos++];

backpos = positions[value];
positions[value]=pos;

while ((backpos < pos) && (pos < (*sourcelen)) &&
(data_in[pos]==data_in[backpos++]) && (runlen<255)) {
pos++;
Expand All @@ -63,12 +63,12 @@ static int jffs2_rtime_compress(unsigned char *data_in,
/* We failed */
return -1;
}

/* Tell the caller how much we managed to compress, and how much space it took */
*sourcelen = pos;
*dstlen = outpos;
return 0;
}
}


static int jffs2_rtime_decompress(unsigned char *data_in,
Expand All @@ -79,19 +79,19 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
short positions[256];
int outpos = 0;
int pos=0;
memset(positions,0,sizeof(positions));

memset(positions,0,sizeof(positions));

while (outpos<destlen) {
unsigned char value;
int backoffs;
int repeat;

value = data_in[pos++];
cpage_out[outpos++] = value; /* first the verbatim copied byte */
repeat = data_in[pos++];
backoffs = positions[value];

positions[value]=outpos;
if (repeat) {
if (backoffs + repeat >= outpos) {
Expand All @@ -101,12 +101,12 @@ static int jffs2_rtime_decompress(unsigned char *data_in,
}
} else {
memcpy(&cpage_out[outpos],&cpage_out[backoffs],repeat);
outpos+=repeat;
outpos+=repeat;
}
}
}
return 0;
}
}

static struct jffs2_compressor jffs2_rtime_comp = {
.priority = JFFS2_RTIME_PRIORITY,
Expand Down
Loading

0 comments on commit 182ec4e

Please sign in to comment.