[PATCH 2/7] filetype: add file_detect_fs_type()

Sascha Hauer s.hauer at pengutronix.de
Tue Mar 18 08:06:47 PDT 2025


On Tue, Mar 18, 2025 at 03:51:44PM +0100, Ahmad Fatoum wrote:
> Hi,
> 
> On 3/18/25 15:41, Sascha Hauer wrote:
> > add file_detect_fs_type() which only tests if the buffer contains one of
> > the supported filesystems without testing for other binary formats.
> 
> 
> > +enum filetype file_detect_fs_type(const void *_buf, size_t bufsize)
> 
> [snip]
> 
> >  enum filetype file_detect_type(const void *_buf, size_t bufsize)
> > -	if (bufsize >= 1536 && buf16[512 + 28] == le16_to_cpu(0xef53))
> > -		return filetype_ext;
> > -
> >  	if (strncmp(buf8 + CH_TOC_section_name, "CHSETTINGS", 10) == 0)
> >  		return filetype_ch_image
> 
> Shouldn't file_detec_type() still call file_detect_fs_type()?

Sure, that was the intention at least.

Thanks for catching, fixed this.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list