mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Torsten Foertsch <torsten.foertsch@gmx.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.4.19] How to get the path name of a struct dentry
Date: Wed, 12 Mar 2003 13:59:54 +0000	[thread overview]
Message-ID: <20030312135954.A11564@infradead.org> (raw)
In-Reply-To: <200303121432.51329.torsten.foertsch@gmx.net>; from torsten.foertsch@gmx.net on Wed, Mar 12, 2003 at 02:32:47PM +0100

On Wed, Mar 12, 2003 at 02:32:47PM +0100, Torsten Foertsch wrote:
> 
> char*
> full_d_path( struct dentry *dentry,
> 	     struct vfsmount *vfsmnt,
> 	     char *buf, int buflen ) {
>   char *res;
>   struct vfsmount *rootmnt;
>   struct dentry *root;
>   struct namespace *ns;
> 
>   ns=current->namespace;
> /*   get_namespace( ns ); */

you want to keep this.

>   rootmnt=mntget( ns->root );
> /*   put_namespace( ns ); */

do the put once you're completly done with it

> 
>   root = dget(rootmnt->mnt_root);
> 
>   spin_lock(&dcache_lock);
>   res = __d_path(dentry, vfsmnt, root, rootmnt, buf, buflen);
>   spin_unlock(&dcache_lock);
> 
>   dput(root);
>   mntput(rootmnt);
>   return res;

looks okay to me otherwise.


  reply	other threads:[~2003-03-12 13:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-12  9:33 Torsten Foertsch
2003-03-12 10:11 ` Christoph Hellwig
2003-03-12 10:38   ` Torsten Foertsch
2003-03-12 10:47     ` Christoph Hellwig
2003-03-12 12:38       ` Torsten Foertsch
2003-03-12 12:53         ` Christoph Hellwig
2003-03-12 13:04       ` Torsten Foertsch
2003-03-12 13:32         ` Torsten Foertsch
2003-03-12 13:59           ` Christoph Hellwig [this message]
2003-03-12 14:51             ` Torsten Foertsch
2003-03-12 10:13 ` Arjan van de Ven

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=20030312135954.A11564@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torsten.foertsch@gmx.net \
    /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

all inboxes | Powered by JetHome®