mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Show default quotas in zfs userspace tools
Update zfs userspace, groupspace, and projectspace to display the default quotas when no per-ID specific quota is configured. This ensures tool outputs align with enforced limits. Signed-off-by: Ameer Hamza <ahamza@ixsystems.com> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Tony Hutter <hutter2@llnl.gov>
This commit is contained in:
+7
-4
@@ -2986,7 +2986,8 @@ us_type2str(unsigned field_type)
|
||||
}
|
||||
|
||||
static int
|
||||
userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
||||
userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space,
|
||||
uint64_t default_quota)
|
||||
{
|
||||
us_cbdata_t *cb = (us_cbdata_t *)arg;
|
||||
zfs_userquota_prop_t prop = cb->cb_prop;
|
||||
@@ -3142,7 +3143,7 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
||||
prop == ZFS_PROP_PROJECTUSED) {
|
||||
propname = "used";
|
||||
if (!nvlist_exists(props, "quota"))
|
||||
(void) nvlist_add_uint64(props, "quota", 0);
|
||||
(void) nvlist_add_uint64(props, "quota", default_quota);
|
||||
} else if (prop == ZFS_PROP_USERQUOTA || prop == ZFS_PROP_GROUPQUOTA ||
|
||||
prop == ZFS_PROP_PROJECTQUOTA) {
|
||||
propname = "quota";
|
||||
@@ -3151,8 +3152,10 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
|
||||
} else if (prop == ZFS_PROP_USEROBJUSED ||
|
||||
prop == ZFS_PROP_GROUPOBJUSED || prop == ZFS_PROP_PROJECTOBJUSED) {
|
||||
propname = "objused";
|
||||
if (!nvlist_exists(props, "objquota"))
|
||||
(void) nvlist_add_uint64(props, "objquota", 0);
|
||||
if (!nvlist_exists(props, "objquota")) {
|
||||
(void) nvlist_add_uint64(props, "objquota",
|
||||
default_quota);
|
||||
}
|
||||
} else if (prop == ZFS_PROP_USEROBJQUOTA ||
|
||||
prop == ZFS_PROP_GROUPOBJQUOTA ||
|
||||
prop == ZFS_PROP_PROJECTOBJQUOTA) {
|
||||
|
||||
Reference in New Issue
Block a user