mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-03-10 12:26:27 +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
0550abd4b8
commit
051a8c7494
@ -433,13 +433,13 @@ zfs_id_overobjquota(zfsvfs_t *zfsvfs, uint64_t usedobj, uint64_t id)
|
||||
} else {
|
||||
return (B_FALSE);
|
||||
}
|
||||
if (quotaobj == 0 && default_quota == 0)
|
||||
return (B_FALSE);
|
||||
if (zfsvfs->z_replay)
|
||||
return (B_FALSE);
|
||||
|
||||
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
||||
if (quotaobj == 0) {
|
||||
if (default_quota == 0)
|
||||
return (B_FALSE);
|
||||
quota = default_quota;
|
||||
} else {
|
||||
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 {
|
||||
return (B_FALSE);
|
||||
}
|
||||
if (quotaobj == 0 && default_quota == 0)
|
||||
return (B_FALSE);
|
||||
if (zfsvfs->z_replay)
|
||||
return (B_FALSE);
|
||||
|
||||
(void) snprintf(buf, sizeof (buf), "%llx", (longlong_t)id);
|
||||
if (quotaobj == 0) {
|
||||
if (default_quota == 0)
|
||||
return (B_FALSE);
|
||||
quota = default_quota;
|
||||
} else {
|
||||
err = zap_lookup(zfsvfs->z_os, quotaobj, buf, 8, 1, "a);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user