[PATCH] Btrfs: fix lockdep error in async commit

2013-11-06 Thread Liu Bo
Lockdep complains about btrfs's async commit: [ 2372.462171] [ BUG: bad unlock balance detected! ] [ 2372.462191] 3.12.0+ #32 Tainted: GW [ 2372.462209] - [ 2372.462228] ceph-osd/14048 is trying to release lock (sb_internal) at: [ 2372.462275]

[RFC PATCH] Btrfs: change ioctl number of BTRFS_IOC_START_SYNC to 21

2013-11-06 Thread Liu Bo
24 has been assigned to both BTRFS_IOC_START_SYNC and BTRFS_IOC_SUBVOL_CREATE_V2, and BTRFS_IOC_SUBVOL_CREATE_V2 is at least used in btrfs-progs while BTRFS_IOC_START_SYNC is not. 21 is free according to link[1], and seems safe to be assigned to BTRFS_IOC_START_SYNC. [1]:

Re: [RFC PATCH] Btrfs: change ioctl number of BTRFS_IOC_START_SYNC to 21

2013-11-06 Thread Stefan Behrens
On Wed, 6 Nov 2013 17:01:19 +0800, Liu Bo wrote: 24 has been assigned to both BTRFS_IOC_START_SYNC and BTRFS_IOC_SUBVOL_CREATE_V2, and BTRFS_IOC_SUBVOL_CREATE_V2 is at least used in btrfs-progs while BTRFS_IOC_START_SYNC is not. 21 is free according to link[1], and seems safe to be

[PATCH] Btrfs-progs: set return value to 0 if subvolume get-default successfully

2013-11-06 Thread Eryu Guan
cmd_subvol_get_default() returns 1 even if finds default subvolume successfully. Set the correct return value. Signed-off-by: Eryu Guan guane...@gmail.com --- cmds-subvolume.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index f7249f8..8be6df7 100644

Re: [PATCH v6] Btrfs: fix memory leak of orphan block rsv

2013-11-06 Thread Filipe David Manana
On Mon, Nov 4, 2013 at 12:16 PM, Alex Lyakas alex.bt...@zadarastorage.com wrote: Hi Filipe, any luck with this patch?:) Hey Alex, I haven't digged further, but I remember I couldn't reproduce your issue (with latest btrfs-next of that day) of getting the free space inodes created even when

Re: csum failure messages

