i think there might be a way to use userspace syscalls inside the kernel but it's wastefull
better to use internal functions like
Code:
#include < linux/fs.h>
struct file *fp;
fp = filp_open("/some/file", O_RDONLY, 0);
filp_close(fp, NULL);
how to figure it out is look in fs/open.c at sys_open() to see how it's implemented and there you find
Code:
struct file *f = filp_open(tmp, flags, mode);
there you go
couldn't be easier