The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: [Question] how to follow a symlink via a dentry?
Date: Tue, 23 May 2006 10:08:47 -0700	[thread overview]
Message-ID: <20060523100847.7056909a@localhost.localdomain> (raw)
In-Reply-To: 1148403363.22855.8.camel@localhost.localdomain

On Tue, 23 May 2006 12:56:03 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> What is the best way from inside the kernel, to find the dentry that
> another dentry points to via symlink?
> 
> Scenario:
> 
> I have a kobj of a device in the sysfs system.  Inside a directory of
> the kobj, is a symlink to another device I need to get.  I can find the
> dentry of the symlink, but I haven't found a good way to get to the
> dentry of what the symlink points to.
> 
> Is there a standard way to do this, or do I need to start hacking at the
> follow_link of the sysfs directory to get what I want?
> 
> Do I need to hack up something like page_readlink to get the path, and
> then do vfs_follow_link to get the rest.  Another thing is that I can't
> rely on what current->fs points to.
> 
> Thanks,
> 
> -- Steve
>

Sysfs reflects kernel object linkage, you should not be using
file access to find kernel objects.  You should use the pointers
instead.

  reply	other threads:[~2006-05-23 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-23 16:56 [Question] how to follow a symlink via a dentry? Steven Rostedt
2006-05-23 17:08 ` Stephen Hemminger [this message]
2006-05-23 20:56   ` Steven Rostedt

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=20060523100847.7056909a@localhost.localdomain \
    --to=shemminger@osdl.org \
    --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