2013-11-06 Thread Duncan
John Williams posted on Tue, 05 Nov 2013 16:20:58 -0800 as excerpted: Is there now a verification test that could detect an issue like this? It seems like the sort of thing that needs to be added to automated testing. [Your question is general enough, not mentioning xfs-tests, simply asking

Re: 3.11.5 kernel infinite loop

2013-11-06 Thread Duncan
Russell Coker posted on Wed, 06 Nov 2013 12:52:38 +1100 as excerpted: I have a system running the Debian package of 3.11.5 with an Amd Opteron 1212 processor (2*64bit cores), 8G of RAM, and an Intel 120G SSD for the root and home subvols. It has a RAID-1 array of 2*3TB disks for bulk storage

[PATCH] Btrfs: don't wait for ordered data outside desired range

2013-11-06 Thread Filipe David Borba Manana
In btrfs_wait_ordered_range(), if we found an extent to the left of the start of our desired wait range and the last byte of that extent is 1 less than the desired range's start, we would would wait for the IO completion of that extent unnecessarily. Signed-off-by: Filipe David Borba Manana

Re: csum failure messages

2013-11-06 Thread David Sterba
On Tue, Nov 05, 2013 at 04:20:58PM -0800, John Williams wrote: Is there now a verification test that could detect an issue like this? It seems like the sort of thing that needs to be added to automated testing. Yes there is: xfstests/btrfs/013 https://bugzilla.kernel.org/show_bug.cgi?id=63411

Re: [PATCH 00/13] [PATCH 00/13] sysfs publishing patchset (v2)

2013-11-06 Thread David Sterba
On Fri, Nov 01, 2013 at 01:06:54PM -0400, Jeff Mahoney wrote: v2: An earlier version had a chunk intended for fs/btrfs/extent-tree.c added as part of patch 13 instead of patch 10, causing build failures. fsid/devices/sdc1 fsid/devices/sdd1 fsid/label fsid/allocation/data/flags ...

Re: [PATCH 00/13] [PATCH 00/13] sysfs publishing patchset (v2)

2013-11-06 Thread David Sterba
On Wed, Nov 06, 2013 at 06:02:26PM +0100, David Sterba wrote: How is the mixed blockgroup setup presented? I guess that the values from used_bytes, total_bytes etc would be the same for data and metadata and the flags would denote that it's mixed. Found, patch [10/13], it's 'mixed', no

Re: [PATCH 00/13] [PATCH 00/13] sysfs publishing patchset (v2)

2013-11-06 Thread Jeff Mahoney
On 11/6/13, 12:02 PM, David Sterba wrote: On Fri, Nov 01, 2013 at 01:06:54PM -0400, Jeff Mahoney wrote: v2: An earlier version had a chunk intended for fs/btrfs/extent-tree.c added as part of patch 13 instead of patch 10, causing build failures. fsid/devices/sdc1 fsid/devices/sdd1

Re: [RFC PATCH] Btrfs: change ioctl number of BTRFS_IOC_START_SYNC to 21

2013-11-06 Thread David Sterba
On Wed, Nov 06, 2013 at 10:42:35AM +0100, Stefan Behrens wrote: Sharing the ioctl value seems to have happened by mistake and is uncommon, but IMHO now it's too late to change this interface just for esthetical reasons. Agreed, it's part of ABI, ioctl.h is append only. -- To unsubscribe from

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-06 Thread Jan Schmidt
On Mon, November 04, 2013 at 18:42 (+0100), Josef Bacik wrote: On Thu, Oct 24, 2013 at 03:22:06PM +0200, Jan Schmidt wrote: btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup tracking is based on delayed refs. The owner of a tree block is set when a tree block is

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-06 Thread Josef Bacik
On Wed, Nov 06, 2013 at 06:20:47PM +0100, Jan Schmidt wrote: On Mon, November 04, 2013 at 18:42 (+0100), Josef Bacik wrote: On Thu, Oct 24, 2013 at 03:22:06PM +0200, Jan Schmidt wrote: btrfs_dec_ref() queued a delayed ref for owner of a tree block. The qgroup tracking is based on delayed

Re: [PATCH] btrfs:check-integrity.c: replace kmalloc with kmalloc_array

2013-11-06 Thread David Sterba
On Fri, Nov 01, 2013 at 06:16:00AM +0530, Himangi Saraogi wrote: This patch replaces kmalloc(size * nr, ) with kmalloc_array(nr, size) as kmalloc_array() is preferred because it can check that the calculation doesn't wrap and won't return a smaller allocation. Can you please convert all the

Re: [PATCH v3] xfstests: add regression test for running btrfs balance and defrag concurrently

2013-11-06 Thread David Sterba
On Thu, Oct 31, 2013 at 05:34:22PM +0800, Liu Bo wrote: The test aims to trigger snapshot-aware defrag path in write endio by running balance, which is not expected and leads to a crash. Signed-off-by: Liu Bo bo.li@oracle.com Reviewed-by: David Sterba dste...@suse.cz -- To unsubscribe

Re: [PATCH 2/4 v2] btrfs-progs: mechanism to fetch fsinfo from btrfs-control

2013-11-06 Thread Josef Bacik
On Mon, Nov 04, 2013 at 11:45:43AM +0800, Anand Jain wrote: need fsinfo from btrfs-control that is when mount path is not known. current method of going through each mount points isn't efficient, and multiple subvol of a fsid could be mounted means extra logic to handle that. Further this

Re: [PATCH 3/4 v2] btrfs-progs: fs show should handle if subvol(s) mounted

2013-11-06 Thread Josef Bacik
On Mon, Nov 04, 2013 at 11:45:44AM +0800, Anand Jain wrote: as of now with out this patch user would see fsinfo per btrfs mount path but which mean multiple entry if more than one subvol is mounted of the same fsid. so this patch will handle that nicely. v2: accepts Zach suggested

Re: [PATCH 4/4] btrfs-progs: lblkid wouldn't find non mapper path input

2013-11-06 Thread Josef Bacik
On Mon, Nov 04, 2013 at 11:45:45AM +0800, Anand Jain wrote: A new test case when disk is unmounted and if the non mapper disk path is given as the argument to the btrfs filesystem show arg we still need this to work but lblkid will pull only mapper disks, it won't match. So this will normalize

[PATCH v2] btrfs:check-integrity.c: replace kmalloc with kmalloc_array and kzalloc with kzalloc_array.

2013-11-06 Thread Himangi Saraogi
This patch replaces kmalloc(size * nr, ) with kmalloc_array(nr, size) as kmalloc_array() is preferred because it can check that the calculation doesn't wrap and won't return a smaller allocation. Also kzalloc(size * nr) was replaced with kzalloc_array(). Signed-off-by: Himangi Saraogi

Fwd: unable to delete files after kernel upgrade from 3.8.10 to 3.12

2013-11-06 Thread Bartosz Kulicki
Hi, As per subject. Seems UUID tree creation failed after upgrade. I could not mount filesystem under 3.12. Going back to 3.8.10 allowed me to mount fs but I could no longer perform any deletes, writes etc. I've opened a bug report here. https://bugzilla.kernel.org/show_bug.cgi?id=64461 I've

[PATCH 01/16] btrfs-progs: fix potential double-frees in cmd_subvol_delete()

2013-11-06 Thread Eric Sandeen
If we goto again in cmd_subvol_delete(), and error out to out: before re-allocating the dupdname and dupvname pointers, we'll double-free them. Set them to NULL after freeing to avoid this. Resolves-Coverity-CID: 1125944 Resolves-Coverity-CID: 1125945 Signed-off-by: Eric Sandeen

[PATCH 03/16] btrfs-progs: use strncpy in btrfs_scan_lblkid()

2013-11-06 Thread Eric Sandeen
Use strncpy(... ,PATH_MAX) to be sure we don't overflow the path[PATH_MAX] array. Resolves-Coverity-CID: 1125941 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/utils.c b/utils.c index a7441c1..c11a7c2 100644

[PATCH 00/16] btrfs-progs: Several more static analysis defect fixes

2013-11-06 Thread Eric Sandeen
These all apply to the integration branch in Chris's current git tree. (Which saw the defects rise by from 55 to 65 in the last l6 commits :() This beats back the defect count again. Compile tested only, FWIW. Thanks, -Eric -- To unsubscribe from this list: send the line unsubscribe

[PATCH 02/16] btrfs-progs: fix error returns in get_df()

2013-11-06 Thread Eric Sandeen
get_df returns -ERRNO, or maybe (+)errno, or even 0 in the case where we inexplicably got 0 total_spaces from the BTRFS_IOC_SPACE_INFO. Consistently return a negative error number, and return -ENOENT rather than 0 for total_spaces == 0, so that the caller will know that **sargs_ret hasn't been

[PATCH 09/16] btrfs-progs: btrfs_scan_kernel(): fd==0 is not an error

2013-11-06 Thread Eric Sandeen
The error return from open is -1, so test that, not 0, for success/failure. Resolves-Coverity-CID: 1125931 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-filesystem.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index

[PATCH 13/16] btrfs-progs: check btrfs_scan_one_device in btrfs_scan_lblkid()

2013-11-06 Thread Eric Sandeen
Even if it's definitely btrfs at this point, btrfs_scan_one_device could fail for other reasons. Check the return value, warn if it fails, and skip the device register. Resolves-Coverity-CID: 1125925 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |9 - 1 files changed, 8

[PATCH 15/16] btrfs-progs: annotate fallthroughs in parse_size

2013-11-06 Thread Eric Sandeen
We intentionally fall through these case statements; just annotate it to be clear. Resolves-Coverity-CID: 1054887 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/utils.c b/utils.c index ecacc29..9aeb5f8

[PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

2013-11-06 Thread Eric Sandeen
In the nothing to resume case we return directly and leak several bits of memory; goto out to free them properly. Resolves-Coverity-CID: 1125934 Resolves-Coverity-CID: 1125935 Resolves-Coverity-CID: 1125936 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-scrub.c |3 ++- 1 files

[PATCH 12/16] btrfs-progs: remove more dead code from check_extent_refs

2013-11-06 Thread Eric Sandeen
e0a04278 removed a bunch of dead code but left one little bit; reinit is always 0, so btrfs_read_block_groups is never called from here. Resolves-Coverity-CID: 1125926 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-check.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-)

[PATCH 11/16] btrfs-progs: pass positive errno to strerror in cmd_df()

2013-11-06 Thread Eric Sandeen
get_df returns a negative error number, but then we pass it to strerror, which wants a positive value... Resolves-Coverity-CID: 1125929 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-filesystem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmds-filesystem.c

[PATCH 16/16] btrfs-progs: annotate fallthroughs in parse_limit

2013-11-06 Thread Eric Sandeen
We intentionally fall through these case statements; just annotate it to be clear. Resolves-Coverity-CID: 1054884 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-qgroup.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/cmds-qgroup.c b/cmds-qgroup.c index

[PATCH 06/16] btrfs-progs: fix leak of buf in make_btrfs() error paths

2013-11-06 Thread Eric Sandeen
If any pwrite failed we leaked the allocated buf on return from the function. goto out takes care of those paths. Resolves-Coverity-CID: 1125938 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c | 62 -- 1 files changed, 32

[PATCH 05/16] btrfs-progs: don't leak fd in test_dev_for_mkfs() error paths

2013-11-06 Thread Eric Sandeen
Close fd before we return on error paths. Resolves-Coverity-CID: 1125939 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/utils.c b/utils.c index c11a7c2..c784345 100644 --- a/utils.c +++ b/utils.c @@ -1905,10

[PATCH 14/16] btrfs-progs: check for fstat failure in cmd_defrag

2013-11-06 Thread Eric Sandeen
Resolves-Coverity-CID: 1125924 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-filesystem.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index b1291d6..2cb067d 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c

[PATCH 04/16] btrfs-progs: fix test for return of realpath in find_mount_root()

2013-11-06 Thread Eric Sandeen
find_mount_root() tries to test for realpath() failure, but tests the wrong value. Fix it. Resolves-Coverity-CID: 1125940 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-send.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index

Re: [PATCH] Btrfs-progs: allow --init-extent-tree to work when extent tree is borked

2013-11-06 Thread Martin
On 28/10/13 15:11, Josef Bacik wrote: On Sun, Oct 27, 2013 at 12:16:12AM +0100, Martin wrote: On 25/10/13 19:31, Josef Bacik wrote: On Fri, Oct 25, 2013 at 07:27:24PM +0100, Martin wrote: On 25/10/13 19:01, Josef Bacik wrote: Unfortunately you can't run --init-extent-tree if you can't

Re: [PATCH] Btrfs: fix negative qgroup tracking from owner accounting (bug #61951)

2013-11-06 Thread Wang Shilong
On 11/07/2013 01:34 AM, Josef Bacik wrote: On Wed, Nov 06, 2013 at 06:20:47PM +0100, Jan Schmidt wrote: On Mon, November 04, 2013 at 18:42 (+0100), Josef Bacik wrote: On Thu, Oct 24, 2013 at 03:22:06PM +0200, Jan Schmidt wrote: btrfs_dec_ref() queued a delayed ref for owner of a tree block.

Re: [PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

2013-11-06 Thread Wang Shilong
Hi Eric, On 11/07/2013 07:15 AM, Eric Sandeen wrote: In the nothing to resume case we return directly and leak several bits of memory; goto out to free them properly. Resolves-Coverity-CID: 1125934 Resolves-Coverity-CID: 1125935 Resolves-Coverity-CID: 1125936 Signed-off-by: Eric Sandeen

Re: [PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

2013-11-06 Thread Wang Shilong
On 11/07/2013 09:48 AM, Wang Shilong wrote: Hi Eric, On 11/07/2013 07:15 AM, Eric Sandeen wrote: In the nothing to resume case we return directly and leak several bits of memory; goto out to free them properly. Resolves-Coverity-CID: 1125934 Resolves-Coverity-CID: 1125935

Re: [PATCH 02/16] btrfs-progs: fix error returns in get_df()

2013-11-06 Thread Anand Jain
I had just retained whats in the original. But this is good change. Thanks Eric. Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: get_df returns -ERRNO, or maybe (+)errno, or even 0 in the case where we inexplicably got 0 total_spaces from the

[PATCH] btrfs-progs: use strncpy in btrfs_scan_lblkid()

2013-11-06 Thread Anand Jain
From: Eric Sandeen sand...@redhat.com Use strncpy(... ,PATH_MAX) to be sure we don't overflow the path[PATH_MAX] array. Resolves-Coverity-CID: 1125941 Signed-off-by: Eric Sandeen sand...@redhat.com Signed-off-by: Anand Jain anand.j...@oracle.com --- utils.c |4 ++-- 1 files changed, 2

[PATCH] btrfs-progs: use /proc/self/mounts

2013-11-06 Thread Anand Jain
Signed-off-by: Anand Jain anand.j...@oracle.com --- cmds-send.c |2 +- utils.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmds-send.c b/cmds-send.c index 53e9a53..43ea06b 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -72,7 +72,7 @@ int find_mount_root(const

Re: [PATCH 04/16] btrfs-progs: fix test for return of realpath in find_mount_root()

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: find_mount_root() tries to test for realpath() failure, but tests the wrong value. Fix it. Resolves-Coverity-CID: 1125940 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-send.c |2 +- 1

Re: [PATCH 05/16] btrfs-progs: don't leak fd in test_dev_for_mkfs() error paths

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: Close fd before we return on error paths. Resolves-Coverity-CID: 1125939 Signed-off-by: Eric Sandeen sand...@redhat.com --- utils.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff

Re: [PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

2013-11-06 Thread Eric Sandeen
On 11/6/13, 7:50 PM, Wang Shilong wrote: On 11/07/2013 09:48 AM, Wang Shilong wrote: Hi Eric, On 11/07/2013 07:15 AM, Eric Sandeen wrote: In the nothing to resume case we return directly and leak several bits of memory; goto out to free them properly. Resolves-Coverity-CID: 1125934

Re: [PATCH 09/16] btrfs-progs: btrfs_scan_kernel(): fd==0 is not an error

2013-11-06 Thread Anand Jain
Reviewed-by: Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: The error return from open is -1, so test that, not 0, for success/failure. Resolves-Coverity-CID: 1125931 Signed-off-by: Eric Sandeen sand...@redhat.com --- cmds-filesystem.c |4 ++-- 1 files

Re: [PATCH 11/16] btrfs-progs: pass positive errno to strerror in cmd_df()

2013-11-06 Thread Anand Jain
Reviewed-by Anand Jain anand.j...@oracle.com On 11/07/2013 07:15 AM, Eric Sandeen wrote: get_df returns a negative error number, but then we pass it to strerror, which wants a positive value... Resolves-Coverity-CID: 1125929 Signed-off-by: Eric Sandeen sand...@redhat.com ---

Re: [PATCH 08/16] btrfs-progs: fix resource leak in scrub_start()

2013-11-06 Thread Wang Shilong
On 11/07/2013 11:46 AM, Eric Sandeen wrote: On 11/6/13, 7:50 PM, Wang Shilong wrote: On 11/07/2013 09:48 AM, Wang Shilong wrote: Hi Eric, On 11/07/2013 07:15 AM, Eric Sandeen wrote: In the nothing to resume case we return directly and leak several bits of memory; goto out to free them

[PATCH v3 15/17] btrfs: Replace fs_info-qgroup_rescan_worker workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-qgroup_rescan_worker with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace qgroup_rescan_workers. --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/disk-io.c | 12

[PATCH v3 17/17] btrfs: Cleanup the old btrfs_worker.

2013-11-06 Thread Qu Wenruo
Since all the btrfs_worker is replaced with the newly created btrfs_workqueue, the old codes can be easily remove. Signed-off-by: Quwenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Reuse the old async-thred.[ch] files. --- fs/btrfs/async-thread.c | 703

[PATCH v3 16/17] btrfs: Replace fs_info-scrub_* workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-scrub_* with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace scrub_*. --- fs/btrfs/ctree.h | 6 ++-- fs/btrfs/scrub.c | 94

[PATCH v3 01/17] btrfs: Cleanup the unused struct async_sched.

2013-11-06 Thread Qu Wenruo
The struct async_sched is not used by any codes and can be removed. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None. v2-v3: None. --- fs/btrfs/volumes.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index

[PATCH v3 09/17] btrfs: Replace fs_info-endio_* workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-endio_* workqueues with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace endio_*. --- fs/btrfs/ctree.h| 12 +++--- fs/btrfs/disk-io.c | 110

[PATCH v3 13/17] btrfs: Replace fs_info-fixup_workers workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-fixup_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace fixup_workers. --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 10 +-

[PATCH v3 06/17] btrfs: Replace fs_info-delalloc_workers with btrfs_workqueue

2013-11-06 Thread Qu Wenruo
Much like the fs_info-workers, replace the fs_info-delalloc_workers use the same btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: None --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 14 ++ fs/btrfs/inode.c | 18

[PATCH v3 05/17] btrfs: Replace fs_info-workers with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Use the newly created btrfs_workqueue_struct to replace the original fs_info-workers Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: None --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 41 + fs/btrfs/super.c |

[PATCH v3 03/17] btrfs: Add high priority workqueue support for btrfs_workqueue_struct

2013-11-06 Thread Qu Wenruo
Add high priority workqueue, which added a new workqueue to btrfs_workqueue_struct. Whether using the high priority workqueue must be decided at initialization. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: None --- fs/btrfs/async-thread.c | 25

[PATCH v3 14/17] btrfs: Replace fs_info-delayed_workers workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-delayed_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: None --- fs/btrfs/ctree.h | 2 +- fs/btrfs/delayed-inode.c | 10 +- fs/btrfs/disk-io.c | 11 +--

[PATCH v3 08/17] btrfs: Replace fs_info-flush_workers with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-submit_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace submit_workers. --- fs/btrfs/ctree.h| 4 ++-- fs/btrfs/disk-io.c | 10

[PATCH v3 04/17] btrfs: Add threshold workqueue based on kernel workqueue

2013-11-06 Thread Qu Wenruo
The original btrfs_workers has thresholding functions to dynamically create or destroy kthreads. Though there is no such function in kernel workqueue because the worker is not created manually, we can still use the workqueue_set_max_active to simulated the behavior, mainly to achieve a better HDD

[PATCH v3 07/17] btrfs: Replace fs_info-submit_workers with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Much like the fs_info-workers, replace the fs_info-submit_workers use the same btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: None --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 22 +++--- fs/btrfs/super.c | 2 +-

[PATCH v3 00/17] Replace btrfs_workers with kernel workqueue based btrfs_workqueue_struct

2013-11-06 Thread Qu Wenruo
Add a new btrfs_workqueue_struct which use kernel workqueue to implement most of the original btrfs_workers, to replace btrfs_workers. With this patchset, redundant workqueue codes are replaced with kernel workqueue infrastructure, which not only reduces the code size but also the effort to

[PATCH v3 12/17] btrfs: Replace fs_info-readahead_workers workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-readahead_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace readahead_workers. --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 12 +---

[PATCH v3 10/17] btrfs: Replace fs_info-rmw_workers workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-rmw_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace rmw_workers. --- fs/btrfs/ctree.h | 2 +- fs/btrfs/disk-io.c | 12

[PATCH v3 11/17] btrfs: Replace fs_info-cache_workers workqueue with btrfs_workqueue.

2013-11-06 Thread Qu Wenruo
Replace the fs_info-cache_workers with the newly created btrfs_workqueue. Signed-off-by: Qu Wenruo quwen...@cn.fujitsu.com --- Changelog: v1-v2: None v2-v3: - Use the btrfs_workqueue_struct to replace caching_workers. --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/disk-io.c | 12

[PATCH v3 02/17] btrfs: Added btrfs_workqueue_struct implemented ordered execution based on kernel workqueue

2013-11-06 Thread Qu Wenruo
Use kernel workqueue to implement a new btrfs_workqueue_struct, which has the ordering execution feature like the btrfs_worker. The func is executed in a concurrency way, and the ordred_func/ordered_free is executed in the sequence them are queued after the corresponding func is done. The new