diff options
author | David Sterba <dsterba@suse.cz> | 2011-04-13 09:41:04 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-06 03:04:01 -0500 |
commit | 6c41761fc6efe1503103a1afe03a6635c0b5d4ec (patch) | |
tree | 08ad34d43aac48e8f8143a0b1fa07141df8f202a /fs/btrfs/transaction.c | |
parent | c8174313a8102e874aaa321e2fc4c7c460a87151 (diff) |
btrfs: separate superblock items out of fs_info
fs_info has now ~9kb, more than fits into one page. This will cause
mount failure when memory is too fragmented. Top space consumers are
super block structures super_copy and super_for_commit, ~2.8kb each.
Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)
Add a wrapper for freeing fs_info and all of it's dynamically allocated
members.
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 29bef63e23ba..373c7ec1a026 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -991,7 +991,7 @@ static void update_super_roots(struct btrfs_root *root) | |||
991 | struct btrfs_root_item *root_item; | 991 | struct btrfs_root_item *root_item; |
992 | struct btrfs_super_block *super; | 992 | struct btrfs_super_block *super; |
993 | 993 | ||
994 | super = &root->fs_info->super_copy; | 994 | super = root->fs_info->super_copy; |
995 | 995 | ||
996 | root_item = &root->fs_info->chunk_root->root_item; | 996 | root_item = &root->fs_info->chunk_root->root_item; |
997 | super->chunk_root = root_item->bytenr; | 997 | super->chunk_root = root_item->bytenr; |
@@ -1301,12 +1301,12 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
1301 | update_super_roots(root); | 1301 | update_super_roots(root); |
1302 | 1302 | ||
1303 | if (!root->fs_info->log_root_recovering) { | 1303 | if (!root->fs_info->log_root_recovering) { |
1304 | btrfs_set_super_log_root(&root->fs_info->super_copy, 0); | 1304 | btrfs_set_super_log_root(root->fs_info->super_copy, 0); |
1305 | btrfs_set_super_log_root_level(&root->fs_info->super_copy, 0); | 1305 | btrfs_set_super_log_root_level(root->fs_info->super_copy, 0); |
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | memcpy(&root->fs_info->super_for_commit, &root->fs_info->super_copy, | 1308 | memcpy(root->fs_info->super_for_commit, root->fs_info->super_copy, |
1309 | sizeof(root->fs_info->super_copy)); | 1309 | sizeof(*root->fs_info->super_copy)); |
1310 | 1310 | ||
1311 | trans->transaction->blocked = 0; | 1311 | trans->transaction->blocked = 0; |
1312 | spin_lock(&root->fs_info->trans_lock); | 1312 | spin_lock(&root->fs_info->trans_lock); |