Skip to contentSkip to conversation

Small cleanups for do_path_lookup (V2)

PATCH In review Josef 'Jeff' Sipek 2 participants 4 messages May 6, 2007 VFS

lore
Share & tools
lore
#0 lore raw

cover Small cleanups for do_path_lookup (V2)

(For changes since V1, see the end of this email.)

The following 2 patches are trivial cleanups to do_path_lookup in namei.c. Since these changes are trivial, they can go into 2.6.22-rc1 without any problems.

Josef 'Jeff' Sipek (2):
fs: Fix indentation in do_path_lookup
fs: Use path_walk in do_path_lookup

diffstat for good measure:

 fs/namei.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Josef 'Jeff' Sipek.

Changes since V1:

- Fixed up audit_inode condition (hch)

#1 lore raw

PATCH 1/2 fs: Fix indentation in do_path_lookup

---
 fs/namei.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
fs/namei.c +1 -3
index 7a98676..2a5c232 100644
@@ -1159,11 +1159,9 @@ static int fastcall do_path_lookup(int dfd, const char *name,
 	current->total_link_count = 0;
 	retval = link_path_walk(name, nd);
 out:
-	if (likely(retval == 0)) {
-		if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
+	if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
 				nd->dentry->d_inode))
 		audit_inode(name, nd->dentry->d_inode);
-	}
 out_fail:
 	return retval;
 
Signature · 1 line
1.5.2.rc1.20.g86b9
#2 lore raw

PATCH 2/2 fs: Use path_walk in do_path_lookup

In reply to Josef 'Jeff' Sipek

Since, path_walk sets the total_link_count to 0, and calls link_path_walk, we can just call path_walk directly.

---
 fs/namei.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/namei.c +2 -2
index 2a5c232..25aaf8c 100644
@@ -1156,8 +1156,8 @@ static int fastcall do_path_lookup(int dfd, const char *name,
 
 		fput_light(file, fput_needed);
 	}
-	current->total_link_count = 0;
-	retval = link_path_walk(name, nd);
+
+	retval = path_walk(name, nd);
 out:
 	if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
 				nd->dentry->d_inode))
Signature · 1 line
1.5.2.rc1.20.g86b9
#3 lore raw
In reply to Josef 'Jeff' Sipek
Quoted 9 lines · Josef 'Jeff' Sipek

(For changes since V1, see the end of this email.)

The following 2 patches are trivial cleanups to do_path_lookup in namei.c. Since these changes are trivial, they can go into 2.6.22-rc1 without any problems.

Josef 'Jeff' Sipek (2):
fs: Fix indentation in do_path_lookup
fs: Use path_walk in do_path_lookup

Ok for both patches.