Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 316873c9 authored by Tejun Heo's avatar Tejun Heo
Browse files

ocfs2: use system_wq instead of ocfs2_quota_wq



ocfs2_quota_wq is not depended upon during memory reclaim and, with
cmwq, there's no reason to use a dedicated workqueue.  Drop
ocfs2_quota_wq and use system_wq instead.  dqi_sync_work is already
sync canceled on quota disable and no further synchronization is
necessary.

This change makes ocfs2_quota_setup/shutdown() noops.  Both functions
removed.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
parent fd89d5f2
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -114,7 +114,4 @@ int ocfs2_local_write_dquot(struct dquot *dquot);
extern const struct dquot_operations ocfs2_quota_operations;
extern struct quota_format_type ocfs2_quota_format;

int ocfs2_quota_setup(void);
void ocfs2_quota_shutdown(void);

#endif /* _OCFS2_QUOTA_H */
+4 −23
Original line number Diff line number Diff line
@@ -63,8 +63,6 @@
 *        write to gf
 */

static struct workqueue_struct *ocfs2_quota_wq = NULL;

static void qsync_work_fn(struct work_struct *work);

static void ocfs2_global_disk2memdqb(struct dquot *dquot, void *dp)
@@ -400,7 +398,7 @@ int ocfs2_global_read_info(struct super_block *sb, int type)
						OCFS2_QBLK_RESERVED_SPACE;
	oinfo->dqi_gi.dqi_qtree_depth = qtree_depth(&oinfo->dqi_gi);
	INIT_DELAYED_WORK(&oinfo->dqi_sync_work, qsync_work_fn);
	queue_delayed_work(ocfs2_quota_wq, &oinfo->dqi_sync_work,
	schedule_delayed_work(&oinfo->dqi_sync_work,
			      msecs_to_jiffies(oinfo->dqi_syncms));

out_err:
@@ -635,7 +633,7 @@ static void qsync_work_fn(struct work_struct *work)
	struct super_block *sb = oinfo->dqi_gqinode->i_sb;

	dquot_scan_active(sb, ocfs2_sync_dquot_helper, oinfo->dqi_type);
	queue_delayed_work(ocfs2_quota_wq, &oinfo->dqi_sync_work,
	schedule_delayed_work(&oinfo->dqi_sync_work,
			      msecs_to_jiffies(oinfo->dqi_syncms));
}

@@ -923,20 +921,3 @@ const struct dquot_operations ocfs2_quota_operations = {
	.alloc_dquot	= ocfs2_alloc_dquot,
	.destroy_dquot	= ocfs2_destroy_dquot,
};

int ocfs2_quota_setup(void)
{
	ocfs2_quota_wq = create_workqueue("o2quot");
	if (!ocfs2_quota_wq)
		return -ENOMEM;
	return 0;
}

void ocfs2_quota_shutdown(void)
{
	if (ocfs2_quota_wq) {
		flush_workqueue(ocfs2_quota_wq);
		destroy_workqueue(ocfs2_quota_wq);
		ocfs2_quota_wq = NULL;
	}
}
+0 −7
Original line number Diff line number Diff line
@@ -1645,16 +1645,11 @@ static int __init ocfs2_init(void)
		mlog(ML_ERROR, "Unable to create ocfs2 debugfs root.\n");
	}

	status = ocfs2_quota_setup();
	if (status)
		goto leave;

	ocfs2_set_locking_protocol();

	status = register_quota_format(&ocfs2_quota_format);
leave:
	if (status < 0) {
		ocfs2_quota_shutdown();
		ocfs2_free_mem_caches();
		exit_ocfs2_uptodate_cache();
	}
@@ -1671,8 +1666,6 @@ static void __exit ocfs2_exit(void)
{
	mlog_entry_void();

	ocfs2_quota_shutdown();

	if (ocfs2_wq) {
		flush_workqueue(ocfs2_wq);
		destroy_workqueue(ocfs2_wq);