diff options
author | Brian Behlendorf <[email protected]> | 2011-01-07 13:47:47 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-02-10 09:21:42 -0800 |
commit | f30484afc32b6040a15fabfc697cfb76116e468f (patch) | |
tree | 5b475014f5f7dc8fa4101abf8cb4e24284f5c057 /module | |
parent | 1ee1b76786aebc6eed546c6e869cc88f1e318890 (diff) |
Conserve stack in zfs_mkdir()
Move the sa_attrs array from the stack to the heap to minimize stack
space usage.
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/zfs_znode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 93f2f026e..b7f95f4f0 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -773,7 +773,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr, int bonuslen; sa_handle_t *sa_hdl; dmu_object_type_t obj_type; - sa_bulk_attr_t sa_attrs[ZPL_END]; + sa_bulk_attr_t *sa_attrs; int cnt = 0; zfs_acl_locator_cb_t locate = { 0 }; @@ -899,6 +899,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr, * order for DMU_OT_ZNODE is critical since it needs to be constructed * in the old znode_phys_t format. Don't change this ordering */ + sa_attrs = kmem_alloc(sizeof(sa_bulk_attr_t) * ZPL_END, KM_SLEEP); if (obj_type == DMU_OT_ZNODE) { SA_ADD_BULK_ATTR(sa_attrs, cnt, SA_ZPL_ATIME(zfsvfs), @@ -1002,6 +1003,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, dmu_tx_t *tx, cred_t *cr, err = zfs_aclset_common(*zpp, acl_ids->z_aclp, cr, tx); ASSERT3S(err, ==, 0); } + kmem_free(sa_attrs, sizeof(sa_bulk_attr_t) * ZPL_END); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); } |