linux/fs/erofs
Al Viro 076d965eb8 erofs: don't align offset for erofs_read_metabuf() (simple cases)
Most of the callers of erofs_read_metabuf() have the following form:

	block = erofs_blknr(sb, offset);
	off = erofs_blkoff(sb, offset);
	p = erofs_read_metabuf(...., erofs_pos(sb, block), ...);
	if (IS_ERR(p))
		return PTR_ERR(p);
	q = p + off;
	// no further uses of p, block or off.

The value passed to erofs_read_metabuf() is offset rounded down to block
size, i.e. offset - off.  Passing offset as-is would increase the return
value by off in case of success and keep the return value unchanged in
in case of error.  In other words, the same could be achieved by

	q = erofs_read_metabuf(...., offset, ...);
	if (IS_ERR(q))
		return PTR_ERR(q);

This commit convert these simple cases.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/r/20240425195915.GD1031757@ZenIV
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2024-05-18 01:47:26 +08:00
..
compress.h erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
data.c erofs: don't align offset for erofs_read_metabuf() (simple cases) 2024-05-18 01:47:26 +08:00
decompressor_deflate.c erofs: refine managed cache operations to folios 2024-03-10 18:41:25 +08:00
decompressor_lzma.c erofs: refine managed cache operations to folios 2024-03-10 18:41:25 +08:00
decompressor_zstd.c erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
decompressor.c erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
dir.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
erofs_fs.h erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
fscache.c erofs: don't align offset for erofs_read_metabuf() (simple cases) 2024-05-18 01:47:26 +08:00
inode.c erofs: mechanically convert erofs_read_metabuf() to offsets 2024-05-18 01:46:18 +08:00
internal.h erofs: mechanically convert erofs_read_metabuf() to offsets 2024-05-18 01:46:18 +08:00
Kconfig erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
Makefile erofs: Zstandard compression support 2024-05-09 07:46:56 +08:00
namei.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
super.c erofs: don't align offset for erofs_read_metabuf() (simple cases) 2024-05-18 01:47:26 +08:00
sysfs.c erofs: make kobj_type structures constant 2023-02-15 08:11:26 +08:00
xattr.c erofs_buf: store address_space instead of inode 2024-04-25 00:57:14 -04:00
xattr.h erofs: move erofs_xattr_handlers and xattr_handler_map to .rodata 2023-10-09 16:24:17 +02:00
zdata.c erofs: mechanically convert erofs_read_metabuf() to offsets 2024-05-18 01:46:18 +08:00
zmap.c erofs: don't align offset for erofs_read_metabuf() (simple cases) 2024-05-18 01:47:26 +08:00
zutil.c erofs: add a reserved buffer pool for lz4 decompression 2024-05-08 17:12:51 +08:00