[PATCH 1/3] erofs-utils: introduce fuse implementation

Li GuiFu bluce.lee at aliyun.com
Sun Nov 22 15:43:31 AEDT 2020


Gao Xiang

It run good, some codes format need to be adjusted
Please re-send to make more readable

On 2020/11/21 1:41, Gao Xiang via Linux-erofs wrote:
> From: Li Guifu <blucerlee at gmail.com>
> 
> Let's add a simple erofsfuse approach, and benefits are:
> 
>  - images can be supported on various platforms;
>  - new unpack tool can be developed based on this;
>  - new on-disk features can be iterated, verified effectively.
> 
> This commit only addresses reading uncompressed regular files.
> Other file (e.g. compressed file) support is out of scope here.
> 
> Note that erofsfuse is an unstable feature for now (also notice
> LZ4_decompress_safe_partial() was broken in lz4-1.9.2, which
> just fixed in lz4-1.9.3), let's disable it by default for a while.
> 
> Signed-off-by: Li Guifu <blucerlee at gmail.com>
> Signed-off-by: Huang Jianan <huangjianan at oppo.com>
> Signed-off-by: Guo Weichao <guoweichao at oppo.com>
> Signed-off-by: Gao Xiang <hsiangkao at aol.com>
> ---

> +
> +static void signal_handle_sigsegv(int signal)
> +{
> +	void *array[10];
> +	size_t nptrs;
> +	char **strings;
> +	size_t i;
> +
> +	erofs_dump("========================================\n");
> +	erofs_dump("Segmentation Fault.  Starting backtrace:\n");
> +	nptrs = backtrace(array, 10);
> +	strings = backtrace_symbols(array, nptrs);
> +	if (strings) {
> +		for (i = 0; i < nptrs; i++)
> +			erofs_dbg("%s", strings[i]);

erofs_dbg change to erofs_dump to make all log printed, "\n" is needed

> +		free(strings);
> +	}
> +	erofs_dump("========================================\n");
> +	abort();
> +}
> +
> +

>  
> +static inline unsigned int erofs_bitrange(unsigned int value, unsigned int bit,
> +					  unsigned int bits)
> +{
> +
empty line is not needed

> +	return (value >> bit) & ((1 << bits) - 1);
> +}
> +
> +
empty line is not needed
> +static inline unsigned int erofs_inode_version(unsigned int value)
> +{
> +	return erofs_bitrange(value, EROFS_I_VERSION_BIT,
> +			      EROFS_I_VERSION_BITS);
> +}
> +
> +static inline unsigned int erofs_inode_datalayout(unsigned int value)
> +{
> +	return erofs_bitrange(value, EROFS_I_DATALAYOUT_BIT,
> +			      EROFS_I_DATALAYOUT_BITS);
> +}
> +


More information about the Linux-erofs mailing list