Re: file-id to device mapping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Raghu R. Arur wrote:
given a file descriptor of a file ( not a device file like /dev/hda but a normal file like /sbin/ifconfig which actually resides on the device) can we get the information about on which device it is stored.
You can use "fget (fd)" to return a "struct file" pointer.

In this "struct file" pointer, you can use the "struct vfsmount *f_vfsmnt" field with the "mntget" function to return the "struct vfsmount" that contains the device this file is in (char *mnt_devname), plus a lot more info about that device (check the "struct vfsmount" in include/linux/mount.h)

Kind Regards,

Felipe

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux