mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +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;
|
||||
|
||||
if (!d->ops->post_open)
|
||||
return 0;
|
||||
|
||||
fle = file_master(d);
|
||||
if ((fle->pid != pid) || (fe->fd != fle->fe->fd))
|
||||
return 0;
|
||||
|
||||
if (d->ops->post_open && d->ops->post_open(d, fle->fe->fd))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
return d->ops->post_open(d, fle->fe->fd);
|
||||
}
|
||||
|
||||
static int open_fd(int pid, FdinfoEntry *fe, struct file_desc *d)
|
||||
{
|
||||
int tmp;
|
||||
|
Reference in New Issue
Block a user