How to obtain a pathname or dentry or struct file from a given inode?
问题 I need to know how to obtain a pathname or dentry or struct file from a given inode. I was using file_open to obtain struct file from a pathname but but always gave kernel panic. I need a way to compare an inode from my list of inodes with a inode from a pathname or compare all inodes in the disk to find corresponding pathnames, and then compare with my list of inodes. 回答1: This sample code will work well in Linux kernel version 2.6.xx struct dentry *sample_dentry = NULL; struct inode *tmp