diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-05-05 15:43:19 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-05-05 15:43:19 -0400 |
commit | 6f817abc643ec84cf07c99f964d04976212e1fd3 (patch) | |
tree | 982d6e35796cf0c3c01899db1a8dc062d95c92c2 /fs | |
parent | f77165df5ba75461b491a9f20f778307f1b4a0ac (diff) | |
parent | bfd4bda097f8758d28e632ff2035e25577f6b060 (diff) |
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 20 | ||||
-rw-r--r-- | fs/proc/base.c | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/fs/namei.c b/fs/namei.c index 9e4aef2a1a21..0f76fd75591b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -686,11 +686,11 @@ fail: | |||
686 | 686 | ||
687 | /* | 687 | /* |
688 | * Name resolution. | 688 | * Name resolution. |
689 | * This is the basic name resolution function, turning a pathname into | ||
690 | * the final dentry. We expect 'base' to be positive and a directory. | ||
689 | * | 691 | * |
690 | * This is the basic name resolution function, turning a pathname | 692 | * Returns 0 and nd will have valid dentry and mnt on success. |
691 | * into the final dentry. | 693 | * Returns error and drops reference to input namei data on failure. |
692 | * | ||
693 | * We expect 'base' to be positive and a directory. | ||
694 | */ | 694 | */ |
695 | static fastcall int __link_path_walk(const char * name, struct nameidata *nd) | 695 | static fastcall int __link_path_walk(const char * name, struct nameidata *nd) |
696 | { | 696 | { |
@@ -929,8 +929,10 @@ int fastcall path_walk(const char * name, struct nameidata *nd) | |||
929 | return link_path_walk(name, nd); | 929 | return link_path_walk(name, nd); |
930 | } | 930 | } |
931 | 931 | ||
932 | /* SMP-safe */ | 932 | /* |
933 | /* returns 1 if everything is done */ | 933 | * SMP-safe: Returns 1 and nd will have valid dentry and mnt, if |
934 | * everything is done. Returns 0 and drops input nd, if lookup failed; | ||
935 | */ | ||
934 | static int __emul_lookup_dentry(const char *name, struct nameidata *nd) | 936 | static int __emul_lookup_dentry(const char *name, struct nameidata *nd) |
935 | { | 937 | { |
936 | if (path_walk(name, nd)) | 938 | if (path_walk(name, nd)) |
@@ -994,9 +996,10 @@ set_it: | |||
994 | } | 996 | } |
995 | } | 997 | } |
996 | 998 | ||
999 | /* Returns 0 and nd will be valid on success; Retuns error, otherwise. */ | ||
997 | int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd) | 1000 | int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd) |
998 | { | 1001 | { |
999 | int retval; | 1002 | int retval = 0; |
1000 | 1003 | ||
1001 | nd->last_type = LAST_ROOT; /* if there are only slashes... */ | 1004 | nd->last_type = LAST_ROOT; /* if there are only slashes... */ |
1002 | nd->flags = flags; | 1005 | nd->flags = flags; |
@@ -1009,7 +1012,7 @@ int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata | |||
1009 | nd->dentry = dget(current->fs->altroot); | 1012 | nd->dentry = dget(current->fs->altroot); |
1010 | read_unlock(¤t->fs->lock); | 1013 | read_unlock(¤t->fs->lock); |
1011 | if (__emul_lookup_dentry(name,nd)) | 1014 | if (__emul_lookup_dentry(name,nd)) |
1012 | return 0; | 1015 | goto out; /* found in altroot */ |
1013 | read_lock(¤t->fs->lock); | 1016 | read_lock(¤t->fs->lock); |
1014 | } | 1017 | } |
1015 | nd->mnt = mntget(current->fs->rootmnt); | 1018 | nd->mnt = mntget(current->fs->rootmnt); |
@@ -1021,6 +1024,7 @@ int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata | |||
1021 | read_unlock(¤t->fs->lock); | 1024 | read_unlock(¤t->fs->lock); |
1022 | current->total_link_count = 0; | 1025 | current->total_link_count = 0; |
1023 | retval = link_path_walk(name, nd); | 1026 | retval = link_path_walk(name, nd); |
1027 | out: | ||
1024 | if (unlikely(current->audit_context | 1028 | if (unlikely(current->audit_context |
1025 | && nd && nd->dentry && nd->dentry->d_inode)) | 1029 | && nd && nd->dentry && nd->dentry->d_inode)) |
1026 | audit_inode(name, nd->dentry->d_inode); | 1030 | audit_inode(name, nd->dentry->d_inode); |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 07cafdf74ef2..e31903aadd96 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, | |||
820 | goto out_free_page; | 820 | goto out_free_page; |
821 | 821 | ||
822 | } | 822 | } |
823 | length = audit_set_loginuid(task->audit_context, loginuid); | 823 | length = audit_set_loginuid(task, loginuid); |
824 | if (likely(length == 0)) | 824 | if (likely(length == 0)) |
825 | length = count; | 825 | length = count; |
826 | 826 | ||