Lines Matching defs:p1
3035 // p1 != p2, both are on the same filesystem, ->s_vfs_rename_mutex is held
3036 static struct dentry *lock_two_directories(struct dentry *p1, struct dentry *p2)
3038 struct dentry *p = p1, *q = p2, *r;
3043 // p is a child of p2 and an ancestor of p1 or p1 itself
3045 inode_lock_nested(p1->d_inode, I_MUTEX_PARENT2);
3048 // p is the root of connected component that contains p1
3049 // p2 does not occur on the path from p to p1
3050 while ((r = q->d_parent) != p1 && r != p && r != q)
3052 if (r == p1) {
3053 // q is a child of p1 and an ancestor of p2 or p2 itself
3054 inode_lock_nested(p1->d_inode, I_MUTEX_PARENT);
3058 // both p2 and p1 are descendents of p
3059 inode_lock_nested(p1->d_inode, I_MUTEX_PARENT);
3063 mutex_unlock(&p1->d_sb->s_vfs_rename_mutex);
3069 * p1 and p2 should be directories on the same fs.
3071 struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
3073 if (p1 == p2) {
3074 inode_lock_nested(p1->d_inode, I_MUTEX_PARENT);
3078 mutex_lock(&p1->d_sb->s_vfs_rename_mutex);
3079 return lock_two_directories(p1, p2);
3125 void unlock_rename(struct dentry *p1, struct dentry *p2)
3127 inode_unlock(p1->d_inode);
3128 if (p1 != p2) {
3130 mutex_unlock(&p1->d_sb->s_vfs_rename_mutex);