From 599f46ade32c4fab19e2191e85aa28fa57790444 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 28 Aug 2017 17:21:05 +0200 Subject: btrfs-progs: use kzalloc to allocate transaction handle Use the kernel-style allocation helpers and remove redundant zeroing. Signed-off-by: David Sterba --- transaction.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'transaction.h') diff --git a/transaction.h b/transaction.h index 738eebd1..ce638713 100644 --- a/transaction.h +++ b/transaction.h @@ -37,7 +37,7 @@ static inline struct btrfs_trans_handle * btrfs_start_transaction(struct btrfs_root *root, int num_blocks) { struct btrfs_fs_info *fs_info = root->fs_info; - struct btrfs_trans_handle *h = malloc(sizeof(*h)); + struct btrfs_trans_handle *h = kzalloc(sizeof(*h), GFP_NOFS); if (!h) return ERR_PTR(-ENOMEM); @@ -54,11 +54,7 @@ btrfs_start_transaction(struct btrfs_root *root, int num_blocks) fs_info->running_transaction = h; fs_info->generation++; h->transid = fs_info->generation; - h->alloc_exclude_start = 0; - h->alloc_exclude_nr = 0; h->blocks_reserved = num_blocks; - h->blocks_used = 0; - h->block_group = NULL; root->last_trans = h->transid; root->commit_root = root->node; extent_buffer_get(root->node); -- cgit v1.2.3