From: Heiko Schocher invitel <heiko.schocher@invitel.hu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/8] JFFS2: Optimize building lists during scan
Date: Tue, 30 Jun 2015 11:13:32 +0200 [thread overview]
Message-ID: <55925DBC.2080901@invitel.hu> (raw)
In-Reply-To: <1435554149-18042-6-git-send-email-mark.tomlinson@alliedtelesis.co.nz>
Hello Mark,
please fix Tom rinis mail address globally for your patchset into
Tom Rini <trini@konsulko.com>
I fixed it for my response manually, thanks!
BTW: You can use patman for creating patches/patchset.
Look into u-boot:tools/patman
Am 29.06.2015 um 07:02 schrieb Mark Tomlinson:
> If the flash is slow, reading less from the flash into buffers makes
> the process faster.
>
> Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
> ---
>
> fs/jffs2/jffs2_1pass.c | 24 ++++++++++++++++++++----
> 1 file changed, 20 insertions(+), 4 deletions(-)
Reviewed-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
> index 80210be..10bd7be 100644
> --- a/fs/jffs2/jffs2_1pass.c
> +++ b/fs/jffs2/jffs2_1pass.c
> @@ -1493,7 +1493,7 @@ jffs2_1pass_build_lists(struct part_info * part)
> u32 counterF = 0;
> u32 counterN = 0;
> u32 max_totlen = 0;
> - u32 buf_size = DEFAULT_EMPTY_SCAN_SIZE;
> + u32 buf_size;
> char *buf;
>
> nr_sectors = lldiv(part->size, part->sector_size);
> @@ -1505,7 +1505,7 @@ jffs2_1pass_build_lists(struct part_info * part)
> /* if we are building a list we need to refresh the cache. */
> jffs_init_1pass_list(part);
> pL = (struct b_lists *)part->jffs2_priv;
> - buf = malloc(buf_size);
> + buf = malloc(DEFAULT_EMPTY_SCAN_SIZE);
> puts ("Scanning JFFS2 FS: ");
>
> /* start at the beginning of the partition */
> @@ -1521,6 +1521,8 @@ jffs2_1pass_build_lists(struct part_info * part)
> int ret;
> #endif
>
> + /* Set buf_size to maximum length */
> + buf_size = DEFAULT_EMPTY_SCAN_SIZE;
> WATCHDOG_RESET();
>
> #ifdef CONFIG_JFFS2_SUMMARY
> @@ -1595,6 +1597,10 @@ jffs2_1pass_build_lists(struct part_info * part)
>
> ofs += sector_ofs;
> prevofs = ofs - 1;
> + /* Set buf_size down to the minimum size required.
> + * This prevents reading in chunks of flash data unnecessarily.
> + */
> + buf_size = sizeof(union jffs2_node_union);
>
> scan_more:
> while (ofs < sector_ofs + part->sector_size) {
> @@ -1675,13 +1681,18 @@ jffs2_1pass_build_lists(struct part_info * part)
> case JFFS2_NODETYPE_INODE:
> if (buf_ofs + buf_len < ofs + sizeof(struct
> jffs2_raw_inode)) {
> + buf_len = min_t(uint32_t,
> + sizeof(struct jffs2_raw_inode),
> + sector_ofs +
> + part->sector_size -
> + ofs);
> get_fl_mem((u32)part->offset + ofs,
> buf_len, buf);
> buf_ofs = ofs;
> node = (void *)buf;
> }
> - if (!inode_crc((struct jffs2_raw_inode *) node))
> - break;
> + if (!inode_crc((struct jffs2_raw_inode *)node))
> + break;
>
> if (insert_node(&pL->frag, (u32) part->offset +
> ofs) == NULL) {
> @@ -1698,6 +1709,11 @@ jffs2_1pass_build_lists(struct part_info * part)
> ((struct
> jffs2_raw_dirent *)
> node)->nsize) {
> + buf_len = min_t(uint32_t,
> + node->totlen,
> + sector_ofs +
> + part->sector_size -
> + ofs);
> get_fl_mem((u32)part->offset + ofs,
> buf_len, buf);
> buf_ofs = ofs;
>
next prev parent reply other threads:[~2015-06-30 9:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-29 5:02 [U-Boot] [PATCH 0/8] JFFS2 fixes and performance improvements Mark Tomlinson
2015-06-29 5:02 ` [U-Boot] [PATCH 1/8] JFFS2: Return early when file read not necessary Mark Tomlinson
2015-06-30 9:01 ` Heiko Schocher denx
2015-06-29 5:02 ` [U-Boot] [PATCH 2/8] JFFS2: Speed up and fix comparison functions Mark Tomlinson
2015-06-30 9:04 ` Heiko Schocher denx
2015-06-29 5:02 ` [U-Boot] [PATCH 3/8] JFFS2: Only list each directory entry once Mark Tomlinson
2015-06-30 9:07 ` Heiko Schocher denx
2015-06-29 5:02 ` [U-Boot] [PATCH 4/8] JFFS2: Improve speed reading flash files Mark Tomlinson
2015-06-30 9:09 ` Heiko Schocher denx
2015-06-29 5:02 ` [U-Boot] [PATCH 5/8] JFFS2: Optimize building lists during scan Mark Tomlinson
2015-06-30 9:13 ` Heiko Schocher invitel [this message]
2015-06-29 5:02 ` [U-Boot] [PATCH 6/8] JFFS2: Change scansize to match linux kernel Mark Tomlinson
2015-06-30 9:14 ` Heiko Schocher invitel
2015-06-29 5:02 ` [U-Boot] [PATCH 7/8] JFFS2: Use CLEANMARKER to reduce scanning time Mark Tomlinson
2015-06-30 9:16 ` Heiko Schocher invitel
2015-06-30 9:16 ` Heiko Schocher denx
2015-06-29 5:02 ` [U-Boot] [PATCH 8/8] JFFS2: Use merge sort when parsing filesystem Mark Tomlinson
2015-06-30 9:26 ` Heiko Schocher denx
2015-06-30 12:11 ` [U-Boot] [PATCH 0/8] JFFS2 fixes and performance improvements 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=55925DBC.2080901@invitel.hu \
--to=heiko.schocher@invitel.hu \
--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