[PATCH] base-files: read all 5 bytes in get_magic_fat32() at once

Karl Palsson karlp at tweak.net.au
Mon Jan 4 06:57:52 EST 2021


The fact that you had to introduce iflags to work around changing IBS/OBS which afffected skip size would make me consider this sort of patch to be of incredibly marginal utilty, largely even negative value if this isn't some sort of hot path.  You've made it more complicated for an _extremely_ small, un measured pseudo gain.  

I'd kinda imagine that the underlying layer already read a bigger
block anyway...

Sincerely,
Karl Palsson


Adrian Schmutzler <freifunk at adrianschmutzler.de> wrote:
> While the speed improvement might be negligible, there is still
> no reason to read individual bytes.
> 
> Suggested-by: Paul Spooren <mail at aparcar.org>
> Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
-----
>  
>  get_magic_fat32() {
> -	(get_image "$@" | dd bs=1 count=5 skip=82) 2>/dev/null
> +	(get_image "$@" | dd iflag=skip_bytes bs=5 count=1 skip=82) 2>/dev/null
>  }
>  
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP-digital-signature.html
Type: application/pgp-signature
Size: 1175 bytes
Desc: OpenPGP Digital Signature
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20210104/93cb9813/attachment.sig>


More information about the openwrt-devel mailing list