[RFC 01/10] Split up struct nameidata

Andreas Gruenbacher
2007-08-08T17:19:20Z

[-- Attachment #1: nameidata-split.diff --]
[-- Type: text/plain, Size: 1023 bytes --]

Split up struct nameidata into struct vfs_lookup with the lookup result
and intent and the remaining fields for performing an actual lookup.

Signed-off-by: Andreas Gruenbacher <ag@bestbits.at>

---
include/linux/namei.h | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)

--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -14,14 +14,14 @@ struct open_intent {

enum { MAX_NESTED_LINKS = 8 };

-struct nameidata {
- struct dentry *dentry;
+struct path {
struct vfsmount *mnt;
- struct qstr last;
+ struct dentry *dentry;
+};
+
+struct vfs_lookup {
+ struct path path;
unsigned int flags;
- int last_type;
- unsigned depth;
- char *saved_names[MAX_NESTED_LINKS + 1];

/* Intent data */
union {
@@ -29,9 +29,12 @@ struct nameidata {
} intent;
};

-struct path {
- struct vfsmount *mnt;
- struct dentry *dentry;
+struct nameidata {
+ struct vfs_lookup lookup;
+ struct qstr last;
+ int last_type;
+ unsigned depth;
+ char *saved_names[MAX_NESTED_LINKS + 1];
};

/*