Commit 107f2e40 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

files: Kill autofs_create_fle() and use generic helper

On 01.06.2017 14:34, Kirill Tkhai wrote:
> Everything is prepared: the pair "type and id" is
> uniqul, so find_file_desc() in collect_fd() will
> work as expected and it will find the file_desc
> we just added in autofs_create_pipe()->collect_one_pipe_ops().
>
> So, the not-generic helper may be killed.
>
> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

Returned debug print:

[PATCH 4/5 v2]files: Kill autofs_create_fle() and use generic helper

Everything is prepared: the pair "type and id" is
uniqul, so find_file_desc() in collect_fd() will
work as expected and it will find the file_desc
we just added in autofs_create_pipe()->collect_one_pipe_ops().

So, the not-generic helper may be killed.

v2: Leave debug print on the place.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Acked-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 94018781
...@@ -859,28 +859,6 @@ static struct fdinfo_list_entry *autofs_pipe_le(struct pstree_item *master, ...@@ -859,28 +859,6 @@ static struct fdinfo_list_entry *autofs_pipe_le(struct pstree_item *master,
return ple; return ple;
} }
static int autofs_create_fle(struct pstree_item *task, FdinfoEntry *fe,
struct file_desc *desc)
{
struct fdinfo_list_entry *le;
struct rst_info *rst_info = rsti(task);
le = shmalloc(sizeof(*le));
if (!le)
return -1;
fle_init(le, vpid(task), fe);
collect_task_fd(le, rst_info);
list_add_tail(&le->desc_list, &desc->fd_info_head);
le->desc = desc;
pr_info("autofs: added pipe fd %d, flags %#x to %d (with post_open)\n",
le->fe->fd, le->fe->flags, le->pid);
return 0;
}
static int autofs_open_pipefd(struct file_desc *d, int *new_fd) static int autofs_open_pipefd(struct file_desc *d, int *new_fd)
{ {
struct fdinfo_list_entry *fle = file_master(d); struct fdinfo_list_entry *fle = file_master(d);
...@@ -933,7 +911,9 @@ static int autofs_create_pipe(struct pstree_item *task, autofs_info_t *i, ...@@ -933,7 +911,9 @@ static int autofs_create_pipe(struct pstree_item *task, autofs_info_t *i,
if (!fe) if (!fe)
return -1; return -1;
return autofs_create_fle(task, fe, &i->pi.d); pr_info("autofs: adding pipe fd %d, flags %#x to %d (with post_open)\n",
fe->fd, fe->flags, vpid(task));
return collect_fd(vpid(task), fe, rsti(task));
} }
static int autofs_add_mount_info(struct pprep_head *ph) static int autofs_add_mount_info(struct pprep_head *ph)
......
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