mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-04 00:05:26 +00:00
fd: Fast path post open
Check for post_open callback presense before any other checks. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
9
files.c
9
files.c
@@ -329,15 +329,16 @@ static int post_open_fd(int pid, FdinfoEntry *fe, struct file_desc *d)
|
|||||||
{
|
{
|
||||||
struct fdinfo_list_entry *fle;
|
struct fdinfo_list_entry *fle;
|
||||||
|
|
||||||
|
if (!d->ops->post_open)
|
||||||
|
return 0;
|
||||||
|
|
||||||
fle = file_master(d);
|
fle = file_master(d);
|
||||||
if ((fle->pid != pid) || (fe->fd != fle->fe->fd))
|
if ((fle->pid != pid) || (fe->fd != fle->fe->fd))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (d->ops->post_open && d->ops->post_open(d, fle->fe->fd))
|
return d->ops->post_open(d, fle->fe->fd);
|
||||||
return -1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_fd(int pid, FdinfoEntry *fe, struct file_desc *d)
|
static int open_fd(int pid, FdinfoEntry *fe, struct file_desc *d)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
|
Reference in New Issue
Block a user