History log of /dflybsd-src/sbin/hammer2/cmd_debug.c (Results 1 – 25 of 111)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 167a410d 10-Oct-2024 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2/cmd_debug.c: Refactor unreadable cmd_show()

0b7381572b131c74051832dc251604e7f77b5a54 added multi-volumes
support to cmd_show() (entry point of freemap,show,volhdr directives)
with minim

sbin/hammer2/cmd_debug.c: Refactor unreadable cmd_show()

0b7381572b131c74051832dc251604e7f77b5a54 added multi-volumes
support to cmd_show() (entry point of freemap,show,volhdr directives)
with minimum modification using goto, but the code has been not
so readable since then. Rewrite this entry point function.

The output is same except that "Volume %d header %d..."
by default (= when not showing volhdr or bref for all volumes)
appears before printing each volhdr or bref, rather than all
at once in the beginning.

show more ...


# b87d88f0 05-Oct-2024 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2/cmd_debug.c: Clear errno

otherwise affects next strtol(3) variant when no error.

strtol(3) says "If no conversion could be performed,
0 is returned and the global variable errno is set

sbin/hammer2/cmd_debug.c: Clear errno

otherwise affects next strtol(3) variant when no error.

strtol(3) says "If no conversion could be performed,
0 is returned and the global variable errno is set to EINVAL".

show more ...


# 2c8c691b 01-Oct-2024 Tomohiro Kusumi <tkusumi@netbsd.org>

sys/vfs/hammer2: Change hammer2_inode_meta::target_type to unused84

No longer used or needed since
da0cdd33148ab3e3c227355de759c595c533841a in 2017.

target_type was only used for the initial hardli

sys/vfs/hammer2: Change hammer2_inode_meta::target_type to unused84

No longer used or needed since
da0cdd33148ab3e3c227355de759c595c533841a in 2017.

target_type was only used for the initial hardlink design and
implementation, which is not how it works today.

show more ...


# 1a0f56e1 24-Sep-2024 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2/cmd_debug.c: Print volume id in "Volume header" message


# 8fbce03d 24-Sep-2024 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2/cmd_debug.c: Don't use both XB and XiB in printf

These are the only ones print XiB with "XiB" in HAMMER2 commands.


# d086b553 04-Nov-2023 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2/show: Use comp|checkmode string for blockref methods

in addition to ondisk inode ones (for file data) applied in
2a98b0e0d4aa48b8c50a866f4c054f37b556dca2.


# 2a98b0e0 03-Nov-2023 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Make comp|checkmodestr() available in subs.c

These functions have been static in sbin/hammer2/cmd_stat.c,
but useful in other directives as well, e.g. show.


# 1d5238a4 27-Jan-2023 Tomohiro Kusumi <tkusumi@netbsd.org>

sys/vfs/hammer2: Fix -Wpointer-sign warnings on hammer2_dirhash()

Warned on Linux user space.

Change hammer2_dirhash() and user space dirhash() to take
const char* instead of const unsigned char* f

sys/vfs/hammer2: Fix -Wpointer-sign warnings on hammer2_dirhash()

Warned on Linux user space.

Change hammer2_dirhash() and user space dirhash() to take
const char* instead of const unsigned char* for entry "name".

* hammer2_dirhash() callers always pass char* or const char*,
except for one in sbin/newfs_hammer2/mkfs_hammer2.c where filename[]
in ondisk inode (unterminated unsigned char array) is used.

* hammer2_dirhash() only compares name with ascii characters,
and passes substring to hammer2_icrc32() which takes const void*,
so it doesn't need to be unsigned.

* Also change hammer2_inode_create_pfs() (another function whose
callers only pass char* or const char* for PFS "name") to take
const char* instead of const uint8_t* so that hammer2_dirhash()
doesn't get warned after changes above.

show more ...


Revision tags: v6.4.0, v6.4.0rc1, v6.5.0
# 33b364a7 06-Nov-2022 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Fix build error on i386

