From ebabb93e6c6e1849173206874a1543d8161225ab Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 16 Jan 2023 07:53:16 -0500 Subject: [PATCH] Micro-optimize dsl_prop_get_dd() Use the saved property index instead of looking it up once per DSL directory when traversing up towards the root. Reviewed-by: Brian Behlendorf Reviewed-by: Igor Kozhukhov Reviewed-by: Richard Yao Reviewed-by: Allan Jude Reviewed-by: Akash B Signed-off-by: Mark Johnston Sponsored-by: The FreeBSD Foundation Closes #14397 --- module/zfs/dsl_prop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/dsl_prop.c b/module/zfs/dsl_prop.c index 57ff3b10d5..a1e73f97e3 100644 --- a/module/zfs/dsl_prop.c +++ b/module/zfs/dsl_prop.c @@ -123,7 +123,7 @@ dsl_prop_get_dd(dsl_dir_t *dd, const char *propname, /* Check for a iuv value. */ err = zap_lookup(mos, dsl_dir_phys(dd)->dd_props_zapobj, iuvstr, intsz, numints, buf); - if (err == 0 && dsl_prop_known_index(zfs_name_to_prop(propname), + if (err == 0 && dsl_prop_known_index(prop, *(uint64_t *)buf) != 1) err = ENOENT; if (err != ENOENT) {