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/ordered-data.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/ordered-data.c')
-rw-r--r-- | fs/btrfs/ordered-data.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index a20940170274..77c2411a5f0f 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -613,7 +613,6 @@ int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr, | |||
613 | struct btrfs_sector_sum *sector_sums; | 613 | struct btrfs_sector_sum *sector_sums; |
614 | struct btrfs_ordered_extent *ordered; | 614 | struct btrfs_ordered_extent *ordered; |
615 | struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; | 615 | struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree; |
616 | struct list_head *cur; | ||
617 | unsigned long num_sectors; | 616 | unsigned long num_sectors; |
618 | unsigned long i; | 617 | unsigned long i; |
619 | u32 sectorsize = BTRFS_I(inode)->root->sectorsize; | 618 | u32 sectorsize = BTRFS_I(inode)->root->sectorsize; |
@@ -624,8 +623,7 @@ int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr, | |||
624 | return 1; | 623 | return 1; |
625 | 624 | ||
626 | mutex_lock(&tree->mutex); | 625 | mutex_lock(&tree->mutex); |
627 | list_for_each_prev(cur, &ordered->list) { | 626 | list_for_each_entry_reverse(ordered_sum, &ordered->list, list) { |
628 | ordered_sum = list_entry(cur, struct btrfs_ordered_sum, list); | ||
629 | if (disk_bytenr >= ordered_sum->bytenr) { | 627 | if (disk_bytenr >= ordered_sum->bytenr) { |
630 | num_sectors = ordered_sum->len / sectorsize; | 628 | num_sectors = ordered_sum->len / sectorsize; |
631 | sector_sums = ordered_sum->sums; | 629 | sector_sums = ordered_sum->sums; |