aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2017-11-29 14:21:33 -0800
committerLuis R. Rodriguez <mcgrof@kernel.org>2017-11-29 14:45:49 -0800
commit8052c3e66e84fd2d20bc8c9d79b31367fe3a4263 (patch)
treefb2a4540e130119d4169d1e15a4eaca2173b09ff
parentbc13c09ba3140111933ee5ed2165238eb80bb44b (diff)
downloadlinux-next-20171129-fs-freeze-cleanup.tar.gz
jfs: remove not needed freezing calls20171129-fs-freeze-cleanup
This removes superflous freezer calls as they are no longer needed as the VFS now performs filesystem freezing/thaw if the filesystem has support for it. The following Coccinelle rule was used as follows: spatch --sp-file fs-freeze-cleanup.cocci --in-place fs/$FS/ @ has_freeze_fs @ identifier super_ops; expression freeze_op; @@ struct super_operations super_ops = { .freeze_fs = freeze_op, }; @ remove_set_freezable depends on has_freeze_fs @ expression time; statement S, S2, S3; expression task; @@ ( - set_freezable(); | - if (try_to_freeze()) - continue; | - try_to_freeze(); | - freezable_schedule(); + schedule(); | - freezable_schedule_timeout(time); + schedule_timeout(time); | - if (freezing(task)) { S } | - if (freezing(task)) { S } - else { S2 } | - freezing(current) ) Generated-by: Coccinelle SmPL Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
-rw-r--r--fs/jfs/jfs_logmgr.c11
-rw-r--r--fs/jfs/jfs_txnmgr.c31
2 files changed, 12 insertions, 30 deletions
diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 0e5d412c0b01a4..fa5a95d8fba816 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -2344,14 +2344,9 @@ int jfsIOWait(void *arg)
spin_lock_irq(&log_redrive_lock);
}
- if (freezing(current)) {
- spin_unlock_irq(&log_redrive_lock);
- try_to_freeze();
- } else {
- set_current_state(TASK_INTERRUPTIBLE);
- spin_unlock_irq(&log_redrive_lock);
- schedule();
- }
+ set_current_state(TASK_INTERRUPTIBLE);
+ spin_unlock_irq(&log_redrive_lock);
+ schedule();
} while (!kthread_should_stop());
jfs_info("jfsIOWait being killed!");
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 4d973524c88799..a313300c4651cb 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2747,6 +2747,7 @@ int jfs_lazycommit(void *arg)
struct tblock *tblk;
unsigned long flags;
struct jfs_sb_info *sbi;
+ DECLARE_WAITQUEUE(wq, current);
do {
LAZY_LOCK(flags);
@@ -2793,19 +2794,11 @@ int jfs_lazycommit(void *arg)
}
/* In case a wakeup came while all threads were active */
jfs_commit_thread_waking = 0;
-
- if (freezing(current)) {
- LAZY_UNLOCK(flags);
- try_to_freeze();
- } else {
- DECLARE_WAITQUEUE(wq, current);
-
- add_wait_queue(&jfs_commit_thread_wait, &wq);
- set_current_state(TASK_INTERRUPTIBLE);
- LAZY_UNLOCK(flags);
- schedule();
- remove_wait_queue(&jfs_commit_thread_wait, &wq);
- }
+ add_wait_queue(&jfs_commit_thread_wait, &wq);
+ set_current_state(TASK_INTERRUPTIBLE);
+ LAZY_UNLOCK(flags);
+ schedule();
+ remove_wait_queue(&jfs_commit_thread_wait, &wq);
} while (!kthread_should_stop());
if (!list_empty(&TxAnchor.unlock_queue))
@@ -2982,15 +2975,9 @@ int jfs_sync(void *arg)
}
/* Add anon_list2 back to anon_list */
list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list);
-
- if (freezing(current)) {
- TXN_UNLOCK();
- try_to_freeze();
- } else {
- set_current_state(TASK_INTERRUPTIBLE);
- TXN_UNLOCK();
- schedule();
- }
+ set_current_state(TASK_INTERRUPTIBLE);
+ TXN_UNLOCK();
+ schedule();
} while (!kthread_should_stop());
jfs_info("jfs_sync being killed");