Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 582
b: refs/heads/master
c: ea3834d
h: refs/heads/master
v: v3
  • Loading branch information
Prasanna Meda authored and unknown committed Apr 29, 2005
1 parent 7209851 commit c77d806
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 81b7854d52d35ed2353dd47033ae630d18322a2d
refs/heads/master: ea3834d9fb348fb1144ad3affea22df933eaf62e
20 changes: 12 additions & 8 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,11 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,

/*
* Name resolution.
* This is the basic name resolution function, turning a pathname into
* the final dentry. We expect 'base' to be positive and a directory.
*
* This is the basic name resolution function, turning a pathname
* into the final dentry.
*
* We expect 'base' to be positive and a directory.
* Returns 0 and nd will have valid dentry and mnt on success.
* Returns error and drops reference to input namei data on failure.
*/
static fastcall int __link_path_walk(const char * name, struct nameidata *nd)
{
Expand Down Expand Up @@ -929,8 +929,10 @@ int fastcall path_walk(const char * name, struct nameidata *nd)
return link_path_walk(name, nd);
}

/* SMP-safe */
/* returns 1 if everything is done */
/*
* SMP-safe: Returns 1 and nd will have valid dentry and mnt, if
* everything is done. Returns 0 and drops input nd, if lookup failed;
*/
static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
{
if (path_walk(name, nd))
Expand Down Expand Up @@ -994,9 +996,10 @@ void set_fs_altroot(void)
}
}

/* Returns 0 and nd will be valid on success; Retuns error, otherwise. */
int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd)
{
int retval;
int retval = 0;

nd->last_type = LAST_ROOT; /* if there are only slashes... */
nd->flags = flags;
Expand All @@ -1009,7 +1012,7 @@ int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata
nd->dentry = dget(current->fs->altroot);
read_unlock(&current->fs->lock);
if (__emul_lookup_dentry(name,nd))
return 0;
goto out; /* found in altroot */
read_lock(&current->fs->lock);
}
nd->mnt = mntget(current->fs->rootmnt);
Expand All @@ -1021,6 +1024,7 @@ int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata
read_unlock(&current->fs->lock);
current->total_link_count = 0;
retval = link_path_walk(name, nd);
out:
if (unlikely(current->audit_context
&& nd && nd->dentry && nd->dentry->d_inode))
audit_inode(name, nd->dentry->d_inode);
Expand Down

0 comments on commit c77d806

Please sign in to comment.