zfs_main.c (148434217c040ea38dc844384f6ba68d9b325906) zfs_main.c (0aea4b19873599c9a11db600b90263c7233db953)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1651 unchanged lines hidden (view full) ---

1660 }
1661
1662 return (ret);
1663}
1664
1665/*
1666 * zfs userspace
1667 */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1651 unchanged lines hidden (view full) ---

1660 }
1661
1662 return (ret);
1663}
1664
1665/*
1666 * zfs userspace
1667 */
1668static void
1668static int
1669userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
1670{
1671 zfs_userquota_prop_t *typep = arg;
1672 zfs_userquota_prop_t p = *typep;
1669userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
1670{
1671 zfs_userquota_prop_t *typep = arg;
1672 zfs_userquota_prop_t p = *typep;
1673 char *name, *ug, *propname;
1673 char *name = NULL;
1674 char *ug, *propname;
1674 char namebuf[32];
1675 char sizebuf[32];
1676
1677 if (domain == NULL || domain[0] == '\0') {
1678 if (p == ZFS_PROP_GROUPUSED || p == ZFS_PROP_GROUPQUOTA) {
1679 struct group *g = getgrgid(rid);
1680 if (g)
1681 name = g->gr_name;

--- 9 unchanged lines hidden (view full) ---

1691 else
1692 ug = "user";
1693
1694 if (p == ZFS_PROP_USERUSED || p == ZFS_PROP_GROUPUSED)
1695 propname = "used";
1696 else
1697 propname = "quota";
1698
1675 char namebuf[32];
1676 char sizebuf[32];
1677
1678 if (domain == NULL || domain[0] == '\0') {
1679 if (p == ZFS_PROP_GROUPUSED || p == ZFS_PROP_GROUPQUOTA) {
1680 struct group *g = getgrgid(rid);
1681 if (g)
1682 name = g->gr_name;

--- 9 unchanged lines hidden (view full) ---

1692 else
1693 ug = "user";
1694
1695 if (p == ZFS_PROP_USERUSED || p == ZFS_PROP_GROUPUSED)
1696 propname = "used";
1697 else
1698 propname = "quota";
1699
1699 if (!name) {
1700 if (name == NULL) {
1700 (void) snprintf(namebuf, sizeof (namebuf),
1701 "%llu", (longlong_t)rid);
1702 name = namebuf;
1703 }
1704 zfs_nicenum(space, sizebuf, sizeof (sizebuf));
1705
1706 (void) printf("%s %s %s%c%s %s\n", propname, ug, domain,
1707 domain[0] ? '-' : ' ', name, sizebuf);
1701 (void) snprintf(namebuf, sizeof (namebuf),
1702 "%llu", (longlong_t)rid);
1703 name = namebuf;
1704 }
1705 zfs_nicenum(space, sizebuf, sizeof (sizebuf));
1706
1707 (void) printf("%s %s %s%c%s %s\n", propname, ug, domain,
1708 domain[0] ? '-' : ' ', name, sizebuf);
1709
1710 return (0);
1708}
1709
1710static int
1711zfs_do_userspace(int argc, char **argv)
1712{
1713 zfs_handle_t *zhp;
1714 zfs_userquota_prop_t p;
1715 int error;

--- 2292 unchanged lines hidden ---
1711}
1712
1713static int
1714zfs_do_userspace(int argc, char **argv)
1715{
1716 zfs_handle_t *zhp;
1717 zfs_userquota_prop_t p;
1718 int error;

--- 2292 unchanged lines hidden ---