Commit e80a10ee authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

tty: Prefix tty_ldisc_{lock,lock_nested,unlock} functions

tty_ldisc_lock(), tty_ldisc_unlock(), and tty_ldisc_lock_nested()
are low-level aliases for the underlying lock mechanism. Rename
with double underscore to allow for new, higher level functions
with those names.
Reviewed-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52bce7f8
...@@ -308,19 +308,19 @@ EXPORT_SYMBOL_GPL(tty_ldisc_deref); ...@@ -308,19 +308,19 @@ EXPORT_SYMBOL_GPL(tty_ldisc_deref);
static inline int __lockfunc static inline int __lockfunc
tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout) __tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout)
{ {
return ldsem_down_write(&tty->ldisc_sem, timeout); return ldsem_down_write(&tty->ldisc_sem, timeout);
} }
static inline int __lockfunc static inline int __lockfunc
tty_ldisc_lock_nested(struct tty_struct *tty, unsigned long timeout) __tty_ldisc_lock_nested(struct tty_struct *tty, unsigned long timeout)
{ {
return ldsem_down_write_nested(&tty->ldisc_sem, return ldsem_down_write_nested(&tty->ldisc_sem,
LDISC_SEM_OTHER, timeout); LDISC_SEM_OTHER, timeout);
} }
static inline void tty_ldisc_unlock(struct tty_struct *tty) static inline void __tty_ldisc_unlock(struct tty_struct *tty)
{ {
return ldsem_up_write(&tty->ldisc_sem); return ldsem_up_write(&tty->ldisc_sem);
} }
...@@ -332,24 +332,24 @@ tty_ldisc_lock_pair_timeout(struct tty_struct *tty, struct tty_struct *tty2, ...@@ -332,24 +332,24 @@ tty_ldisc_lock_pair_timeout(struct tty_struct *tty, struct tty_struct *tty2,
int ret; int ret;
if (tty < tty2) { if (tty < tty2) {
ret = tty_ldisc_lock(tty, timeout); ret = __tty_ldisc_lock(tty, timeout);
if (ret) { if (ret) {
ret = tty_ldisc_lock_nested(tty2, timeout); ret = __tty_ldisc_lock_nested(tty2, timeout);
if (!ret) if (!ret)
tty_ldisc_unlock(tty); __tty_ldisc_unlock(tty);
} }
} else { } else {
/* if this is possible, it has lots of implications */ /* if this is possible, it has lots of implications */
WARN_ON_ONCE(tty == tty2); WARN_ON_ONCE(tty == tty2);
if (tty2 && tty != tty2) { if (tty2 && tty != tty2) {
ret = tty_ldisc_lock(tty2, timeout); ret = __tty_ldisc_lock(tty2, timeout);
if (ret) { if (ret) {
ret = tty_ldisc_lock_nested(tty, timeout); ret = __tty_ldisc_lock_nested(tty, timeout);
if (!ret) if (!ret)
tty_ldisc_unlock(tty2); __tty_ldisc_unlock(tty2);
} }
} else } else
ret = tty_ldisc_lock(tty, timeout); ret = __tty_ldisc_lock(tty, timeout);
} }
if (!ret) if (!ret)
...@@ -370,9 +370,9 @@ tty_ldisc_lock_pair(struct tty_struct *tty, struct tty_struct *tty2) ...@@ -370,9 +370,9 @@ tty_ldisc_lock_pair(struct tty_struct *tty, struct tty_struct *tty2)
static void __lockfunc tty_ldisc_unlock_pair(struct tty_struct *tty, static void __lockfunc tty_ldisc_unlock_pair(struct tty_struct *tty,
struct tty_struct *tty2) struct tty_struct *tty2)
{ {
tty_ldisc_unlock(tty); __tty_ldisc_unlock(tty);
if (tty2) if (tty2)
tty_ldisc_unlock(tty2); __tty_ldisc_unlock(tty2);
} }
static void __lockfunc tty_ldisc_enable_pair(struct tty_struct *tty, static void __lockfunc tty_ldisc_enable_pair(struct tty_struct *tty,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment