linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: dmitry.krivenok@emc.com
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: path_lookup() alternative
Date: Mon, 23 Jan 2012 21:23:56 +0000	[thread overview]
Message-ID: <20120123212356.GG23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <9C7BACB01B839A499792154E76C9ADE5563FDD2D34@MX19A.corp.emc.com>

On Mon, Jan 23, 2012 at 05:19:24AM -0500, dmitry.krivenok@emc.com wrote:
> Hello,
> I sent this question to Al Viro first, but didn't get any feedback, so reposting here and hope that someone can help me.
> 
> I'm trying to build existing system consisting of several kernel modules and user-space tools on the latest vanilla kernel.
> Previously, we used path_lookup() function to perform lookup with arbitrary flags (e.g. we passed LOOKUP_PARENT in
> some cases) and save results in nameidata structure. Then, this structure was passed to other kernel functions (e.g. 
> lookup_hash and then lookup_one_len) or was used directly in the module code.

lookup_one_len() does not take nameidata at all.
lookup_hash() is not only not exported, it's _static_.

what are you talking about?

> The problem is that path_lookup() was removed in c9c6cac0c2bdbda42e7b804838648d0bc60ddb13 and kern_path_parent
> was added instead (and, of course, it didn't allow user to pass arbitrary flags).
> Then, in e3c3d9c838d48c0341c40ea45ee087e3d8c8ea39, kern_path_parent() was unexported and thus became unavailable for us.
> 
> I spent several hours learning path lookup code in the kernel tree, but didn't find a function/method which allows to get properly filled 
> nameidata having only path and flags.
> Is there an alternative to removed path_lookup() function or any other way of {path, flags}->{nameidata} translation?

Depends on what do you want to do with it.  IMO nameidata should be internal to
fs/namei.c; we still have it exposed more than I'd like it to be and if nothing
else, that exposure is going to shrink.

Details of your use case, please (ideally - along with the reference to your
code).

  reply	other threads:[~2012-01-23 21:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-23 10:19 path_lookup() alternative dmitry.krivenok
2012-01-23 21:23 ` Al Viro [this message]
2012-01-24 13:03   ` dmitry.krivenok
2012-01-24 17:19     ` Andreas Dilger

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=20120123212356.GG23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=dmitry.krivenok@emc.com \
    --cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).