2007-05-06 17:48:04

by Josef 'Jeff' Sipek

[permalink] [raw]
Subject: [PATCH 0/2] [TRIVIAL] 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)



2007-05-06 17:48:09

by Josef 'Jeff' Sipek

[permalink] [raw]
Subject: [PATCH 1/2] fs: Fix indentation in do_path_lookup

Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
---
fs/namei.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 7a98676..2a5c232 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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;

--
1.5.2.rc1.20.g86b9

2007-05-06 17:48:36

by Josef 'Jeff' Sipek

[permalink] [raw]
Subject: [PATCH 2/2] fs: Use path_walk in do_path_lookup

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

Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
---
fs/namei.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/namei.c b/fs/namei.c
index 2a5c232..25aaf8c 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -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))
--
1.5.2.rc1.20.g86b9

2007-05-06 21:21:47

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH 0/2] [TRIVIAL] Small cleanups for do_path_lookup (V2)

On Sun, May 06, 2007 at 01:47:54PM -0400, Josef 'Jeff' Sipek wrote:
> (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.