diff options
| author | Tejun Heo <[email protected]> | 2011-11-21 20:32:22 +0000 |
|---|---|---|
| committer | Tejun Heo <[email protected]> | 2011-11-21 20:32:22 +0000 |
| commit | a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6 (patch) | |
| tree | 0b763388360a5a9043986e1f2201e43df74ebc46 /fs/btrfs/async-thread.c | |
| parent | freezer: don't unnecessarily set PF_NOFREEZE explicitly (diff) | |
| download | kernel-a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6.tar.gz kernel-a0acae0e886d44bd5ce6d2f173c1ace0fcf0d9f6.zip | |
freezer: unexport refrigerator() and update try_to_freeze() slightly
There is no reason to export two functions for entering the
refrigerator. Calling refrigerator() instead of try_to_freeze()
doesn't save anything noticeable or removes any race condition.
* Rename refrigerator() to __refrigerator() and make it return bool
indicating whether it scheduled out for freezing.
* Update try_to_freeze() to return bool and relay the return value of
__refrigerator() if freezing().
* Convert all refrigerator() users to try_to_freeze().
* Update documentation accordingly.
* While at it, add might_sleep() to try_to_freeze().
Signed-off-by: Tejun Heo <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Cc: Steven Whitehouse <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: KONISHI Ryusuke <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Diffstat (limited to 'fs/btrfs/async-thread.c')
| -rw-r--r-- | fs/btrfs/async-thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 7ec14097fef1..98ab240072e5 100644 --- a/fs/btrfs/async-thread.c +++ b/fs/btrfs/async-thread.c @@ -340,7 +340,7 @@ again: if (freezing(current)) { worker->working = 0; spin_unlock_irq(&worker->lock); - refrigerator(); + try_to_freeze(); } else { spin_unlock_irq(&worker->lock); if (!kthread_should_stop()) { |
