fd 不是唯一的,只是进程打开文件的index. 利用current->files + fd 可获得文件名
{
struct file *ftmp = NULL;
struct fdtable *fdt = NULL;
fdt = (struct fdtable *)files_fdtable(current->files);
ftmp = fdt->fd[fd];
if ((ftmp->f_path.dentry != NULL) &&
(ftmp->f_path.dentry->d_iname != NULL)) {
printk("p %s\n", ftmp->f_path.dentry->d_iname);
}
}