mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-04-17 08:54:52 +03:00
Bypass snprintf() in quota checks if no quotas set
This improves synthetic 1 byte write speed by ~2.5%. Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com> Closes #18063
This commit is contained in:
parent
8dd01181aa
commit
8d391531eb
@ -433,13 +433,13 @@ zfs_id_overobjquota(zfsvfs_t *zfsvfs, uint64_t usedobj, uint64_t id)
|
|||||||
} else {
|
} else {
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
}
|
}
|
||||||
|
if (quotaobj == 0 && default_quota == 0)
|
||||||
|
return (B_FALSE);
|
||||||
if (zfsvfs->z_replay)
|
if (zfsvfs->z_replay)
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
|
|
||||||
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
||||||
if (quotaobj == 0) {
|
if (quotaobj == 0) {
|
||||||
if (default_quota == 0)
|
|
||||||
return (B_FALSE);
|
|
||||||
quota = default_quota;
|
quota = default_quota;
|
||||||
} else {
|
} else {
|
||||||
err = zap_lookup(zfsvfs->z_os, quotaobj, buf, 8, 1, "a);
|
err = zap_lookup(zfsvfs->z_os, quotaobj, buf, 8, 1, "a);
|
||||||
@ -484,13 +484,13 @@ zfs_id_overblockquota(zfsvfs_t *zfsvfs, uint64_t usedobj, uint64_t id)
|
|||||||
} else {
|
} else {
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
}
|
}
|
||||||
|
if (quotaobj == 0 && default_quota == 0)
|
||||||
|
return (B_FALSE);
|
||||||
if (zfsvfs->z_replay)
|
if (zfsvfs->z_replay)
|
||||||
return (B_FALSE);
|
return (B_FALSE);
|
||||||
|
|
||||||
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
||||||
if (quotaobj == 0) {
|
if (quotaobj == 0) {
|
||||||
if (default_quota == 0)
|
|
||||||
return (B_FALSE);
|
|
||||||
quota = default_quota;
|
quota = default_quota;
|
||||||
} else {
|
} else {
|
||||||
err = zap_lookup(zfsvfs->z_os, quotaobj, buf, 8, 1, "a);
|
err = zap_lookup(zfsvfs->z_os, quotaobj, buf, 8, 1, "a);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user