Re: Path Name to kdev_t

From: Gianni Tedesco (gianni@ecsc.co.uk)
Date: Thu Nov 14 2002 - 10:20:55 EST


On Thu, 2002-11-14 at 13:49, chandrasekhar.nagaraj wrote:
> In one of the part of my driver module , I have a path name to a device file
> (for eg:- /dev/hda1) .Now if I want to obtain the associated major number
> and minor number i.e. device ID(kdev_t) of this file what would be the
> procedure?

You need to lookup the inode from the path using namei() or something
then it's just a field in the inode.

Check out fs/namei.c and related headers for more details.

-- 
// Gianni Tedesco (gianni at ecsc dot co dot uk)
lynx --source www.scaramanga.co.uk/gianni-at-ecsc.asc | gpg --import
8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 15 2002 - 22:00:32 EST