← Documents Documentation/filesystems/ext4/bitmaps.rst GitHub 원문 ↗

Linux 6.18.37 · Filesystems

Block and inode Bitmaps

ext4 block·inode bitmap과 BLOCK_UNINIT, meta_bg의 주의점을 설명하는 전문 번역입니다.

Source pathDocumentation/filesystems/ext4/bitmaps.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

bitmaps.rst:1-21

block과 inode bitmap의 bit 하나는 각각 data block 또는 inode table entry 하나를 나타냅니다. `BLOCK_UNINIT`은 계산 가능한 bitmap을 disk에 쓰지 않았다는 뜻이지 group 안의 모든 physical block이 실제로 free라는 뜻은 아닙니다.

BLOCK_UNINIT 해석
`BLOCK_UNINIT` 확인kernel·e2fsprogs가 logical zero bitmap으로 취급`meta_bg`이면 group 내부 metadata 위치 확인`debugfs`의 apparent free 결과를 그대로 점유 상태로 해석하지 않음

논리적 zero bitmap과 실제 metadata 점유를 구분합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 Block and inode Bitmaps
4 -----------------------
5
6 The data block bitmap tracks the usage of data blocks within the block
7 group.
8
9 The inode bitmap records which entries in the inode table are in use.
10
11 As with most bitmaps, one bit represents the usage status of one data
12 block or inode table entry. This implies a block group size of 8 *
13 number_of_bytes_in_a_logical_block.
14
15 NOTE: If ``BLOCK_UNINIT`` is set for a given block group, various parts
16 of the kernel and e2fsprogs code pretends that the block bitmap contains
17 zeros (i.e. all blocks in the group are free). However, it is not
18 necessarily the case that no blocks are in use -- if ``meta_bg`` is set,
19 the bitmaps and group descriptor live inside the group. Unfortunately,
20 ext2fs_test_block_bitmap2() will return '0' for those locations,
21 which produces confusing debugfs output.
22

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

block·inode bitmap과 BLOCK_UNINIT

1-21

data block bitmap은 block group 안에서 data block이 사용 중인지 추적합니다. inode bitmap은 inode table의 어떤 entry가 사용 중인지 기록합니다.

일반적인 bitmap처럼 bit 하나가 data block 하나 또는 inode table entry 하나의 사용 상태를 나타냅니다. 따라서 block group 크기는 `8 * number_of_bytes_in_a_logical_block`이 됩니다.

특정 block group에 `BLOCK_UNINIT`이 설정되면 kernel과 e2fsprogs 여러 부분은 block bitmap이 모두 0, 즉 group의 모든 block이 free인 것처럼 취급합니다.

그러나 실제로 block을 전혀 사용하지 않는다는 뜻은 아닙니다. `meta_bg`가 설정되면 bitmap과 group descriptor 자체가 그 group 안에 있기 때문입니다. `ext2fs_test_block_bitmap2()`는 이 위치에도 0을 반환해 `debugfs` 출력이 혼란스러울 수 있습니다.

ext4 bitmap 해석
대상bit 의미주의점
Data block bitmapdata block 1개의 사용 상태group 내부 data allocation 추적
Inode bitmapinode table entry 1개의 사용 상태사용 중 inode 추적
`BLOCK_UNINIT`bitmap을 모두 0으로 간주실제 metadata block은 사용 중일 수 있음
`meta_bg`bitmap·group descriptor가 group 내부에 존재`debugfs`가 free로 잘못 보일 수 있음

일반 상태와 BLOCK_UNINIT의 논리적 view를 구분합니다.

.. SPDX-License-Identifier: GPL-2.0

Block and inode Bitmaps
-----------------------

The data block bitmap tracks the usage of data blocks within the block
group.

The inode bitmap records which entries in the inode table are in use.

As with most bitmaps, one bit represents the usage status of one data
block or inode table entry. This implies a block group size of 8 *
number_of_bytes_in_a_logical_block.

NOTE: If ``BLOCK_UNINIT`` is set for a given block group, various parts
of the kernel and e2fsprogs code pretends that the block bitmap contains
zeros (i.e. all blocks in the group are free). However, it is not
necessarily the case that no blocks are in use -- if ``meta_bg`` is set,
the bitmaps and group descriptor live inside the group. Unfortunately,
ext2fs_test_block_bitmap2() will return '0' for those locations,
which produces confusing debugfs output.