Skip to content

Commit e93bbeb

Browse files
committed
btrfs-progs: docs: documentation updates and fixes
Signed-off-by: David Sterba <[email protected]>
1 parent 7989568 commit e93bbeb

File tree

7 files changed

+124
-30
lines changed

7 files changed

+124
-30
lines changed

Diff for: Documentation/DocConventions.rst

+21-5
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ Quotes, reference, element formatting:
2424

2525
- exact syntax: monotype ````usage=0````
2626
- reference to arguments: italics ``*italics*``
27-
- command reference: bold text by directive ``:command:`btrfs filesystem show```
27+
- command reference:
2828

29+
- any system command, example, bold text by directive ``:command:`btrfs filesystem show```
30+
- subcommands with their own manual page ``:doc:`btrfs-filesystem```
2931
- subcommand names should be spelled in full, i.e. *filesystem* instead of *fi*
3032

3133
- file, directory or path references: by directive ``:file:`/path```
3234

3335
- section references without a label: italics ``*EXAMPLES*``
34-
- section references with a target label: reference by directive ``:ref:<visible text`target-label`>``
36+
- section references with a target label: reference by directive ``:ref:`visible text <target-label>```
3537

3638
- argument name in option description: caps in angle brackets ``<NAME>``
3739

@@ -53,18 +55,32 @@ Referencing:
5355

5456
- NOTE: we have either full doc reference by ``:doc:`docname``` or
5557
inter-document reference to an **unambiguous** label
56-
``:ref:`target-label```, i.e. we can't reference a label that may appear in
58+
``:ref:`target-label```, i.e. this can't reference a label that may appear in
5759
more files due to including, this will lead to the document itself that may
58-
not be the full page (may be solvable by own directive, TBD)
60+
not be the full page
5961

60-
- generic links can use the free form link syntax with description ```Link text <https://example.com>`_``
62+
- **ambiguous** or duplicate labels (that exist in a file that is included from other documents)
63+
need to be
64+
65+
- defined as ``.. duplabel:: labelname``
66+
- referenced as ``:docref:`visible text <document:label>```
67+
68+
- generic links can use the free form link syntax with description ```Link text <https://example.com>`__``
69+
(note the double underscore, this is *anonymous* link and does not create a reference)
6170
or plain link that will auto-render to a clikable link https://example.com
6271

6372
- in manual pages: always use full link as it's meant to be read in terminal
6473
output and must allow copy&paste
6574

75+
- own manual page references:
76+
77+
- ``:doc:`btrfs-filesystem```, i.e. it's the document name, it will render the section automatically
78+
- other manual pages ``:manref:page(1)``, the exact name and section number
79+
6680
- add more clickable references rather than less
6781

82+
- custom rules and directives are implemented in :file:`Documentation/conf.py`
83+
6884
Conventions:
6985

7086
- version should be formatted like ``6.1`` or ``v6.1`` and clear what

Diff for: Documentation/Introduction.rst

+32-6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ and easy administration. Its main features and benefits are:
88
* Snapshots which do not make a full copy of the files
99
* Built-in volume management, support for software-based RAID 0, RAID 1, RAID 10 and others
1010
* Self-healing - checksums for data and metadata, automatic detection of silent data corruptions
11+
* Data compression
12+
* Reflinks, fast and efficient file copies
1113

12-
Feature overview:
14+
Feature overview
15+
----------------
1316

1417
* Extent based file storage
15-
* 2\ :sup:`64` byte == 16 EiB :ref:`maximum file size<administration-limits>` (practical limit is 8 EiB due to Linux VFS)
18+
* 2\ :sup:`64` byte (16 EiB) :ref:`maximum file size<administration-limits>` (practical limit is 8 EiB due to Linux VFS)
1619
* :doc:`Space-efficient packing of small files<Inline-files>`
1720
* Space-efficient indexed directories
1821
* :ref:`Dynamic inode allocation<administration-flexibility>`
@@ -21,10 +24,10 @@ Feature overview:
2124
* :doc:`Compression (ZLIB, LZO, ZSTD), heuristics<Compression>`
2225
* :doc:`Integrated multiple device support<Volume-management>`:
2326

24-
* File Striping (like RAID0)
25-
* File Mirroring (like RAID1 up to 4 copies)
26-
* File Striping+Mirroring (like RAID10)
27-
* Single and Dual Parity implementations (like RAID5/6, experimental, not production-ready)
27+
* File Striping (like RAID0)
28+
* File Mirroring (like RAID1 up to 4 copies)
29+
* File Striping+Mirroring (like RAID10)
30+
* Single and Dual Parity implementations (like RAID5/6, experimental, not production-ready)
2831

