Commit b6b2290f authored by Laurent Dufour's avatar Laurent Dufour Committed by Andrei Vagin

parasite: simplify syscall check

In is_required_syscall() req_sysnr is set according to the native mode
so we can check the syscall number directly against it.

No functional change expected.

Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
Reviewed-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent bbf29e89
...@@ -1049,12 +1049,8 @@ static inline int is_required_syscall(user_regs_struct_t *regs, pid_t pid, ...@@ -1049,12 +1049,8 @@ static inline int is_required_syscall(user_regs_struct_t *regs, pid_t pid,
pr_debug("%d (%s) is going to execute the syscall %lu, required is %d\n", pr_debug("%d (%s) is going to execute the syscall %lu, required is %d\n",
pid, mode, REG_SYSCALL_NR(*regs), req_sysnr); pid, mode, REG_SYSCALL_NR(*regs), req_sysnr);
if (user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr))
return true;
if (!user_regs_native(regs) && (REG_SYSCALL_NR(*regs) == sys_nr_compat))
return true;
return false; return (REG_SYSCALL_NR(*regs) == req_sysnr);
} }
/* /*
* Trap tasks on the exit from the specified syscall * Trap tasks on the exit from the specified syscall
......
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