From: Charles Manning Date: Mon, 8 Nov 2010 23:06:41 +0000 (+1300) Subject: Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2 X-Git-Tag: linux-mainline-patchset-4~110 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=1c8604a29f8ca073e1f5129c58e201a4b42bc192;hp=e0b53924703fe414a99dbf49682cf8459540a3e5 Merge branch 'master' of ssh://aleph1.co.uk/home/aleph1/git/yaffs2 --- diff --git a/Kconfig b/Kconfig index 7b3988c..6354140 100644 --- a/Kconfig +++ b/Kconfig @@ -102,22 +102,6 @@ config YAFFS_DISABLE_TAGS_ECC If unsure, say N. - -config YAFFS_DISABLE_WIDE_TNODES - bool "Turn off wide tnodes" - depends on YAFFS_FS - default n - help - Wide tnodes are only used for NAND arrays >=32MB for 512-byte - page devices and >=128MB for 2k page devices. They use slightly - more RAM but are faster since they eliminate chunk group - searching. - - Setting this to 'y' will force tnode width to 16 bits and save - memory but make large arrays slower. - - If unsure, say N. - config YAFFS_ALWAYS_CHECK_CHUNK_ERASED bool "Force chunk erase check" depends on YAFFS_FS @@ -136,17 +120,6 @@ config YAFFS_ALWAYS_CHECK_CHUNK_ERASED If unsure, say Y. -config YAFFS_SHORT_NAMES_IN_RAM - bool "Cache short names in RAM" - depends on YAFFS_FS - default y - help - If this config is set, then short names are stored with the - yaffs_Object. This costs an extra 16 bytes of RAM per object, - but makes look-ups faster. - - If unsure, say Y. - config YAFFS_EMPTY_LOST_AND_FOUND bool "Empty lost and found on boot" depends on YAFFS_FS @@ -177,7 +150,7 @@ config YAFFS_DISABLE_BACKGROUND If this is set, then background processing is disabled. Background processing makes many foreground activities faster. - If unsure, say N. + If unsure, say N. config YAFFS_XATTR bool "Enable yaffs2 xattr support" @@ -186,5 +159,3 @@ config YAFFS_XATTR help If this is set then yaffs2 will provide xattr support. If unsure, say Y. - - diff --git a/direct/basic-test/Makefile b/direct/basic-test/Makefile index 7847528..2c558f0 100644 --- a/direct/basic-test/Makefile +++ b/direct/basic-test/Makefile @@ -18,7 +18,7 @@ #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC -CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 +CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2 CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Werror=strict-aliasing #CFLAGS += -fno-strict-aliasing diff --git a/direct/python/Makefile b/direct/python/Makefile index 7c7a063..38f8b11 100644 --- a/direct/python/Makefile +++ b/direct/python/Makefile @@ -18,7 +18,7 @@ #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC -CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 +CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2 CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES -DNO_Y_INLINE CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing #CFLAGS += -fno-strict-aliasing diff --git a/direct/tests/Makefile b/direct/tests/Makefile index 016b934..956e34f 100644 --- a/direct/tests/Makefile +++ b/direct/tests/Makefile @@ -18,7 +18,7 @@ #EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC -CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 +CFLAGS = -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_YAFFS2 CFLAGS += -DCONFIG_YAFFS_PROVIDE_DEFS -DCONFIG_YAFFSFS_PROVIDE_VALUES CFLAGS += -Wall -g $(EXTRA_COMPILE_FLAGS) -Wstrict-aliasing #CFLAGS += -fno-strict-aliasing diff --git a/moduleconfig.h b/moduleconfig.h index 20a0882..83cf0c1 100644 --- a/moduleconfig.h +++ b/moduleconfig.h @@ -49,10 +49,6 @@ /* empty directory. This can also be achieved with a mount option. */ #define CONFIG_YAFFS_EMPTY_LOST_AND_FOUND -/* Default: Selected */ -/* Meaning: Cache short names, taking more RAM, but faster look-ups */ -#define CONFIG_YAFFS_SHORT_NAMES_IN_RAM - /* Default: Unselected */ /* Meaning: Select to disable block refreshing. */ /* Block Refreshing periodically rewrites the oldest block. */ diff --git a/yaffs_allocator.c b/yaffs_allocator.c index 03ede86..b9fe31e 100644 --- a/yaffs_allocator.c +++ b/yaffs_allocator.c @@ -123,8 +123,9 @@ static void yaffs_init_raw_tnodes(struct yaffs_dev *dev) allocator->free_tnodes = NULL; allocator->n_free_tnodes = 0; allocator->n_tnodes_created = 0; - } else + } else { YBUG(); + } } static int yaffs_create_tnodes(struct yaffs_dev *dev, int n_tnodes) @@ -243,8 +244,9 @@ static void yaffs_init_raw_objs(struct yaffs_dev *dev) allocator->allocated_obj_list = NULL; allocator->free_objs = NULL; allocator->n_free_objects = 0; - } else + } else { YBUG(); + } } static void yaffs_deinit_raw_objs(struct yaffs_dev *dev) @@ -371,8 +373,9 @@ void yaffs_deinit_raw_tnodes_and_objs(struct yaffs_dev *dev) YFREE(dev->allocator); dev->allocator = NULL; - } else + } else { YBUG(); + } } void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev) @@ -386,8 +389,9 @@ void yaffs_init_raw_tnodes_and_objs(struct yaffs_dev *dev) yaffs_init_raw_tnodes(dev); yaffs_init_raw_objs(dev); } - } else + } else { YBUG(); + } } #endif diff --git a/yaffs_checkptrw.c b/yaffs_checkptrw.c index 2cb144c..02b8ce6 100644 --- a/yaffs_checkptrw.c +++ b/yaffs_checkptrw.c @@ -403,8 +403,9 @@ int yaffs_checkpt_close(struct yaffs_dev *dev) YFREE(dev->checkpt_buffer); dev->checkpt_buffer = NULL; return 1; - } else + } else { return 0; + } } int yaffs2_checkpt_invalidate_stream(struct yaffs_dev *dev) diff --git a/yaffs_guts.c b/yaffs_guts.c index a9fc46c..110a3c2 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -604,12 +604,10 @@ static u16 yaffs_calc_name_sum(const YCHAR * name) void yaffs_set_obj_name(struct yaffs_obj *obj, const YCHAR * name) { -#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM - memset(obj->short_name, 0, - sizeof(YCHAR) * (YAFFS_SHORT_NAME_LENGTH + 1)); - if (name - && yaffs_strnlen(name, - YAFFS_SHORT_NAME_LENGTH + 1) <= +#ifndef CONFIG_YAFFS_NO_SHORT_NAMES + memset(obj->short_name, 0, sizeof(obj->short_name)); + if (name && + yaffs_strnlen(name, YAFFS_SHORT_NAME_LENGTH + 1) <= YAFFS_SHORT_NAME_LENGTH) yaffs_strcpy(obj->short_name, name); else @@ -1708,8 +1706,9 @@ static int yaffs_init_blocks(struct yaffs_dev *dev) dev->block_info = YMALLOC_ALT(n_blocks * sizeof(struct yaffs_block_info)); dev->block_info_alt = 1; - } else + } else { dev->block_info_alt = 0; + } if (dev->block_info) { /* Set up dynamic blockinfo stuff. */ @@ -1719,8 +1718,9 @@ static int yaffs_init_blocks(struct yaffs_dev *dev) dev->chunk_bits = YMALLOC_ALT(dev->chunk_bit_stride * n_blocks); dev->chunk_bits_alt = 1; - } else + } else { dev->chunk_bits_alt = 0; + } } if (dev->block_info && dev->chunk_bits) { @@ -2174,12 +2174,13 @@ static int yaffs_gc_block(struct yaffs_dev *dev, int block, int whole_block) oh, &tags, 1); - } else + } else { new_chunk = yaffs_write_new_chunk(dev, buffer, &tags, 1); + } if (new_chunk < 0) { ret_val = YAFFS_FAIL; @@ -2385,8 +2386,9 @@ static unsigned yaffs_find_gc_block(struct yaffs_dev *dev, bi = yaffs_get_block_info(dev, selected); dev->gc_pages_in_use = bi->pages_in_use - bi->soft_del_pages; - } else + } else { dev->gc_not_done = 0; + } } if (selected) { @@ -2921,8 +2923,9 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR * name, int force, memcpy(old_name, oh->name, sizeof(oh->name)); memset(buffer, 0xFF, sizeof(struct yaffs_obj_hdr)); - } else + } else { memset(buffer, 0xFF, dev->data_bytes_per_chunk); + } oh->type = in->variant_type; oh->yst_mode = in->yst_mode; @@ -2938,10 +2941,11 @@ int yaffs_update_oh(struct yaffs_obj *in, const YCHAR * name, int force, if (name && *name) { memset(oh->name, 0, sizeof(oh->name)); yaffs_load_oh_from_name(dev, oh->name, name); - } else if (prev_chunk_id > 0) + } else if (prev_chunk_id > 0) { memcpy(oh->name, old_name, sizeof(oh->name)); - else + } else { memset(oh->name, 0, sizeof(oh->name)); + } oh->is_shrink = is_shrink; @@ -3210,9 +3214,9 @@ static struct yaffs_cache *yaffs_grab_chunk_cache(struct yaffs_dev *dev) } return cache; - } else + } else { return NULL; - + } } /* Find a cached chunk */ @@ -3932,11 +3936,12 @@ static int yaffs_unlink_worker(struct yaffs_obj *obj) default: return YAFFS_FAIL; } - } else if (yaffs_is_non_empty_dir(obj)) + } else if (yaffs_is_non_empty_dir(obj)) { return YAFFS_FAIL; - else + } else { return yaffs_change_obj_name(obj, obj->my_dev->unlinked_dir, _Y("unlinked"), 0, 0); + } } static int yaffs_unlink_obj(struct yaffs_obj *obj) @@ -4103,11 +4108,11 @@ static void yaffs_fix_hanging_objs(struct yaffs_dev *dev) hanging = 0; } else if (!parent || parent->variant_type != - YAFFS_OBJECT_TYPE_DIRECTORY) + YAFFS_OBJECT_TYPE_DIRECTORY) { hanging = 1; - else if (yaffs_has_null_parent(dev, parent)) + } else if (yaffs_has_null_parent(dev, parent)) { hanging = 0; - else { + } else { /* * Need to follow the parent chain to see if it is hanging. */ @@ -4248,8 +4253,9 @@ static void yaffs_update_parent(struct yaffs_obj *obj) obj->obj_id)); } - } else + } else { yaffs_update_oh(obj, NULL, 0, 0, 0, NULL); + } } void yaffs_update_dirty_dirs(struct yaffs_dev *dev) @@ -4378,8 +4384,7 @@ struct yaffs_obj *yaffs_find_by_name(struct yaffs_obj *directory, /* Special case for lost-n-found */ if (l->obj_id == YAFFS_OBJECTID_LOSTNFOUND) { - if (yaffs_strcmp(name, YAFFS_LOSTNFOUND_NAME) == - 0) + if (!yaffs_strcmp(name, YAFFS_LOSTNFOUND_NAME)) return l; } else if (yaffs_sum_cmp(l->sum, sum) || l->hdr_chunk <= 0) { @@ -4468,11 +4473,15 @@ static void yaffs_load_name_from_oh(struct yaffs_dev *dev, YCHAR * name, ascii_oh_name++; n--; } - } else + } else { yaffs_strncpy(name, oh_name + 1, buff_size - 1); - } else + } + } else { +#else + { #endif yaffs_strncpy(name, oh_name, buff_size - 1); + } } static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR * oh_name, @@ -4511,9 +4520,12 @@ static void yaffs_load_oh_from_name(struct yaffs_dev *dev, YCHAR * oh_name, yaffs_strncpy(oh_name + 1, name, YAFFS_MAX_NAME_LENGTH - 2); } - } else + } else { +#else + { #endif yaffs_strncpy(oh_name, name, YAFFS_MAX_NAME_LENGTH - 1); + } } @@ -4526,7 +4538,7 @@ int yaffs_get_obj_name(struct yaffs_obj *obj, YCHAR * name, int buffer_size) if (obj->obj_id == YAFFS_OBJECTID_LOSTNFOUND) { yaffs_strncpy(name, YAFFS_LOSTNFOUND_NAME, buffer_size - 1); } -#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM +#ifndef CONFIG_YAFFS_NO_SHORT_NAMES else if (obj->short_name[0]) { yaffs_strcpy(name, obj->short_name); } @@ -4926,8 +4938,9 @@ int yaffs_guts_initialise(struct yaffs_dev *dev) dev->tnode_width = 16; else dev->tnode_width = bits; - } else + } else { dev->tnode_width = 16; + } dev->tnode_mask = (1 << dev->tnode_width) - 1; @@ -5078,8 +5091,9 @@ int yaffs_guts_initialise(struct yaffs_dev *dev) if (!init_failed && !yaffs2_scan_backwards(dev)) init_failed = 1; } - } else if (!yaffs1_scan(dev)) + } else if (!yaffs1_scan(dev)) { init_failed = 1; + } yaffs_strip_deleted_objs(dev); yaffs_fix_hanging_objs(dev); diff --git a/yaffs_guts.h b/yaffs_guts.h index 60770ca..2c2ec76 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -422,7 +422,7 @@ struct yaffs_obj { u32 yst_mode; -#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM +#ifndef CONFIG_YAFFS_NO_SHORT_NAMES YCHAR short_name[YAFFS_SHORT_NAME_LENGTH + 1]; #endif diff --git a/yaffs_mtdif2_multi.c b/yaffs_mtdif2_multi.c index 555f937..26609f7 100644 --- a/yaffs_mtdif2_multi.c +++ b/yaffs_mtdif2_multi.c @@ -71,8 +71,9 @@ int nandmtd2_write_chunk_tags(struct yaffs_dev *dev, int nand_chunk, dev-> data_bytes_per_chunk); yaffs_pack_tags2_tags_only(pt2tp, tags); - } else + } else { yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc); + } #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) ops.mode = MTD_OOB_AUTO; diff --git a/yaffs_mtdif2_single.c b/yaffs_mtdif2_single.c index 00040cd..0835078 100644 --- a/yaffs_mtdif2_single.c +++ b/yaffs_mtdif2_single.c @@ -67,8 +67,9 @@ int nandmtd2_write_chunk_tags(struct yaffs_dev *dev, int nand_chunk, dev-> data_bytes_per_chunk); yaffs_pack_tags2_tags_only(pt2tp, tags); - } else + } else { yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc); + } ops.mode = MTD_OOB_AUTO; ops.ooblen = (dev->param.inband_tags) ? 0 : packed_tags_size; diff --git a/yaffs_nameval.c b/yaffs_nameval.c index d7cb72a..d8c548a 100644 --- a/yaffs_nameval.c +++ b/yaffs_nameval.c @@ -81,8 +81,9 @@ int nval_del(char *xb, int xb_size, const YCHAR * name) memcpy(xb + pos, xb + pos + size, xb_size - (pos + size)); memset(xb + (xb_size - size), 0, size); return 0; - } else + } else { return -ENODATA; + } } int nval_set(char *xb, int xb_size, const YCHAR * name, const char *buf, @@ -182,8 +183,9 @@ int nval_list(const char *xb, int xb_size, char *buf, int bsize) buf++; } ncopied += (name_len + 1); - } else + } else { filled = 1; + } pos += size; if (pos < xb_size - sizeof(int)) memcpy(&size, xb + pos, sizeof(int)); diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 9e4e31a..0bb06f4 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -2334,11 +2334,13 @@ static int yaffs_bg_thread_fn(void *data) next_gc = now + HZ / 10 + 1; else next_gc = now + HZ * 2; - } else /* + } else { + /* * gc not running so set to next_dir_update * to cut down on wake ups */ next_gc = next_dir_update; + } } yaffs_gross_unlock(dev); #if 1 @@ -2605,9 +2607,9 @@ static int yaffs_parse_options(struct yaffs_options *options, options_str++; } - if (!strcmp(cur_opt, "inband-tags")) + if (!strcmp(cur_opt, "inband-tags")) { options->inband_tags = 1; - else if (!strcmp(cur_opt, "tags-ecc-off")) { + } else if (!strcmp(cur_opt, "tags-ecc-off")) { options->tags_ecc_on = 0; options->tags_ecc_overridden = 1; } else if (!strcmp(cur_opt, "tags-ecc-on")) { @@ -2625,13 +2627,13 @@ static int yaffs_parse_options(struct yaffs_options *options, } else if (!strcmp(cur_opt, "empty-lost-and-found-on")) { options->empty_lost_and_found = 1; options->empty_lost_and_found_overridden = 1; - } else if (!strcmp(cur_opt, "no-cache")) + } else if (!strcmp(cur_opt, "no-cache")) { options->no_cache = 1; - else if (!strcmp(cur_opt, "no-checkpoint-read")) + } else if (!strcmp(cur_opt, "no-checkpoint-read")) { options->skip_checkpoint_read = 1; - else if (!strcmp(cur_opt, "no-checkpoint-write")) + } else if (!strcmp(cur_opt, "no-checkpoint-write")) { options->skip_checkpoint_write = 1; - else if (!strcmp(cur_opt, "no-checkpoint")) { + } else if (!strcmp(cur_opt, "no-checkpoint")) { options->skip_checkpoint_read = 1; options->skip_checkpoint_write = 1; } else { @@ -3268,8 +3270,9 @@ static int yaffs_proc_read(char *page, sprintf(buf, "\nDevice %d \"%s\"\n", n, dev->param.name); buf = yaffs_dump_dev_part0(buf, dev); - } else + } else { buf = yaffs_dump_dev_part1(buf, dev); + } break; } @@ -3489,8 +3492,9 @@ static int __init init_yaffs_fs(void) my_proc_entry->write_proc = yaffs_proc_write; my_proc_entry->read_proc = yaffs_proc_read; my_proc_entry->data = NULL; - } else + } else { return -ENOMEM; + } debug_proc_entry = create_proc_entry("yaffs_stats", S_IRUGO | S_IFREG, YPROC_ROOT); @@ -3499,8 +3503,9 @@ static int __init init_yaffs_fs(void) debug_proc_entry->write_proc = NULL; debug_proc_entry->read_proc = yaffs_stats_proc_read; debug_proc_entry->data = NULL; - } else + } else { return -ENOMEM; + } /* Now add the file system entries */ diff --git a/yaffs_vfs_single.c b/yaffs_vfs_single.c index a17262c..61bf255 100644 --- a/yaffs_vfs_single.c +++ b/yaffs_vfs_single.c @@ -1890,11 +1890,13 @@ static int yaffs_bg_thread_fn(void *data) next_gc = now + HZ / 10 + 1; else next_gc = now + HZ * 2; - } else /* + } else { + /* * gc not running so set to next_dir_update * to cut down on wake ups */ next_gc = next_dir_update; + } } yaffs_gross_unlock(dev); expires = next_dir_update; @@ -2100,9 +2102,9 @@ static int yaffs_parse_options(struct yaffs_options *options, options_str++; } - if (!strcmp(cur_opt, "inband-tags")) + if (!strcmp(cur_opt, "inband-tags")) { options->inband_tags = 1; - else if (!strcmp(cur_opt, "tags-ecc-off")) { + } else if (!strcmp(cur_opt, "tags-ecc-off")) { options->tags_ecc_on = 0; options->tags_ecc_overridden = 1; } else if (!strcmp(cur_opt, "tags-ecc-on")) { @@ -2120,13 +2122,13 @@ static int yaffs_parse_options(struct yaffs_options *options, } else if (!strcmp(cur_opt, "empty-lost-and-found-on")) { options->empty_lost_and_found = 1; options->empty_lost_and_found_overridden = 1; - } else if (!strcmp(cur_opt, "no-cache")) + } else if (!strcmp(cur_opt, "no-cache")) { options->no_cache = 1; - else if (!strcmp(cur_opt, "no-checkpoint-read")) + } else if (!strcmp(cur_opt, "no-checkpoint-read")) { options->skip_checkpoint_read = 1; - else if (!strcmp(cur_opt, "no-checkpoint-write")) + } else if (!strcmp(cur_opt, "no-checkpoint-write")) { options->skip_checkpoint_write = 1; - else if (!strcmp(cur_opt, "no-checkpoint")) { + } else if (!strcmp(cur_opt, "no-checkpoint")) { options->skip_checkpoint_read = 1; options->skip_checkpoint_write = 1; } else { @@ -2430,10 +2432,6 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version, param->use_nand_ecc = 1; #endif -#ifdef CONFIG_YAFFS_DISABLE_WIDE_TNODES - param->wide_tnodes_disabled = 1; -#endif - param->skip_checkpt_rd = options.skip_checkpoint_read; param->skip_checkpt_wr = options.skip_checkpoint_write; @@ -2693,8 +2691,9 @@ static int yaffs_proc_read(char *page, sprintf(buf, "\nDevice %d \"%s\"\n", n, dev->param.name); buf = yaffs_dump_dev_part0(buf, dev); - } else + } else { buf = yaffs_dump_dev_part1(buf, dev); + } break; } @@ -2914,8 +2913,9 @@ static int __init init_yaffs_fs(void) my_proc_entry->write_proc = yaffs_proc_write; my_proc_entry->read_proc = yaffs_proc_read; my_proc_entry->data = NULL; - } else + } else { return -ENOMEM; + } debug_proc_entry = create_proc_entry("yaffs_stats", S_IRUGO | S_IFREG, YPROC_ROOT); @@ -2924,8 +2924,9 @@ static int __init init_yaffs_fs(void) debug_proc_entry->write_proc = NULL; debug_proc_entry->read_proc = yaffs_stats_proc_read; debug_proc_entry->data = NULL; - } else + } else { return -ENOMEM; + } /* Now add the file system entries */ diff --git a/yaffs_yaffs1.c b/yaffs_yaffs1.c index 4ab0f22..b6c43e5 100644 --- a/yaffs_yaffs1.c +++ b/yaffs_yaffs1.c @@ -303,8 +303,7 @@ int yaffs1_scan(struct yaffs_dev *dev) variant.dir_variant.children); } else if (!parent || parent->variant_type != - YAFFS_OBJECT_TYPE_DIRECTORY) - { + YAFFS_OBJECT_TYPE_DIRECTORY) { /* Hoosterman, another problem.... * We're trying to use a non-directory as a directory */ diff --git a/yaffs_yaffs2.c b/yaffs_yaffs2.c index 97dac45..ad35fd5 100644 --- a/yaffs_yaffs2.c +++ b/yaffs_yaffs2.c @@ -536,8 +536,9 @@ static int yaffs2_rd_checkpt_tnodes(struct yaffs_obj *obj) if (tn) { ok = (yaffs2_checkpt_rd(dev, tn, dev->tnode_size) == dev->tnode_size); - } else + } else { ok = 0; + } if (tn && ok) ok = yaffs_add_find_tnode_0(dev, @@ -632,9 +633,9 @@ static int yaffs2_rd_checkpt_objs(struct yaffs_dev *dev) TENDSTR), cp.obj_id, cp.parent_id, cp.variant_type, cp.hdr_chunk)); - if (ok && cp.obj_id == ~0) + if (ok && cp.obj_id == ~0) { done = 1; - else if (ok) { + } else if (ok) { obj = yaffs_find_or_create_by_number(dev, cp.obj_id, cp.variant_type); @@ -650,8 +651,9 @@ static int yaffs2_rd_checkpt_objs(struct yaffs_dev *dev) (struct list_head *)hard_list; hard_list = obj; } - } else + } else { ok = 0; + } } } @@ -918,8 +920,9 @@ int yaffs2_handle_hole(struct yaffs_obj *obj, loff_t new_size) if (written == this_write) { pos += this_write; increase -= this_write; - } else + } else { small_increase_ok = 0; + } } yaffs_release_temp_buffer(dev, local_buffer, __LINE__); @@ -1410,9 +1413,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) in->yst_mode = oh->yst_mode; yaffs_load_attribs(in, oh); in->lazy_loaded = 0; - } else + } else { in->lazy_loaded = 1; - + } in->hdr_chunk = chunk; } else if (!in->valid) { @@ -1476,8 +1479,7 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) variant.dir_variant.children); } else if (!parent || parent->variant_type != - YAFFS_OBJECT_TYPE_DIRECTORY) - { + YAFFS_OBJECT_TYPE_DIRECTORY) { /* Hoosterman, another problem.... * We're trying to use a non-directory as a directory */