From: Ilya Yanok <yanok@emcraft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] jffs2: rewrite jffs2 scanning code based on Linux one
Date: Thu, 20 Nov 2008 17:31:51 +0300 [thread overview]
Message-ID: <492574D7.8060502@emcraft.com> (raw)
In-Reply-To: <20081113180605.GD25695@game.jcrosoft.org>
Hello Jean-Christophe,
Jean-Christophe PLAGNIOL-VILLARD wrote:
>>
>> /* start at the beginning of the partition */
>> - while (offset < max) {
>> - if ((oldoffset >> SPIN_BLKSIZE) != (offset >> SPIN_BLKSIZE)) {
>> - printf("\b\b%c ", spinner[counter++ % sizeof(spinner)]);
>> - oldoffset = offset;
>> - }
>> + for (i = 0; i < nr_sectors; i++) {
>> + uint32_t sector_ofs = i * part->sector_size;
>> + uint32_t buf_ofs = sector_ofs;
>> + uint32_t buf_len = EMPTY_SCAN_SIZE(part->sector_size);
>> + uint32_t ofs, prevofs;
>>
>> WATCHDOG_RESET();
>> + get_fl_mem((u32)part->offset + buf_ofs, buf_len, buf);
>>
>> - node = (struct jffs2_unknown_node *) get_node_mem((u32)part->offset + offset);
>> - if (node->magic == JFFS2_MAGIC_BITMASK && hdr_crc(node)) {
>> + /* We temporarily use 'ofs' as a pointer into the buffer/jeb */
>> + ofs = 0;
>> +
>> + /* Scan only 4KiB of 0xFF before declaring it's empty */
>> + while (ofs < EMPTY_SCAN_SIZE(part->sector_size) &&
>> + *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF)
>>
> please use readx/writex
>
Why? it's memory buffer actually.
Regards, Ilya.
next prev parent reply other threads:[~2008-11-20 14:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-13 16:49 [U-Boot] [RFC PATCH 0/6] Some speed improvements to U-Boot JFFS2 code (updated) Ilya Yanok
2008-11-13 16:49 ` [U-Boot] [PATCH 1/6] jffs2: fix searching for latest version in jffs2_1pass_list_inodes() Ilya Yanok
2008-12-09 22:38 ` Wolfgang Denk
2008-11-13 16:49 ` [U-Boot] [PATCH 2/6] jffs2: add sector_size field to part_info structure Ilya Yanok
2008-11-13 18:01 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-13 18:16 ` Ben Warren
2008-12-09 22:39 ` Wolfgang Denk
2008-11-13 16:49 ` [U-Boot] [PATCH 3/6] jffs2: rewrite jffs2 scanning code based on Linux one Ilya Yanok
2008-11-13 18:06 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-20 14:31 ` Ilya Yanok [this message]
2008-12-09 22:39 ` Wolfgang Denk
2008-12-10 13:30 ` Stefan Roese
2008-12-11 2:49 ` Ilya Yanok
2008-12-11 2:51 ` [U-Boot] [PATCH] jffs2: include <linux/mtd/compat.h> instead of defining own min_t Ilya Yanok
2008-12-11 6:24 ` Stefan Roese
2008-12-16 16:14 ` Wolfgang Denk
2008-11-13 16:49 ` [U-Boot] [PATCH 4/6] jffs2: add buffer to cache flash accesses Ilya Yanok
2008-12-09 22:41 ` Wolfgang Denk
2008-11-13 16:49 ` [U-Boot] [PATCH 5/6] jffs2: summary support Ilya Yanok
2008-12-09 22:41 ` Wolfgang Denk
2008-11-13 16:49 ` [U-Boot] [PATCH 6/6] jffs2: cache data_crc results Ilya Yanok
2008-12-09 22:41 ` Wolfgang Denk
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=492574D7.8060502@emcraft.com \
--to=yanok@emcraft.com \
--cc=u-boot@lists.denx.de \
/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