]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/async-thread.h
btrfs: Added btrfs_workqueue_struct implemented ordered execution based on kernel...
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 28 Feb 2014 02:46:03 +0000 (10:46 +0800)
committerJosef Bacik <jbacik@fb.com>
Mon, 10 Mar 2014 19:17:03 +0000 (15:17 -0400)
commit08a9ff3264181986d1d692a4e6fce3669700c9f8
tree04597c6b7b48a233a4acbcc86f017f862f123374
parentf5961d41d7575faa6e2905daa08650aa388ba9d0
btrfs: Added btrfs_workqueue_struct implemented ordered execution based on kernel workqueue

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 btrfs_workqueue works much like the original one, one workqueue
for normal work and a list for ordered work.
When a work is queued, ordered work will be added to the list and helper
function will be queued into the workqueue.
The helper function will execute a normal work and then check and execute as many
ordered work as possible in the sequence they were queued.

At this patch, high priority work queue or thresholding is not added yet.
The high priority feature and thresholding will be added in the following patches.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Tested-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fb.com>
fs/btrfs/async-thread.c
fs/btrfs/async-thread.h