]> git.proxmox.com Git - mirror_zfs.git/commit
Provide macros for setting and getting blkptr birth times
authorGeorge Wilson <george.wilson@delphix.com>
Mon, 25 Mar 2024 22:01:54 +0000 (18:01 -0400)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 22:01:54 +0000 (15:01 -0700)
commit493fcce9be165bd751434879d2478938cd5bb926
tree1d371a5504e67262f479075d26df6baa6a3ccd68
parent4616b96a643c941e96ee0d1d816c573df9f0de28
Provide macros for setting and getting blkptr birth times

There exist a couple of macros that are used to update the blkptr birth
times but they can often be confusing. For example, the
BP_PHYSICAL_BIRTH() macro will provide either the physical birth time
if it is set or else return back the logical birth time. The
complement to this macro is BP_SET_BIRTH() which will set the logical
birth time and set the physical birth time if they are not the same.
Consumers may get confused when they are trying to get the physical
birth time and use the BP_PHYSICAL_BIRTH() macro only to find out that
the logical birth time is what is actually returned.

This change cleans up these macros and makes them symmetrical. The same
functionally is preserved but the name is changed. Instead of calling
BP_PHYSICAL_BIRTH(), consumer can now call BP_GET_BIRTH(). In
additional to cleaning up this naming conventions, two new sets of
macros are introduced -- BP_[SET|GET]_LOGICAL_BIRTH() and
BP_[SET|GET]_PHYSICAL_BIRTH.  These new macros allow the consumer to
get and set the specific birth time.

As part of the cleanup, the unused GRID macros have been removed and
that portion of the blkptr are currently unused.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Signed-off-by: George Wilson <gwilson@delphix.com>
Closes #15962
32 files changed:
cmd/zdb/zdb.c
cmd/zdb/zdb_il.c
cmd/zhack.c
include/sys/spa.h
include/sys/uberblock_impl.h
lib/libzdb/libzdb.c
module/zfs/arc.c
module/zfs/bpobj.c
module/zfs/brt.c
module/zfs/dbuf.c
module/zfs/ddt.c
module/zfs/dmu.c
module/zfs/dmu_recv.c
module/zfs/dmu_send.c
module/zfs/dmu_traverse.c
module/zfs/dnode.c
module/zfs/dsl_bookmark.c
module/zfs/dsl_dataset.c
module/zfs/dsl_deadlist.c
module/zfs/dsl_destroy.c
module/zfs/dsl_pool.c
module/zfs/dsl_scan.c
module/zfs/metaslab.c
module/zfs/spa.c
module/zfs/spa_errlog.c
module/zfs/spa_log_spacemap.c
module/zfs/uberblock.c
module/zfs/vdev_mirror.c
module/zfs/vdev_raidz.c
module/zfs/zil.c
module/zfs/zio.c
module/zfs/zio_checksum.c