[U-Boot] [PATCH 6/7] JFFS2: scanning performance improvement
Detlev Zundel
dzu at denx.de
Fri Apr 29 15:31:54 CEST 2011
Hi Baidu,
> 1/ Sync with kernel.
> If the 256-(struct jffs2_unknown_node *) bytes are
> 0xff after the cleanmarker. We get the conclusion that
> the sector is empty.
>
> Signed-off-by: Baidu Liu <liucai.lfn at gmail.com>
> ---
> fs/jffs2/jffs2_1pass.c | 19 +++++++++++++------
> 1 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
> index 62ba250..bbfab2c 100644
> --- a/fs/jffs2/jffs2_1pass.c
> +++ b/fs/jffs2/jffs2_1pass.c
> @@ -1596,16 +1596,14 @@ jffs2_1pass_build_lists(struct part_info * part)
>
> if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0xffffffff) {
> uint32_t inbuf_ofs;
> - uint32_t empty_start, scan_end;
> + uint32_t empty_start;
>
> empty_start = ofs;
> ofs += 4;
> - scan_end = min_t(uint32_t, EMPTY_SCAN_SIZE(
> - part->sector_size)/8,
> - buf_len);
> +
> more_empty:
> inbuf_ofs = ofs - buf_ofs;
> - while (inbuf_ofs < scan_end) {
> + while (inbuf_ofs < buf_len) {
> if (*(uint32_t *)(&buf[inbuf_ofs]) !=
> 0xffffffff)
> goto scan_more;
> @@ -1615,6 +1613,15 @@ jffs2_1pass_build_lists(struct part_info * part)
> }
> /* Ran off end. */
>
> + /* If we're only checking the beginning of a block with a cleanmarker,
> + bail now */
> + if((buf_ofs == sector_ofs) &&
> + (empty_start == sector_ofs +sizeof(struct jffs2_unknown_node))) {
> + printf("%d bytes at start of block seems clean... assuming all clean\n",
> + EMPTY_SCAN_SIZE(part->sector_size));
> + break;
> + }
> +
This has style-problems. Actually all of your patches have style
problems. Checking them as one single patch gives:
total: 32 errors, 22 warnings, 369 lines checked
Please rework the whole series.
Thanks
Detlev
--
I have always observed that the pretensions of all people are in
exact inverse ratio to their merits; this is one of the axioms of
morals. -- Joseph Lagrange
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the U-Boot
mailing list