mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ceph: single workqueue for inode related works
We have three workqueue for inode works. Later patch will introduce one more work for inode. It's not good to introcuce more workqueue and add more 'struct work_struct' to 'struct ceph_inode_info'. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
parent
f2c7c76c5d
commit
1cf89a8dee
4 changed files with 74 additions and 97 deletions
|
@ -672,18 +672,12 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
|
|||
* The number of concurrent works can be high but they don't need
|
||||
* to be processed in parallel, limit concurrency.
|
||||
*/
|
||||
fsc->wb_wq = alloc_workqueue("ceph-writeback", 0, 1);
|
||||
if (!fsc->wb_wq)
|
||||
fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0);
|
||||
if (!fsc->inode_wq)
|
||||
goto fail_client;
|
||||
fsc->pg_inv_wq = alloc_workqueue("ceph-pg-invalid", 0, 1);
|
||||
if (!fsc->pg_inv_wq)
|
||||
goto fail_wb_wq;
|
||||
fsc->trunc_wq = alloc_workqueue("ceph-trunc", 0, 1);
|
||||
if (!fsc->trunc_wq)
|
||||
goto fail_pg_inv_wq;
|
||||
fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1);
|
||||
if (!fsc->cap_wq)
|
||||
goto fail_trunc_wq;
|
||||
goto fail_inode_wq;
|
||||
|
||||
/* set up mempools */
|
||||
err = -ENOMEM;
|
||||
|
@ -697,12 +691,8 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
|
|||
|
||||
fail_cap_wq:
|
||||
destroy_workqueue(fsc->cap_wq);
|
||||
fail_trunc_wq:
|
||||
destroy_workqueue(fsc->trunc_wq);
|
||||
fail_pg_inv_wq:
|
||||
destroy_workqueue(fsc->pg_inv_wq);
|
||||
fail_wb_wq:
|
||||
destroy_workqueue(fsc->wb_wq);
|
||||
fail_inode_wq:
|
||||
destroy_workqueue(fsc->inode_wq);
|
||||
fail_client:
|
||||
ceph_destroy_client(fsc->client);
|
||||
fail:
|
||||
|
@ -715,9 +705,7 @@ fail:
|
|||
|
||||
static void flush_fs_workqueues(struct ceph_fs_client *fsc)
|
||||
{
|
||||
flush_workqueue(fsc->wb_wq);
|
||||
flush_workqueue(fsc->pg_inv_wq);
|
||||
flush_workqueue(fsc->trunc_wq);
|
||||
flush_workqueue(fsc->inode_wq);
|
||||
flush_workqueue(fsc->cap_wq);
|
||||
}
|
||||
|
||||
|
@ -725,9 +713,7 @@ static void destroy_fs_client(struct ceph_fs_client *fsc)
|
|||
{
|
||||
dout("destroy_fs_client %p\n", fsc);
|
||||
|
||||
destroy_workqueue(fsc->wb_wq);
|
||||
destroy_workqueue(fsc->pg_inv_wq);
|
||||
destroy_workqueue(fsc->trunc_wq);
|
||||
destroy_workqueue(fsc->inode_wq);
|
||||
destroy_workqueue(fsc->cap_wq);
|
||||
|
||||
mempool_destroy(fsc->wb_pagevec_pool);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue