From b7b43de8c7ffc07ad830aa8a36dc29b277ac5b8c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 8 Dec 2016 23:30:51 -0800 Subject: [PATCH] Queue trans work in our work queue We went to the trouble of allocating a work queue with one work in flight but then didn't use it. We could have concurrent trans write func execution. Signed-off-by: Zach Brown --- kmod/src/trans.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kmod/src/trans.c b/kmod/src/trans.c index ab3da53d..1e23295f 100644 --- a/kmod/src/trans.c +++ b/kmod/src/trans.c @@ -157,6 +157,11 @@ static int write_attempted(struct scoutfs_sb_info *sbi, return done; } +static void queue_trans_work(struct scoutfs_sb_info *sbi) +{ + queue_work(sbi->trans_write_workq, &sbi->trans_write_work); +} + /* * sync records the current dirty seq and write count and waits for * either to change. If there's nothing to write or the write returned @@ -170,7 +175,7 @@ int scoutfs_sync_fs(struct super_block *sb, int wait) int ret; if (!wait) { - schedule_work(&sbi->trans_write_work); + queue_trans_work(sbi); return 0; } @@ -179,7 +184,7 @@ int scoutfs_sync_fs(struct super_block *sb, int wait) attempt.count = sbi->trans_write_count; spin_unlock(&sbi->trans_write_lock); - schedule_work(&sbi->trans_write_work); + queue_trans_work(sbi); ret = wait_event_interruptible(sbi->trans_write_wq, write_attempted(sbi, &attempt));