Skip to contentSkip to conversation

fsstack: struct path

DISCUSSION Josef Sipek 7 participants 12 messages Oct 18, 2006 VFS

lore
Share & tools
lore
#0 lore raw

Few weeks ago, I noticed that fs/namei.c defines struct path:

struct path {
	struct vfsmount *mnt;
	struct dentry *dentry;
};

I think it would make sense to move it into include/linux/ as it is quite useful (and it would discourage the (ab)use of struct nameidata.)

The fsstack code could benefit from it as the stackable fs dentries have to keep track of the lower dentry as well as the lower vfsmount.

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Any thoughts?

Josef "Jeff" Sipek.

Signature · 1 line
I already backed up the box once, I can do it again.
#1 lore raw
Quoted 10 lines · On Wed, 18 Oct 2006 00:23:23 -0400 Josef Sipek <[email protected]> wrote:

Few weeks ago, I noticed that fs/namei.c defines struct path:

struct path {
	struct vfsmount *mnt;
	struct dentry *dentry;
};

I think it would make sense to move it into include/linux/ as it is quite useful (and it would discourage the (ab)use of struct nameidata.)

Quoted 9 lines

The fsstack code could benefit from it as the stackable fs dentries have to keep track of the lower dentry as well as the lower vfsmount.

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

#2 lore raw
Quoted 16 lines · Andrew Morton
Quoted 13 lines · On Wed, 18 Oct 2006 00:23:23 -0400 Josef Sipek <[email protected]> wrote:

Few weeks ago, I noticed that fs/namei.c defines struct path:

struct path {
	struct vfsmount *mnt;
	struct dentry *dentry;
};

I think it would make sense to move it into include/linux/ as it is quite useful (and it would discourage the (ab)use of struct nameidata.)

The fsstack code could benefit from it as the stackable fs dentries have to keep track of the lower dentry as well as the lower vfsmount.

Quoted 8 lines
Quoted 6 lines

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

Indeed. That's one pending patch that never got around to be submitted (and had bitrotten at least 3 times, IIRC).

ACK, provided that reiserfs folks are OK with the replacement name for their struct. Note that "path" in question has very little to do with pathnames - it's a path in balanced tree, IIRC. So if we get around to renaming that sucker, it might be a good time to pick better name.

Certainly ACK for generic part.

#3 lore raw
Quoted 10 lines · Al Viro
Quoted 8 lines · Andrew Morton
Quoted 6 lines

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

Quoted 7 lines

Indeed. That's one pending patch that never got around to be submitted (and had bitrotten at least 3 times, IIRC).

ACK, provided that reiserfs folks are OK with the replacement name for their struct. Note that "path" in question has very little to do with pathnames - it's a path in balanced tree, IIRC. So if we get around to renaming that sucker, it might be a good time to pick better name.

Aside from having to reindent the reiserfs tree afterwards, I doubt anyone would mind (please cc reiserfs-dev on the patch though). Al is right, it's a path in the balanced tree.

-chris

#4 lore raw
In reply to Andrew Morton
Quoted 8 lines · On Wed, 18 Oct 2006 01:31:03 -0700 Andrew Morton <[email protected]> wrote:
Quoted 6 lines

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

There's also drivers/md/dm-mpath.h's struct path. Renaming fs/namei.c's struct path' to struct namei_path' would be prudent.

#5 lore raw
Quoted 7 lines · Andrew Morton
Quoted 4 lines · On Wed, 18 Oct 2006 01:31:03 -0700 Andrew Morton <[email protected]> wrote:
Quoted 4 lines

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

There's also drivers/md/dm-mpath.h's struct path. Renaming fs/namei.c's struct path' to struct namei_path' would be prudent.

Yuck... If we really want to switch to it (and I can give you a dozen examples of possible users right now - starting with struct file), putting namei_ into it is both uninformative and ugly.

I'm not sure what would be the good name here; "pathname" comes to mind, but it suggests that we are dealing with a string. And "location" is too vague (and probably would cause fsckloads of conflicts itself).

Suggestions? "pathname" would almost work; the difference is that this is not a string but a node in tree that string resolves to.

#6 lore raw
Quoted 20 lines · On Wed, 18 Oct 2006 10:06:23 +0100 Al Viro <[email protected]> wrote:
Quoted 7 lines · Andrew Morton
Quoted 4 lines · On Wed, 18 Oct 2006 01:31:03 -0700 Andrew Morton <[email protected]> wrote:
Quoted 4 lines

One, rather unfortunate, fact is that struct path is also defined in include/linux/reiserfs_fs.h as something completely different - reiserfs specific.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Any thoughts?

reiserfs is being bad. s/path/reiserfs_path/g

There's also drivers/md/dm-mpath.h's struct path. Renaming fs/namei.c's struct path' to struct namei_path' would be prudent.

Yuck... If we really want to switch to it (and I can give you a dozen examples of possible users right now - starting with struct file), putting namei_ into it is both uninformative and ugly.

Quoted 6 lines

I'm not sure what would be the good name here; "pathname" comes to mind, but it suggests that we are dealing with a string. And "location" is too vague (and probably would cause fsckloads of conflicts itself).

Suggestions? "pathname" would almost work; the difference is that this is not a string but a node in tree that string resolves to.

path_item?

#7 lore raw
Quoted 4 lines · Andrew Morton
Quoted 4 lines

Yuck... If we really want to switch to it (and I can give you a dozen examples of possible users right now - starting with struct file), putting namei_ into it is both uninformative and ugly.

Quoted 8 lines
Quoted 6 lines

I'm not sure what would be the good name here; "pathname" comes to mind, but it suggests that we are dealing with a string. And "location" is too vague (and probably would cause fsckloads of conflicts itself).

Suggestions? "pathname" would almost work; the difference is that this is not a string but a node in tree that string resolves to.

path_item?

struct path_node, perhaps?

#8 lore raw
Quoted 1 line

struct path_node

or just struct pathnode ?

Signature · 3 lines
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <[email protected]> 1.925.600.0401
#9 lore raw
Quoted 3 lines · Paul Jackson
Quoted 1 line

struct path_node

or just struct pathnode ?

as long as it's not path_thingy (or path_turnip)...

#10 lore raw
Quoted 2 lines · Al Viro

as long as it's not path_thingy (or path_turnip)...

dpath?

Jörn

Signature · 6 lines
A victorious army first wins and then seeks battle.
-- Sun Tzu
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

IMHO, the string "path" is so generic (and nice, short, and sweet :-), that only higher-level layers such as the VFS should be allowed to define it. All other layers that are somewhere below the VFS (drivers/md/dm-mpath.h and reiserfs), should rename their struct path to something more specific. If anyone component can claim "first rights" for the name "struct path" -- it's the VFS.

That said, 'pathnode' is also good, esp. if it better describes the contents and use of this struct. But I would still rename all other uses of 'struct path' below the VFS.

Erez.