Commit de27a7c6 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Andrei Vagin

unix: Move post_open_unix_sk() to open_unixsk_standalone() and rename it

Since this function is used by standalone sockets only,
we move it to appropriate place. No functional changes.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 8377abeb
...@@ -1088,7 +1088,7 @@ err: ...@@ -1088,7 +1088,7 @@ err:
return -1; return -1;
} }
static int post_open_unix_sk(struct file_desc *d, int fd) static int post_open_standalone(struct file_desc *d, int fd)
{ {
struct unix_sk_info *ui; struct unix_sk_info *ui;
struct unix_sk_info *peer; struct unix_sk_info *peer;
...@@ -1308,10 +1308,14 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui, int *new_fd) ...@@ -1308,10 +1308,14 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui, int *new_fd)
static int open_unixsk_standalone(struct unix_sk_info *ui, int *new_fd) static int open_unixsk_standalone(struct unix_sk_info *ui, int *new_fd)
{ {
struct fdinfo_list_entry *fle;
int sk; int sk;
pr_info("Opening standalone socket (id %#x ino %#x peer %#x)\n", pr_info("Opening standalone socket (id %#x ino %#x peer %#x)\n",
ui->ue->id, ui->ue->ino, ui->ue->peer); ui->ue->id, ui->ue->ino, ui->ue->peer);
fle = file_master(&ui->d);
if (fle->stage == FLE_OPEN)
return post_open_standalone(&ui->d, fle->fe->fd);
if (set_netns(ui->ue->ns_id)) if (set_netns(ui->ue->ns_id))
return -1; return -1;
...@@ -1459,7 +1463,6 @@ out: ...@@ -1459,7 +1463,6 @@ out:
static int open_unix_sk(struct file_desc *d, int *new_fd) static int open_unix_sk(struct file_desc *d, int *new_fd)
{ {
struct fdinfo_list_entry *fle;
struct unix_sk_info *ui; struct unix_sk_info *ui;
int ret; int ret;
...@@ -1471,10 +1474,6 @@ static int open_unix_sk(struct file_desc *d, int *new_fd) ...@@ -1471,10 +1474,6 @@ static int open_unix_sk(struct file_desc *d, int *new_fd)
return 1; return 1;
} }
fle = file_master(d);
if (fle->stage >= FLE_OPEN)
return post_open_unix_sk(d, fle->fe->fd);
if (inherited_fd(d, new_fd)) { if (inherited_fd(d, new_fd)) {
ui->ue->uflags |= USK_INHERIT; ui->ue->uflags |= USK_INHERIT;
ret = *new_fd >= 0 ? 0 : -1; ret = *new_fd >= 0 ? 0 : -1;
......
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