2932
* SSD/NVMe (flash storage) awareness, :doc:`TRIM/Discard<Trim>` for reporting free blocks for
3033
reuse and optimizations (e.g. avoiding unnecessary seek optimizations,
@@ -45,3 +48,26 @@ Feature overview:
4548
* :doc:`Swapfile support<Swapfile>`
4649
* :doc:`Tree-checker<Tree-checker>`, post-read and pre-write metadata verification
4750
* :doc:`Zoned mode support<Zoned-mode>` (SMR/ZBC/ZNS friendly allocation, emulated on non-zoned devices)
51+
52+
A more detailed list of features and compatibility is on the :doc:`status page <Status>`.
53+
54+
Quick start
55+
-----------
56+
57+
For a really quick start you can simply create and mount the filesystem. Make
58+
sure that the block device you'd like to use is suitable so you don't overwrite existing data.
59+
60+
.. code-block:: shell
61+
62+
# mkfs.btrfs /dev/sdx
63+
# mount /dev/sdx /mnt/test
64+
65+
The default options should be acceptable for most users and sometimes can be
66+
changed later. The example above is for a single device filesystem, creating a
67+
*single* profile for data (no redundant copies of the blocks), and *DUP*
68+
for metadata (each block is duplicated).
69+
70+
Read more about:
71+
72+
* creating a filesystem at :doc:`mkfs.btrfs`
73+
* mount options at :doc:`Administration`

Diff for: Documentation/Quick-start.rst

-15
This file was deleted.

Diff for: Documentation/dev/Experimental.rst

+20
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Experimental features
22
=====================
33

4+
User space tools (btrfs-progs)
5+
------------------------------
6+
47
Experimental or unstable features may be enabled by
58

69
./configure --enable-experimental
@@ -38,3 +41,20 @@ Each feature should be tracked in an issue with label **experimental** (list of
3841
active issues https://github.com/kdave/btrfs-progs/labels/experimental), with a
3942
description and a TODO list items. Individual tasks can be tracked in other
4043
issues if needed.
44+
45+
46+
Kernel module
47+
-------------
48+
49+
The kernel module can be configured to enable experimental features or
50+
functionality since version 6.13 by
51+
`CONFIG_BTRFS_EXPERIMENTAL <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/btrfs/Kconfig#n82>`__ .
52+
The features can get added or removed in each release. At runtime the status
53+
can be seen in the system log message once the kernel module is loaded:
54+
55+
.. code-block:: none
56+
57+
Btrfs loaded, experimental=on, debug=on, assert=on, ref-verify=on, zoned=yes, fsverity=yes
58+
59+
60+
In some cases (standalone features) it's exported in :file:`/sys/fs/btrfs/FSID/features`.

Diff for: Documentation/dev/dev-btrees.rst

+39-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Btrees
22
======
33

4-
Btrees Introduction
5-
-------------------
4+
B-trees Introduction
5+
--------------------
66

77
Btrfs uses a single set of btree manipulation code for all metadata in
88
the filesystem. For performance or organizational purposes, the trees
@@ -109,3 +109,40 @@ Data Relocation Tree
109109

110110
Log Root Tree
111111
-------------
112+
113+
114+
UUID Tree
115+
---------
116+
117+
The tree storesc correspondence between UUIDs and subvolumes. Used for
118+
quick lookup during send.
119+
120+
121+
Quota Tree
122+
----------
123+
124+
The qgroup information about status and qgroup relations are stored in this tree.
125+
The tree exists only when quotas are enabled.
126+
127+
128+
Free Space Tree
129+
---------------
130+
131+
This tree implements *space_cache=v2*, which is a tree-based tracking of free
132+
space. Successor of the v1 code which used inodes to store the space information.
133+
134+
135+
Block Group Tree
136+
----------------
137+
138+
Separate tree (and feature) that stores only block group items and allows quick lookup
139+
during mount. Otherwise the block group items are scattered in the Extent tree
140+
and cause slow mount due to excessive seeking.
141+
142+
143+
Raid Stripe Tree
144+
----------------
145+
146+
A separate tracking of file extents and block groups that allows more flexible
147+
location of physical offsets while keeping the logical offsets the same. This
148+
is used by zoned mode and raid56.

Diff for: Documentation/dev/dev-internal-apis.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,27 @@ and for concatenation helpers :code:`path_cat_out()` or
4545
:code:`path_cat_out3()` and check the error values for overflows. There are
4646
helpers to check file type :code:`path_is_*()`.
4747

48+
Dynamic array of pointers
49+
-------------------------
50+
51+
Files: :file:`common/array.h`
52+
53+
Extensible array containing pointers to objects, is reallocated when the
54+
new elements don't fit current capacity. For iteration the array is accessible
55+
as *array->datai[i]* of type *void\** and needs be cast to user type.
56+
4857
TODO
4958
----
5059

5160
Undocumented or incomplete APIs:
5261

53-
* common/array.h
5462
* common/cpu-utils.h
5563
* common/device-utils.h
64+
* common/format-output.h
5665
* common/messages.h
5766
* common/open-utils.h
67+
* common/rbtree-utils.h
5868
* common/sort-utils.h
5969
* common/string-table.h
70+
* common/sysfs-utils.h
6071
* common/task-utils.h

Diff for: Documentation/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,4 @@ for missing contents.
113113
:maxdepth: 1
114114
:caption: TODO
115115

116-
Quick-start
117116
trouble-index

0 commit comments

Comments
 (0)