aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-05-20 16:27:44 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-05-20 16:27:44 -0400
commitad34ea2cc3845ef4dcd7d12fb0fa8484734bd672 (patch)
treead434400f5ecaa33b433c8f830e40792d8d6c05c /fs/namei.c
parent90356ac3194bf91a441a5f9c3067af386ef62462 (diff)
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
merge by hand - fix up rejections in Documentation/DocBook/Makefile
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 9e4aef2a1a21..defe6781e003 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 */
695static fastcall int __link_path_walk(const char * name, struct nameidata *nd) 695static 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 */
934static int __emul_lookup_dentry(const char *name, struct nameidata *nd) 936static 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. */
997int fastcall path_lookup(const char *name, unsigned int flags, struct nameidata *nd) 1000int 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(&current->fs->lock); 1013 read_unlock(&current->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(&current->fs->lock); 1016 read_lock(&current->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(&current->fs->lock); 1024 read_unlock(&current->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);
1027out:
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);
@@ -2067,8 +2071,8 @@ exit:
2067 * ->i_sem on parents, which works but leads to some truely excessive 2071 * ->i_sem on parents, which works but leads to some truely excessive
2068 * locking]. 2072 * locking].
2069 */ 2073 */
2070int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, 2074static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
2071 struct inode *new_dir, struct dentry *new_dentry) 2075 struct inode *new_dir, struct dentry *new_dentry)
2072{ 2076{
2073 int error = 0; 2077 int error = 0;
2074 struct inode *target; 2078 struct inode *target;
@@ -2112,8 +2116,8 @@ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
2112 return error; 2116 return error;
2113} 2117}
2114 2118
2115int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, 2119static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
2116 struct inode *new_dir, struct dentry *new_dentry) 2120 struct inode *new_dir, struct dentry *new_dentry)
2117{ 2121{
2118 struct inode *target; 2122 struct inode *target;
2119 int error; 2123 int error;