* [PATCH] btrfs_read_block_groups: Use enums to index btrfs_space_info->block_groups.
@ 2013-07-16 9:33 chandan
2013-07-18 17:50 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: chandan @ 2013-07-16 9:33 UTC (permalink / raw)
To: Chris Mason, linux-btrfs, linux-kernel
>From 33e376755b8a928610032a1cef024dcdd980aee3 Mon Sep 17 00:00:00 2001
From: chandan <chandan@linux.vnet.ibm.com>
Date: Tue, 16 Jul 2013 12:28:56 +0530
Subject: [PATCH] btrfs_read_block_groups: Use enums to index
btrfs_space_info->block_groups.
The current code uses integer literals to index
btrfs_space_info->block_groups[] array. Instead use corresponding
enums from 'enum btrfs_raid_types'.
Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
---
fs/btrfs/extent-tree.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 0236de7..cb18077 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8394,9 +8394,13 @@ int btrfs_read_block_groups(struct btrfs_root *root)
* avoid allocating from un-mirrored block group if there are
* mirrored block groups.
*/
- list_for_each_entry(cache, &space_info->block_groups[3], list)
+ list_for_each_entry(cache,
+ &space_info->block_groups[BTRFS_RAID_RAID0],
+ list)
set_block_group_ro(cache, 1);
- list_for_each_entry(cache, &space_info->block_groups[4], list)
+ list_for_each_entry(cache,
+ &space_info->block_groups[BTRFS_RAID_SINGLE],
+ list)
set_block_group_ro(cache, 1);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs_read_block_groups: Use enums to index btrfs_space_info->block_groups.
2013-07-16 9:33 [PATCH] btrfs_read_block_groups: Use enums to index btrfs_space_info->block_groups chandan
@ 2013-07-18 17:50 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2013-07-18 17:50 UTC (permalink / raw)
To: chandan; +Cc: Chris Mason, linux-btrfs, linux-kernel
On Tue, Jul 16, 2013 at 03:03:12PM +0530, chandan wrote:
> >From 33e376755b8a928610032a1cef024dcdd980aee3 Mon Sep 17 00:00:00 2001
> From: chandan <chandan@linux.vnet.ibm.com>
> Date: Tue, 16 Jul 2013 12:28:56 +0530
> Subject: [PATCH] btrfs_read_block_groups: Use enums to index
> btrfs_space_info->block_groups.
>
> The current code uses integer literals to index
> btrfs_space_info->block_groups[] array. Instead use corresponding
> enums from 'enum btrfs_raid_types'.
>
> Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-18 17:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 9:33 [PATCH] btrfs_read_block_groups: Use enums to index btrfs_space_info->block_groups chandan
2013-07-18 17:50 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.