lkml.org 
[lkml]   [2003]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.4.19] How to get the path name of a struct dentry
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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.047 / U:2.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site