Could anyone provide the code to overcome this problem?
Effectively how do we obtain the struct inode*
from kernel level given the file /dev/driver1
?
Given in user space that:
int fd;
fd = open("/dev/driver1", O_RDWR | O_SYNC);
In Kernel space:
static long dev_ioctl(struct file *file, unsigned cmd, unsigned long arg)
struct dev_handle *handle;
handle = file->private_data;
Assuming that, we do not go by that path,
How do we obtain within the kernel itself, by eg. hard coding the file->private_data
to be given to handle?