summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-05-05 22:39:49 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 22:39:49 +0100
commit450cbfbbbd88876e3ccec1d277f613221ca82bb7 (patch)
treeaf0f1b4c706ba7e725cd4e877a8b7ecf021d76c2 /fs
parentd53ee3222459f347cb18985a845864bc81a44eaf (diff)
parentbfd4bda097f8758d28e632ff2035e25577f6b060 (diff)
downloadop-kernel-dev-450cbfbbbd88876e3ccec1d277f613221ca82bb7.zip
op-kernel-dev-450cbfbbbd88876e3ccec1d277f613221ca82bb7.tar.gz
Merge with /usr/src/ntfs-2.6.git
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c20
-rw-r--r--fs/proc/base.c2
2 files changed, 13 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 9e4aef2..0f76fd7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -686,11 +686,11 @@ fail:
/*
* 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)
{
@@ -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))
@@ -994,9 +996,10 @@ set_it:
}
}
+/* 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;
@@ -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);
@@ -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);
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 07cafdf..e31903a 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -820,7 +820,7 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
goto out_free_page;
}
- length = audit_set_loginuid(task->audit_context, loginuid);
+ length = audit_set_loginuid(task, loginuid);
if (likely(length == 0))
length = count;
OpenPOWER on IntegriCloud