Commit 74a87aba authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

tty: Optimize dependencies check

Iterate over currently unrestored files only.

v4: New
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent e98c96ed
...@@ -1099,12 +1099,12 @@ static int open_ext_tty(struct tty_info *info) ...@@ -1099,12 +1099,12 @@ static int open_ext_tty(struct tty_info *info)
static bool tty_deps_restored(struct tty_info *info) static bool tty_deps_restored(struct tty_info *info)
{ {
struct list_head *list = &rsti(current)->used; struct list_head *list = &rsti(current)->fds;
struct fdinfo_list_entry *fle; struct fdinfo_list_entry *fle;
struct tty_info *tmp; struct tty_info *tmp;
if (info->driver->type == TTY_TYPE__CTTY) { if (info->driver->type == TTY_TYPE__CTTY) {
list_for_each_entry(fle, list, used_list) { list_for_each_entry(fle, list, ps_list) {
if (fle->desc->ops->type != FD_TYPES__TTY || fle->desc == &info->d) if (fle->desc->ops->type != FD_TYPES__TTY || fle->desc == &info->d)
continue; continue;
...@@ -1113,7 +1113,7 @@ static bool tty_deps_restored(struct tty_info *info) ...@@ -1113,7 +1113,7 @@ static bool tty_deps_restored(struct tty_info *info)
return false; return false;
} }
} else if (!tty_is_master(info)) { } else if (!tty_is_master(info)) {
list_for_each_entry(fle, list, used_list) { list_for_each_entry(fle, list, ps_list) {
if (fle->desc->ops->type != FD_TYPES__TTY || fle->desc == &info->d) if (fle->desc->ops->type != FD_TYPES__TTY || fle->desc == &info->d)
continue; continue;
tmp = container_of(fle->desc, struct tty_info, d); tmp = container_of(fle->desc, struct tty_info, d);
......
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