Right, but not relevant.
The name "switch_names" is somewhat misleading. It is really
"copyname" or similar. From the comment at the top:
* When switching names, the actual string doesn't strictly have to
* be preserved in the target - because we're dropping the target
* anyway. As such, we can just do a simple memcpy() to copy over
* the new name before we switch.
so the apparent name of 'target' after the 'swap' is not important.
The purpose of the assignment
target->d_name.name = target->d_iname;
is to make "dname_external(target)" false, that making "target
internal" as the comment says.
static inline int dname_external(struct dentry *dentry)
{
return dentry->d_name.name != dentry->d_iname;
}
This could possibly be made a little more clear....
NeilBrown
-