Quiet down very frequent large allocation warning in ZFS.
[zfs.git] / module / zfs / zfs_fuid.c
index 8c0424e..97fceea 100644 (file)
@@ -168,12 +168,12 @@ zfs_fuid_table_destroy(avl_tree_t *idx_tree, avl_tree_t *domain_tree)
        void *cookie;
 
        cookie = NULL;
-       while (domnode = avl_destroy_nodes(domain_tree, &cookie))
+       while ((domnode = avl_destroy_nodes(domain_tree, &cookie)))
                ksiddomain_rele(domnode->f_ksid);
 
        avl_destroy(domain_tree);
        cookie = NULL;
-       while (domnode = avl_destroy_nodes(idx_tree, &cookie))
+       while ((domnode = avl_destroy_nodes(idx_tree, &cookie)))
                kmem_free(domnode, sizeof (fuid_domain_t));
        avl_destroy(idx_tree);
 }
@@ -192,6 +192,7 @@ zfs_fuid_idx_domain(avl_tree_t *idx_tree, uint32_t idx)
 }
 
 #ifdef _KERNEL
+#ifdef HAVE_ZPL
 /*
  * Load the fuid table(s) into memory.
  */
@@ -388,26 +389,8 @@ zfs_fuid_find_by_idx(zfsvfs_t *zfsvfs, uint32_t idx)
 void
 zfs_fuid_map_ids(znode_t *zp, cred_t *cr, uid_t *uidp, uid_t *gidp)
 {
-       uint64_t fuid, fgid;
-       sa_bulk_attr_t bulk[2];
-       int count = 0;
-
-       if (IS_EPHEMERAL(zp->z_uid) || IS_EPHEMERAL(zp->z_gid)) {
-               SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_UID(zp->z_zfsvfs),
-                   NULL, &fuid, 8);
-               SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_GID(zp->z_zfsvfs),
-                   NULL, &fgid, 8);
-               VERIFY(0 == sa_bulk_lookup(zp->z_sa_hdl, bulk, count));
-       }
-       if (IS_EPHEMERAL(zp->z_uid))
-               *uidp = zfs_fuid_map_id(zp->z_zfsvfs, zp->z_uid, cr, ZFS_OWNER);
-       else
-               *uidp = zp->z_uid;
-       if (IS_EPHEMERAL(zp->z_gid))
-               *gidp = zfs_fuid_map_id(zp->z_zfsvfs,
-                   zp->z_gid, cr, ZFS_GROUP);
-       else
-               *gidp = zp->z_gid;
+       *uidp = zfs_fuid_map_id(zp->z_zfsvfs, zp->z_uid, cr, ZFS_OWNER);
+       *gidp = zfs_fuid_map_id(zp->z_zfsvfs, zp->z_gid, cr, ZFS_GROUP);
 }
 
 uid_t
@@ -771,4 +754,5 @@ zfs_fuid_txhold(zfsvfs_t *zfsvfs, dmu_tx_t *tx)
                    FUID_SIZE_ESTIMATE(zfsvfs));
        }
 }
+#endif /* HAVE_ZPL */
 #endif