From 97dba0eb8f8146411637100d15e1c096836b6121 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 11 Sep 2012 22:07:21 +0400 Subject: [PATCH] fd: Fast path post open Check for post_open callback presense before any other checks. Signed-off-by: Pavel Emelyanov --- files.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/files.c b/files.c index a456a1290..606e13bac 100644 --- a/files.c +++ b/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;