diff options
author | Jeff Mahoney <jeffm@suse.com> | 2012-03-01 08:56:26 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-03-21 20:45:34 -0400 |
commit | 143bede527b054a271053f41bfaca2b57baa9408 (patch) | |
tree | 95c71d3705c73bf98e7a1547da35e70a44703c1e /fs/btrfs/scrub.c | |
parent | ffd7b33944f4573a063af7a55f8a5199c8185665 (diff) |
btrfs: return void in functions without error conditions
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index abc0fbffa510..a2e8aa40f3f5 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -948,12 +948,12 @@ static int scrub_checksum_super(struct scrub_bio *sbio, void *buffer) | |||
948 | return fail; | 948 | return fail; |
949 | } | 949 | } |
950 | 950 | ||
951 | static int scrub_submit(struct scrub_dev *sdev) | 951 | static void scrub_submit(struct scrub_dev *sdev) |
952 | { | 952 | { |
953 | struct scrub_bio *sbio; | 953 | struct scrub_bio *sbio; |
954 | 954 | ||
955 | if (sdev->curr == -1) | 955 | if (sdev->curr == -1) |
956 | return 0; | 956 | return; |
957 | 957 | ||
958 | sbio = sdev->bios[sdev->curr]; | 958 | sbio = sdev->bios[sdev->curr]; |
959 | sbio->err = 0; | 959 | sbio->err = 0; |
@@ -961,8 +961,6 @@ static int scrub_submit(struct scrub_dev *sdev) | |||
961 | atomic_inc(&sdev->in_flight); | 961 | atomic_inc(&sdev->in_flight); |
962 | 962 | ||
963 | btrfsic_submit_bio(READ, sbio->bio); | 963 | btrfsic_submit_bio(READ, sbio->bio); |
964 | |||
965 | return 0; | ||
966 | } | 964 | } |
967 | 965 | ||
968 | static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len, | 966 | static int scrub_page(struct scrub_dev *sdev, u64 logical, u64 len, |
@@ -1008,9 +1006,7 @@ again: | |||
1008 | sbio->bio = bio; | 1006 | sbio->bio = bio; |
1009 | } else if (sbio->physical + sbio->count * PAGE_SIZE != physical || | 1007 | } else if (sbio->physical + sbio->count * PAGE_SIZE != physical || |
1010 | sbio->logical + sbio->count * PAGE_SIZE != logical) { | 1008 | sbio->logical + sbio->count * PAGE_SIZE != logical) { |
1011 | ret = scrub_submit(sdev); | 1009 | scrub_submit(sdev); |
1012 | if (ret) | ||
1013 | return ret; | ||
1014 | goto again; | 1010 | goto again; |
1015 | } | 1011 | } |
1016 | sbio->spag[sbio->count].flags = flags; | 1012 | sbio->spag[sbio->count].flags = flags; |
@@ -1025,9 +1021,7 @@ again: | |||
1025 | ret = bio_add_page(sbio->bio, page, PAGE_SIZE, 0); | 1021 | ret = bio_add_page(sbio->bio, page, PAGE_SIZE, 0); |
1026 | if (!ret) { | 1022 | if (!ret) { |
1027 | __free_page(page); | 1023 | __free_page(page); |
1028 | ret = scrub_submit(sdev); | 1024 | scrub_submit(sdev); |
1029 | if (ret) | ||
1030 | return ret; | ||
1031 | goto again; | 1025 | goto again; |
1032 | } | 1026 | } |
1033 | 1027 | ||
@@ -1036,13 +1030,8 @@ again: | |||
1036 | memcpy(sbio->spag[sbio->count].csum, csum, sdev->csum_size); | 1030 | memcpy(sbio->spag[sbio->count].csum, csum, sdev->csum_size); |
1037 | } | 1031 | } |
1038 | ++sbio->count; | 1032 | ++sbio->count; |
1039 | if (sbio->count == SCRUB_PAGES_PER_BIO || force) { | 1033 | if (sbio->count == SCRUB_PAGES_PER_BIO || force) |
1040 | int ret; | 1034 | scrub_submit(sdev); |
1041 | |||
1042 | ret = scrub_submit(sdev); | ||
1043 | if (ret) | ||
1044 | return ret; | ||
1045 | } | ||
1046 | 1035 | ||
1047 | return 0; | 1036 | return 0; |
1048 | } | 1037 | } |
@@ -1656,7 +1645,7 @@ int btrfs_scrub_dev(struct btrfs_root *root, u64 devid, u64 start, u64 end, | |||
1656 | return ret; | 1645 | return ret; |
1657 | } | 1646 | } |
1658 | 1647 | ||
1659 | int btrfs_scrub_pause(struct btrfs_root *root) | 1648 | void btrfs_scrub_pause(struct btrfs_root *root) |
1660 | { | 1649 | { |
1661 | struct btrfs_fs_info *fs_info = root->fs_info; | 1650 | struct btrfs_fs_info *fs_info = root->fs_info; |
1662 | 1651 | ||
@@ -1671,29 +1660,24 @@ int btrfs_scrub_pause(struct btrfs_root *root) | |||
1671 | mutex_lock(&fs_info->scrub_lock); | 1660 | mutex_lock(&fs_info->scrub_lock); |
1672 | } | 1661 | } |
1673 | mutex_unlock(&fs_info->scrub_lock); | 1662 | mutex_unlock(&fs_info->scrub_lock); |
1674 | |||
1675 | return 0; | ||
1676 | } | 1663 | } |
1677 | 1664 | ||
1678 | int btrfs_scrub_continue(struct btrfs_root *root) | 1665 | void btrfs_scrub_continue(struct btrfs_root *root) |
1679 | { | 1666 | { |
1680 | struct btrfs_fs_info *fs_info = root->fs_info; | 1667 | struct btrfs_fs_info *fs_info = root->fs_info; |
1681 | 1668 | ||
1682 | atomic_dec(&fs_info->scrub_pause_req); | 1669 | atomic_dec(&fs_info->scrub_pause_req); |
1683 | wake_up(&fs_info->scrub_pause_wait); | 1670 | wake_up(&fs_info->scrub_pause_wait); |
1684 | return 0; | ||
1685 | } | 1671 | } |
1686 | 1672 | ||
1687 | int btrfs_scrub_pause_super(struct btrfs_root *root) | 1673 | void btrfs_scrub_pause_super(struct btrfs_root *root) |
1688 | { | 1674 | { |
1689 | down_write(&root->fs_info->scrub_super_lock); | 1675 | down_write(&root->fs_info->scrub_super_lock); |
1690 | return 0; | ||
1691 | } | 1676 | } |
1692 | 1677 | ||
1693 | int btrfs_scrub_continue_super(struct btrfs_root *root) | 1678 | void btrfs_scrub_continue_super(struct btrfs_root *root) |
1694 | { | 1679 | { |
1695 | up_write(&root->fs_info->scrub_super_lock); | 1680 | up_write(&root->fs_info->scrub_super_lock); |
1696 | return 0; | ||
1697 | } | 1681 | } |
1698 | 1682 | ||
1699 | int btrfs_scrub_cancel(struct btrfs_root *root) | 1683 | int btrfs_scrub_cancel(struct btrfs_root *root) |