提交 83c67571 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

TTY: tty_io, annotate locking functions

tty_write_lock and tty_write_unlock contain imbalanced locking. But
this is intentional, so mark them appropriately by
__acquires/__releases.
Signed-off-by: NJiri Slaby <jslaby@suse.cz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c831cff2
...@@ -962,12 +962,14 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, ...@@ -962,12 +962,14 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
} }
void tty_write_unlock(struct tty_struct *tty) void tty_write_unlock(struct tty_struct *tty)
__releases(&tty->atomic_write_lock)
{ {
mutex_unlock(&tty->atomic_write_lock); mutex_unlock(&tty->atomic_write_lock);
wake_up_interruptible_poll(&tty->write_wait, POLLOUT); wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
} }
int tty_write_lock(struct tty_struct *tty, int ndelay) int tty_write_lock(struct tty_struct *tty, int ndelay)
__acquires(&tty->atomic_write_lock)
{ {
if (!mutex_trylock(&tty->atomic_write_lock)) { if (!mutex_trylock(&tty->atomic_write_lock)) {
if (ndelay) if (ndelay)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册