I'm currently trying to get the inode for the given path in the kernel function. All I have is the full path. I tried trying:
user_path_at(AT_FDCWD, buffer, LOOKUP_FOLLOW, &path);
But the sword in this given path is invalid, it seems, it turns out. Then I thought I might have tried stat () and got the inode number. However, this gives me a number, not a struct inode. I don't know how to convert an inode index to an inode without grabbing the existing inode and going through the entire inodes list. And I don’t even know if this will work. But of course I do not want to do this.
Is there any simple way to get the structure index code from a char * path inside the kernel?
source
share