From mboxrd@z Thu Jan 1 00:00:00 1970 From: matwey.kornilov@gmail.com (Matwey V. Kornilov) Date: Sun, 10 Jul 2016 18:22:25 +0300 Subject: Proper way to get device file minor number from struct file Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hello, I am looking through some legacy out of tree custom linux kernel device driver. It is full of lines like the following: iminor(fp->f_dentry->d_inode) here struct file *fp is an argument of callback of struct file_operations. Documentation/filesystems/porting says: "f_dentry is gone; use f_path.dentry, or, better yet, see if you can avoid it entirely" So, is there a proper compatible way to do the same?