diff options
author | Qinghuang Feng <qhfeng.kernel@gmail.com> | 2009-01-21 10:59:08 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-21 10:59:08 -0500 |
commit | c6e308713a47527f88a277ee95b7c5d1db80f77b (patch) | |
tree | 0a890bb3ac2ae1bb8733cf8679d1441e1b85eb81 /fs/btrfs/extent-tree.c | |
parent | 57506d50ed6db7b0e7ddc9845e86e81f140983d5 (diff) |
Btrfs: simplify iteration codes
Merge list_for_each* and list_entry to list_for_each_entry*
Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index cdc961e7556a..a4e36c38b81e 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -325,10 +325,8 @@ static struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info, | |||
325 | u64 flags) | 325 | u64 flags) |
326 | { | 326 | { |
327 | struct list_head *head = &info->space_info; | 327 | struct list_head *head = &info->space_info; |
328 | struct list_head *cur; | ||
329 | struct btrfs_space_info *found; | 328 | struct btrfs_space_info *found; |
330 | list_for_each(cur, head) { | 329 | list_for_each_entry(found, head, list) { |
331 | found = list_entry(cur, struct btrfs_space_info, list); | ||
332 | if (found->flags == flags) | 330 | if (found->flags == flags) |
333 | return found; | 331 | return found; |
334 | } | 332 | } |
@@ -3013,7 +3011,6 @@ loop_check: | |||
3013 | static void dump_space_info(struct btrfs_space_info *info, u64 bytes) | 3011 | static void dump_space_info(struct btrfs_space_info *info, u64 bytes) |
3014 | { | 3012 | { |
3015 | struct btrfs_block_group_cache *cache; | 3013 | struct btrfs_block_group_cache *cache; |
3016 | struct list_head *l; | ||
3017 | 3014 | ||
3018 | printk(KERN_INFO "space_info has %llu free, is %sfull\n", | 3015 | printk(KERN_INFO "space_info has %llu free, is %sfull\n", |
3019 | (unsigned long long)(info->total_bytes - info->bytes_used - | 3016 | (unsigned long long)(info->total_bytes - info->bytes_used - |
@@ -3021,8 +3018,7 @@ static void dump_space_info(struct btrfs_space_info *info, u64 bytes) | |||
3021 | (info->full) ? "" : "not "); | 3018 | (info->full) ? "" : "not "); |
3022 | 3019 | ||
3023 | down_read(&info->groups_sem); | 3020 | down_read(&info->groups_sem); |
3024 | list_for_each(l, &info->block_groups) { | 3021 | list_for_each_entry(cache, &info->block_groups, list) { |
3025 | cache = list_entry(l, struct btrfs_block_group_cache, list); | ||
3026 | spin_lock(&cache->lock); | 3022 | spin_lock(&cache->lock); |
3027 | printk(KERN_INFO "block group %llu has %llu bytes, %llu used " | 3023 | printk(KERN_INFO "block group %llu has %llu bytes, %llu used " |
3028 | "%llu pinned %llu reserved\n", | 3024 | "%llu pinned %llu reserved\n", |