Commit 97dba0eb authored by Pavel Emelyanov's avatar Pavel Emelyanov

fd: Fast path post open

Check for post_open callback presense before any other checks.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 84d1ffb9
...@@ -329,15 +329,16 @@ static int post_open_fd(int pid, FdinfoEntry *fe, struct file_desc *d) ...@@ -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;
......
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