public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gianni Tedesco <gianni@ecsc.co.uk>
To: chandrasekhar.nagaraj@patni.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Path Name to kdev_t
Date: 14 Nov 2002 15:20:55 +0000	[thread overview]
Message-ID: <1037287255.9317.30.camel@lemsip> (raw)
In-Reply-To: <000101c28be4$9ff1bf20$e9bba5cc@patni.com>

[-- Attachment #1: Type: text/plain, Size: 665 bytes --]

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

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2002-11-14 15:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-14 13:49 Path Name to kdev_t chandrasekhar.nagaraj
2002-11-14 15:20 ` Gianni Tedesco [this message]
2002-11-14 15:32 ` Steven Dake
2002-11-14 22:50 ` Irfan Hamid
2002-11-15 16:15 ` Joe Thornber
2002-11-15 16:28   ` Christoph Hellwig
2002-11-15 18:10   ` Alexander Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1037287255.9317.30.camel@lemsip \
    --to=gianni@ecsc.co.uk \
    --cc=chandrasekhar.nagaraj@patni.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox