diff options
author | Matthew Ahrens <Matthew.Ahrens@Sun.COM> | 2009-08-28 13:57:58 -0700 |
---|---|---|
committer | Matthew Ahrens <Matthew.Ahrens@Sun.COM> | 2009-08-28 13:57:58 -0700 |
commit | 9966ca11f4a1481acce85f690fa59e4084050627 (patch) | |
tree | f17eda4c69339e72f03f95b2ae967c0a05f07002 /usr/src/uts/common/fs/zfs/zfs_vfsops.c | |
parent | 5413ab1b25eb8f7cbf9070adc2e222772aa054da (diff) | |
download | illumos-gate-9966ca11f4a1481acce85f690fa59e4084050627.tar.gz |
6875779 zfs user accounting callbacks can be simplified
6771468 ::blkptr prints incorrectly on 32-bit
6832861 zcmd_alloc_dst_nvlist's default size is too small
6876808 want ::refcount to print refcount_t details
Diffstat (limited to 'usr/src/uts/common/fs/zfs/zfs_vfsops.c')
-rw-r--r-- | usr/src/uts/common/fs/zfs/zfs_vfsops.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c index 6a5a736b30..d8868ffc0d 100644 --- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c +++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c @@ -594,36 +594,18 @@ uidacct(objset_t *os, boolean_t isgroup, uint64_t fuid, ASSERT(err == 0); } -static void -zfs_space_delta_cb(objset_t *os, dmu_object_type_t bonustype, - void *oldbonus, void *newbonus, - uint64_t oldused, uint64_t newused, dmu_tx_t *tx) +static int +zfs_space_delta_cb(dmu_object_type_t bonustype, void *bonus, + uint64_t *userp, uint64_t *groupp) { - znode_phys_t *oldznp = oldbonus; - znode_phys_t *newznp = newbonus; + znode_phys_t *znp = bonus; if (bonustype != DMU_OT_ZNODE) - return; - - /* We charge 512 for the dnode (if it's allocated). */ - if (oldznp->zp_gen != 0) - oldused += DNODE_SIZE; - if (newznp->zp_gen != 0) - newused += DNODE_SIZE; - - if (oldznp->zp_uid == newznp->zp_uid) { - uidacct(os, B_FALSE, oldznp->zp_uid, newused-oldused, tx); - } else { - uidacct(os, B_FALSE, oldznp->zp_uid, -oldused, tx); - uidacct(os, B_FALSE, newznp->zp_uid, newused, tx); - } + return (ENOENT); - if (oldznp->zp_gid == newznp->zp_gid) { - uidacct(os, B_TRUE, oldznp->zp_gid, newused-oldused, tx); - } else { - uidacct(os, B_TRUE, oldznp->zp_gid, -oldused, tx); - uidacct(os, B_TRUE, newznp->zp_gid, newused, tx); - } + *userp = znp->zp_uid; + *groupp = znp->zp_gid; + return (0); } static void |