error: format specifies type 'long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]


# 6c129444 11-Sep-2022 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Rename CountBlocks() -> count_blocks()

This (and only this) static function has been camel case.


Revision tags: v6.2.2, v6.2.1, v6.3.0, v6.0.1
# bc092eef 09-Aug-2021 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Silence -Waddress-of-packed-member warnings

Not a problem on x86_64, but silence warnings caused by callers
passing address of packed (possibly unaligned) struct fields.


# 66b8e023 17-Jul-2021 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Print freemap leaf's linear offset when "show"


# d490438f 25-Jun-2021 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Introduce HAMMER2_SHOW_ALL_VOLUME_HEADERS to show all volhdrs when -q

Previously only VerboseOpt>=3 printed all volume headers,
and because of this quiet mode could only print best zon

sbin/hammer2: Introduce HAMMER2_SHOW_ALL_VOLUME_HEADERS to show all volhdrs when -q

Previously only VerboseOpt>=3 printed all volume headers,
and because of this quiet mode could only print best zone.

show more ...


# 71782ce3 22-Jun-2021 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Introduce HAMMER2_SHOW_MIN_XXX_TID to limit blockrefs

Blockrefs with smaller tid are ignored as if HAMMER2_BREF_TYPE_EMPTY.
The default is 0 which means it prints all blockrefs.


Revision tags: v6.0.0, v6.0.0rc1, v6.1.0
# 0b738157 25-Dec-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sys/vfs/hammer2: Add initial multi-volumes support for HAMMER2

This commit adds initial multi-volumes support for HAMMER2. Maximum
supported volumes is 64. The feature and implementation is similar

sys/vfs/hammer2: Add initial multi-volumes support for HAMMER2

This commit adds initial multi-volumes support for HAMMER2. Maximum
supported volumes is 64. The feature and implementation is similar to
multi-volumes support in HAMMER1.

1. ondisk changes
=================
This commit bumps volume header version from 1 to 2, and adds four new
volume header fields using reserved fields in version 1. Other ondisk
structures are unchanged.
* "volu_id" - volume id from 0 to 63, where 0 represents root volume.
* "nvolumes" - number of volumes. All volumes have same the same value.
* "total_size" - sum of "volu_size" in volumes. All volumes have the
same value.
* "volu_loff[HAMMER2_MAX_VOLUMES]" - A 512 bytes table which contains
start offset of max 64 volumes within "total_size". All volumes have
the same value.

Version 1 volume header has 0 for above fields, so HAMMER2 internally
treats "nvolumes" as 1, and "total_size" as "volu_size" to be able to
handle version 1 and 2 transparently.

All volumes have 4 headers, but only root volume ones are relevant.
Non-root volume headers have their own unique "volu_id" and "volu_size",
but other fields are unimportant and never used. Non-root volume headers
have sroot blockset[i] whose type is HAMMER2_BREF_TYPE_INVALID. Non-root
volume headers don't have boot/aux area, so freemap area start from
offset 0. Non-root volume headers are readonly and never updated after
creation. This means non-root volumes are just extra storage to extend
fs size and internally make up a single virtual volume whose size is
"total_size".

It currently doesn't automatically upgrade an existing version 1 fs to
version 2. Only newly created fs becomes version 2 for now.

2. volumes layout
=================
Basically similar to HAMMER1. A first block device argument provided for
newfs_hammer2(8) becomes the root volume, and if specified remaining
devices extend "total_size" as non-root volumes. All volumes except for
the last one have 1GiB (freemap level1) aligned "volu_size".

