2
0
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:
Pavel Emelyanov
2012-09-11 22:07:21 +04:00
parent 84d1ffb986
commit 97dba0eb8f

View File

@@ -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;