From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Linux Kernel readlink equivalent
Date: Thu, 29 Jan 2015 11:37:37 -0800 [thread overview]
Message-ID: <20150129193737.GA3135@kroah.com> (raw)
In-Reply-To: <CABEmWXEPBKaAOCGYTUCEtxcPMOqpj+phUaof1rZC1-4Bn0pv4w@mail.gmail.com>
On Thu, Jan 29, 2015 at 01:11:13PM -0500, David Legault wrote:
> Hello,
>
> I'm working on some linux kernel driver stuff and I have a fake path called /
> dev/blah/whatever that points to /dev/block/real_device.
That's a userspace "path", right? Why would the kernel care about this?
> The issue is that lookup_bdev will fail to follow the symlink so I'd like to
> massage the path upfront by getting the real path (/dev/block/real_device) so I
> can hand that off to lookup_bdev so it returns successfully instead of an
> error.
Why are you calling this from within the kernel? You should have a bdev
already directly within the kernel, no need to muck around in /dev/
What exactly are you doing that you feel you need access to a block
device node?
thanks,
greg k-h
next prev parent reply other threads:[~2015-01-29 19:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 18:11 Linux Kernel readlink equivalent David Legault
2015-01-29 19:24 ` Valdis.Kletnieks at vt.edu
2015-01-29 19:37 ` Greg KH [this message]
2015-01-30 16:02 ` David Legault
2015-01-30 16:36 ` Valdis.Kletnieks at vt.edu
2015-01-30 17:17 ` Greg KH
2015-01-30 6:07 ` Aruna Hewapathirane
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=20150129193737.GA3135@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).