再会。我试图从结构文件中获取完整路径
char *buf = (char*)__get_free_page(GFP_USER);
char *buf2 = (char*)__get_free_page(GFP_USER);
char *name = dentry_path(file->f_dentry, buf, PAGE_SIZE);
char *root = dentry_path(file->f_vfsmnt->mnt_mountpoint, buf2, PAGE_SIZE);
***some operations***
free_page((unsigned long)buf);
free_page((unsigned long)buf2);
kfree(*root);
kfree(*name);
但我收到一个错误 fs/read_write.c:707: error: request for member 'mnt_mountpoint' in something not a structure or union
如何从文件中获取 vsfmount 结构?
内核版本 linux-2.6.37.6