Resubmit this after the checkpatch test.

In srhink_delalloc(), writeback starts if idle, also check the bdi is
not write congested.
The patch is against the head of the btrfs-next.

Signed-off-by: Itaru Kitayama <kitay...@cl.bb4.ne.jp>

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index efb044e..1aae046 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3712,8 +3712,9 @@ static void shrink_delalloc(struct btrfs_root
*root, u64 to_reclaim, u64 orig,
        while (delalloc_bytes && loops < 3) {
                max_reclaim = min(delalloc_bytes, to_reclaim);
                nr_pages = max_reclaim >> PAGE_CACHE_SHIFT;
-               writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages,
-                                              WB_REASON_FS_FREE_SPACE);
+               if (!bdi_write_congested(root->fs_info->sb->s_bdi))
+                       writeback_inodes_sb_nr_if_idle(root->fs_info, nr_page,
+                                                      WB_REASON_FS_FREE_SPACE);

                /*
                 * We need to wait for the async pages to actually start before


On Sun, Sep 30, 2012 at 1:21 AM, David Sterba <d...@jikos.cz> wrote:
> On Sat, Sep 29, 2012 at 10:20:09PM +0900, Itaru Kitayama wrote:
>> --- a/fs/btrfs/extent-tree.c
>> +++ b/fs/btrfs/extent-tree.c
>> @@ -3712,7 +3712,7 @@ static void shrink_delalloc(struct btrfs_root *root, 
>> u64 t
>>         while (delalloc_bytes && loops < 3) {
>>                 max_reclaim = min(delalloc_bytes, to_reclaim);
>>                 nr_pages = max_reclaim >> PAGE_CACHE_SHIFT;
>> -               writeback_inodes_sb_nr_if_idle(root->fs_info->sb, nr_pages,
>> +               if (!bdi_write_congested(root->fs_info->sb->s_bdi)) 
>> writeback_in
>>                                                WB_REASON_FS_FREE_SPACE);
>
> malformed patch
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to