[PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT()
[deliverable/linux.git] / fs / namei.c
index 2b8f823eda442d383e517df4895c989a84c13c01..068a9e50c8c09e0b52156cd7f63538a37ae8cf9b 100644 (file)
@@ -1454,7 +1454,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
 
        mutex_lock(&p1->d_inode->i_sb->s_vfs_rename_mutex);
 
-       for (p = p1; p->d_parent != p; p = p->d_parent) {
+       for (p = p1; !IS_ROOT(p); p = p->d_parent) {
                if (p->d_parent == p2) {
                        mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_PARENT);
                        mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_CHILD);
@@ -1462,7 +1462,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
                }
        }
 
-       for (p = p2; p->d_parent != p; p = p->d_parent) {
+       for (p = p2; !IS_ROOT(p); p = p->d_parent) {
                if (p->d_parent == p1) {
                        mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT);
                        mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD);
This page took 0.027206 seconds and 5 git commands to generate.