mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
autofs: Add FD_TYPES__AUTOFS_PIPE type
Add a fake fd type for autofs. This allows functions like find_file_desc() work as expected, without having two different file_desc with the same type and same id. Also, later, it will allow to delete autofs_create_fle() and to use generic helper. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
522d9c7180
commit
2c2a253354
@@ -892,6 +892,7 @@ static int autofs_create_pipe(struct pstree_item *task, autofs_info_t *i,
|
|||||||
return -1;
|
return -1;
|
||||||
memcpy(ops, pi->d.ops, sizeof(*ops));
|
memcpy(ops, pi->d.ops, sizeof(*ops));
|
||||||
ops->open = autofs_open_pipefd;
|
ops->open = autofs_open_pipefd;
|
||||||
|
ops->type = FD_TYPES__AUTOFS_PIPE;
|
||||||
|
|
||||||
pe = shmalloc(sizeof(*pe));
|
pe = shmalloc(sizeof(*pe));
|
||||||
if (!pe)
|
if (!pe)
|
||||||
@@ -910,6 +911,7 @@ static int autofs_create_pipe(struct pstree_item *task, autofs_info_t *i,
|
|||||||
fe = dup_fdinfo(ple->fe, fd, flags);
|
fe = dup_fdinfo(ple->fe, fd, flags);
|
||||||
if (!fe)
|
if (!fe)
|
||||||
return -1;
|
return -1;
|
||||||
|
fe->type = FD_TYPES__AUTOFS_PIPE;
|
||||||
|
|
||||||
pr_info("autofs: adding pipe fd %d, flags %#x to %d (with post_open)\n",
|
pr_info("autofs: adding pipe fd %d, flags %#x to %d (with post_open)\n",
|
||||||
fe->fd, fe->flags, vpid(task));
|
fe->fd, fe->flags, vpid(task));
|
||||||
|
@@ -36,6 +36,9 @@ enum fd_types {
|
|||||||
TUNF = 15;
|
TUNF = 15;
|
||||||
EXT = 16;
|
EXT = 16;
|
||||||
TIMERFD = 17;
|
TIMERFD = 17;
|
||||||
|
|
||||||
|
/* Any number above the real used. Not stored to image */
|
||||||
|
AUTOFS_PIPE = 65535;
|
||||||
}
|
}
|
||||||
|
|
||||||
message fdinfo_entry {
|
message fdinfo_entry {
|
||||||
|
Reference in New Issue
Block a user