This means each volume's start offset within "total_size" is also 1GiB
(freemap level1) aligned. The start offsets of volumes are stored in
volu_loff[HAMMER2_MAX_VOLUMES]. Each volu_loff[n] (0 <= n < nvolumes)
represents start offset of volume n within "total_size". Unused volumes
have -1 for volu_loff[n].
e.g. If a fs consists of 1 volume, volu_loff[0] has 0 and rests have -1.
e.g. If a fs consists of 3 volumes, x GiB root volume, y GiB volume,
and z GiB volume, volu_loff[0] has 0, volu_loff[1] has x, volu_loff[2]
has x+y, and rests have -1.

Low level I/O function in HAMMER2 uses this linear offsets table to
determine a device vnode to use and relative offset within the device
vnode, for a given blockref's "data_off". This is different from HAMMER1
where logical offset had embedded volume id bits (i.e. there were holes
in logical address space). HAMMER2 needs this table to support multi-
volumes without changing current logical offset mechanism.

Unless all volumes are specified and mountable, mount_hammer2(8) fails
like it failed in HAMMER1. This also applies to other userspace commands
which require volumes specification, except for fstyp(8).

3. userspace commands
=====================
Basically same as or similar to HAMMER1.
* newfs_hammer2(8) takes a list of block device paths as argv[].
* mount_hammer2(8) takes block device paths or names in "a:b:c:..."
format.
* hammer2(8) takes block device paths or names in "a:b:c:..." format for
directives which require volumes specification. This commit also adds
"volume-list" directive and an ioctl command HAMMER2IOC_VOLUME_LIST,
which are similar to the one in HAMMER1.
* fsck_hammer2(8) takes device paths or names in "a:b:c:..." format.
* fstyp(8) takes device paths in "path1:path2:path3:..." format.

4. limitations
==============
* hammer2(8) "info" directive ignores multi-volumes block devices.
* hammer2(8) "growfs" directive doesn't support multi-volumes fs.
* fstyp(8) is unable to find PFS label via -l option if the PFS inode or
its parent indirect blocks are located beyond root volume.
* hammer2(8) doesn't support "volume-add" and "volume-del" directives
which existed in HAMMER1, and there is currently no plan to support.

show more ...


# 0425627b 08-Dec-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Remove 0x prefix for blockref data_off/key in "show"

Other blockref fields don't have 0x prefix.
Quiet mode also doesn't have 0x prefix for data_off/key.


# ed383a46 18-Nov-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Add bulkfree_tid for "volhdr"


# cac06d4e 04-Oct-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Add hammer2_pfssubtype_to_str()


Revision tags: v5.8.3, v5.8.2
# 91e93d9f 28-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Introduce HAMMER2_SHOW_DEPTH to limit "show" depth

Useful to check HAMMER2 radix tree nodes not so deep in the tree.


# 1eefcd4b 28-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Drop extra indentation in "show" when -q


# 660ecd92 28-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Fix "show" and "volhdr" output format


# 5dade8cf 27-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sys/vfs/hammer2: Remove HAMMER2_MINIO* macros

HAMMER2_MINIO* were added in 1a7cfe5ae3c897f704a358fd3e556a55e430dcb1
in 2013 to switch HAMMER2_MINIO* values with ifdefs when ondisk format
wasn't stab

sys/vfs/hammer2: Remove HAMMER2_MINIO* macros

HAMMER2_MINIO* were added in 1a7cfe5ae3c897f704a358fd3e556a55e430dcb1
in 2013 to switch HAMMER2_MINIO* values with ifdefs when ondisk format
wasn't stable.

This is no longer needed, and using both HAMMER2_MINIO* and HAMMER2_LBUF*
should be avoided. Users of HAMMER2_MINIO* exist in several userspace
programs which walk through blockrefs from top to bottom.

show more ...


# 97ea1536 10-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Make "dumpchain" print strerror if not HAMMER2 inode


# 4db52a5a 10-Aug-2020 Tomohiro Kusumi <tkusumi@netbsd.org>

sbin/hammer2: Use nitems()


# 9317c2d0 23-Jul-2020 Sascha Wildner <saw@online.de>

Fix some cases where %zd was used wrongly across the tree.


12345