kernel code not working
I wrote small code in read_write.c in linux-18.104.22.168/fs/. I am trying to retrieve entire path of some file where read operation is being performed. I changed 'SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)' to call my function 'getEntirePath(file->f_dentry, path, &length)'.
The definition of getEntirePath is as follows:
This code takes the dentry *self as input parameter and should trace back the path up to '/'.
void getEntirePath(struct dentry *self, char *filePath, int *length)
if(i!=0 && stack[i]!='/')
}while(stack[i++]!='/' && i<MAX_PATH_DEPTH);
This code hangs as soon as I enable it through a driver. Also I want to know from which function I should call this code for getting the entire path of file being read/written? I called it from vfs_write/vfs_read, do_sync_write/do_sync_read, but the function is not getting called each time some file is read/wrote.
Thanks for help.
Someone please answer, my project is stuck due to this.