kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Get USB Device Class Type and Mount point
Date: Mon, 13 Feb 2012 07:02:19 -0800	[thread overview]
Message-ID: <20120213150219.GA7328@kroah.com> (raw)
In-Reply-To: <4F38FEC0.8050505@gmail.com>

On Mon, Feb 13, 2012 at 05:44:56PM +0530, Abhijit Pawar wrote:
> The  reason I went for kernel module is to get the device add
> notification. However once I get the notification, I can have
> netlink socket pass the device data to my user space application.

Like others pointed out, use libudev for this, that's the only way you
can properly do it.

> Here the tricky part is I can get the device info, but not able to
> figure out how can I get the mount path from this device.

Within the kernel you can not.  Think of namespaces, and all that fun
stuff, it will not work properly within the kernel.

Again, if you are using an encrypted filesystem, just use what Linux
provides for this today.  Is there something there that does not meet
your needs?

greg k-h

  parent reply	other threads:[~2012-02-13 15:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  6:10 Get USB Device Class Type and Mount point Abhijit Pawar
2012-02-09  6:22 ` Abhijit Pawar
2012-02-09 12:23 ` Greg KH
2012-02-09 13:48   ` Abhijit Pawar
2012-02-09 14:47     ` Greg KH
2012-02-10 13:49       ` Abhijit Pawar
2012-02-10 14:12         ` Greg KH
2012-02-13 12:14       ` Abhijit Pawar
2012-02-13 12:21         ` Mandeep Sandhu
2012-02-13 12:31           ` Abhijit Pawar
2012-02-13 15:02         ` Greg KH [this message]
2012-02-14 11:38           ` Abhijit Pawar

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=20120213150219.GA7328@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).