Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-10-10 Thread Chris Mason
On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-10-10 Thread Chris Mason
On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-06 Thread Josef Bacik
On 09/05/2016 12:32 AM, Naohiro Aota wrote: 2016-09-02 (金) の 09:35 -0400 に Josef Bacik さんは書きました: On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-06 Thread Josef Bacik
On 09/05/2016 12:32 AM, Naohiro Aota wrote: 2016-09-02 (金) の 09:35 -0400 に Josef Bacik さんは書きました: On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-04 Thread Naohiro Aota
2016-09-02 (金) の 09:35 -0400 に Josef Bacik さんは書きました: > On 09/02/2016 03:46 AM, Naohiro Aota wrote: > > > > Currently, btrfs_relocate_chunk() is removing relocated BG by > > itself. But > > the work can be done by btrfs_delete_unused_bgs() (and it's better > > since it > > trim the BG). Let's

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-04 Thread Naohiro Aota
2016-09-02 (金) の 09:35 -0400 に Josef Bacik さんは書きました: > On 09/02/2016 03:46 AM, Naohiro Aota wrote: > > > > Currently, btrfs_relocate_chunk() is removing relocated BG by > > itself. But > > the work can be done by btrfs_delete_unused_bgs() (and it's better > > since it > > trim the BG). Let's

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-02 Thread Josef Bacik
On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated

Re: [PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-02 Thread Josef Bacik
On 09/02/2016 03:46 AM, Naohiro Aota wrote: Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated

[PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-02 Thread Naohiro Aota
Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated BG, it skip the BG since the BG has "ro" flag

[PATCH] btrfs: let btrfs_delete_unused_bgs() to clean relocated bgs

2016-09-02 Thread Naohiro Aota
Currently, btrfs_relocate_chunk() is removing relocated BG by itself. But the work can be done by btrfs_delete_unused_bgs() (and it's better since it trim the BG). Let's dedupe the code. While btrfs_delete_unused_bgs() is already hitting the relocated BG, it skip the BG since the BG has "ro" flag