Go to file
Gao Xiang 7caadd02df erofs: support parsing big pcluster compact indexes
Different from non-compact indexes, several lclusters are packed
as the compact form at once and an unique base blkaddr is stored for
each pack, so each lcluster index would take less space on avarage
(e.g. 2 bytes for COMPACT_2B.) btw, that is also why BIG_PCLUSTER
switch should be consistent for compact head0/1.

Prior to big pcluster, the size of all pclusters was 1 lcluster.
Therefore, when a new HEAD lcluster was scanned, blkaddr would be
bumped by 1 lcluster. However, that way doesn't work anymore for
big pcluster since we actually don't know the compressed size of
pclusters in advance (before reading CBLKCNT lcluster).

So, instead, let blkaddr of each pack be the first pcluster blkaddr
with a valid CBLKCNT, in detail,

 1) if CBLKCNT starts at the pack, this first valid pcluster is
    itself, e.g.
  _____________________________________________________________
 |_CBLKCNT0_|_NONHEAD_| .. |_HEAD_|_CBLKCNT1_| ... |_HEAD_| ...
 ^ = blkaddr base          ^ += CBLKCNT0           ^ += CBLKCNT1

 2) if CBLKCNT doesn't start at the pack, the first valid pcluster
    is the next pcluster, e.g.
  _________________________________________________________
 | NONHEAD_| .. |_HEAD_|_CBLKCNT0_| ... |_HEAD_|_HEAD_| ...
                ^ = blkaddr base        ^ += CBLKCNT0
                                               ^ += 1

When a CBLKCNT is found, blkaddr will be increased by CBLKCNT
lclusters, or a new HEAD is found immediately, bump blkaddr by 1
instead (see the picture above.)

Also noted if CBLKCNT is the end of the pack, instead of storing
delta1 (distance of the next HEAD lcluster) as normal NONHEADs,
it still uses the compressed block count (delta0) since delta1
can be calculated indirectly but the block count can't.

Adjust decoding logic to fit big pcluster compact indexes as well.

Link: https://lore.kernel.org/r/20210407043927.10623-9-xiang@kernel.org
Acked-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Change-Id: Ia9dc0c8bf03b630edc4dfcedf61ef0632e1fcb05
2022-11-12 11:24:49 +00:00
android
arch arm64: config: enable exfat 2022-11-12 11:24:42 +00:00
block fs: ext4: fsync: optimize double-fsync() a bunch 2022-11-12 11:24:44 +00:00
certs
crypto crypto: move Jitter RNG header include dir 2022-11-12 11:23:16 +00:00
Documentation UPSTREAM: locking/lockdep: Add explanation to lock usage rules in lockdep design doc 2022-11-12 11:23:42 +00:00
drivers erofs: move from drivers/staging/ to fs/ 2022-11-12 11:24:45 +00:00
firmware
fs erofs: support parsing big pcluster compact indexes 2022-11-12 11:24:49 +00:00
include erofs: move from drivers/staging/ to fs/ 2022-11-12 11:24:45 +00:00
init dma_buf: use kmem_cache pool for struct sync_file 2022-11-12 11:24:40 +00:00
ipc vm_ops: rename .split() callback to .may_split() 2022-11-12 11:21:26 +00:00
kernel do accept() in LIFO order for cache efficiency 2022-11-12 11:24:43 +00:00
lib HACK: lib: Compile out nmi_backtrace for ARM64 2022-11-12 11:24:32 +00:00
LICENSES
mm mm: Don't hog the CPU and zone lock in rmqueue_bulk() 2022-11-12 11:24:20 +00:00
net do accept() in LIFO order for cache efficiency 2022-11-12 11:24:43 +00:00
samples
scripts lto: Add Link Time Optimization support for GCC 2022-11-12 11:24:06 +00:00
security selinux: Avoid dynamic memory allocation for INITCONTEXTLEN buffers 2022-11-12 11:24:13 +00:00
sound ALSA: control_compat: Don't dynamically allocate single-use structs 2022-11-12 11:24:10 +00:00
techpack techpack: display: add some bp hints to hot paths 2022-11-12 11:24:41 +00:00
tools UPSTREAM: selftests/damon: support watermarks 2022-11-12 11:22:55 +00:00
usr
virt mm: treewide: remove unused address argument from pte_alloc functions 2022-11-12 11:21:18 +00:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore .gitignore: remove dts vendor 2022-11-12 11:19:05 +00:00
.gitmodules mkdtimg: Bundle upstream python rewrite as submodule 2022-11-12 11:19:02 +00:00
.mailmap
AndroidKernel.mk
build.config.aarch64
build.config.allmodconfig
build.config.allmodconfig.aarch64
build.config.allmodconfig.arm
build.config.allmodconfig.x86_64
build.config.arm
build.config.common
build.config.gki
build.config.gki_kasan
build.config.gki_kasan.aarch64
build.config.gki_kasan.x86_64
build.config.gki_kprobes
build.config.gki_kprobes.aarch64
build.config.gki_kprobes.x86_64
build.config.gki-debug.aarch64
build.config.gki-debug.x86_64
build.config.gki.aarch64
build.config.gki.x86_64
build.config.goldfish.arm
build.config.goldfish.arm64
build.config.goldfish.mips
build.config.goldfish.mips64
build.config.goldfish.x86
build.config.goldfish.x86_64
build.config.x86_64
COPYING
CREDITS
gen_headers_arm64.bp net: Port samsung MPTCP modifications from SM-N986B 2022-11-12 11:19:58 +00:00
gen_headers_arm.bp net: Port samsung MPTCP modifications from SM-N986B 2022-11-12 11:19:58 +00:00
Kbuild
Kconfig
kernel_headers.py
MAINTAINERS BACKPORT: trace: events: add devfreq trace event file 2022-11-12 11:24:24 +00:00
Makefile Makefile: Enable opaque pointers mode 2022-11-12 11:24:35 +00:00
OWNERS
README
verity_dev_keys.x509

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.