]> git.baikalelectronics.ru Git - kernel.git/commit
snapshot: Use pm_mutex for mutual exclusion
authorRafael J. Wysocki <rjw@sisk.pl>
Wed, 11 Jun 2008 20:09:45 +0000 (22:09 +0200)
committerAndi Kleen <andi@basil.nowhere.org>
Wed, 16 Jul 2008 21:27:03 +0000 (23:27 +0200)
commit72b0fd23e9bb4df10251c40118829ce312e9fec5
tree6b17e6d78f562825cc9fc26259f9e5d5f8e80087
parent39f3c33fe9c6d1c5406fe746133d67f2a2df7451
snapshot: Use pm_mutex for mutual exclusion

We can avoid taking the BKL in snapshot_ioctl() if pm_mutex is used to prevent
the ioctls from being executed concurrently.

In addition, although it is only possible to open /dev/snapshot once, the task
which has done that may spawn a child that will inherit the open descriptor,
so in theory they can call snapshot_write(), snapshot_read() and
snapshot_release() concurrently.  pm_mutex can also be used for mutual
exclusion in such cases.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
kernel/power/user.c