Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
child_dentry = parent_dentry;
/* find the parent directory dentry in unionfs */
- parent_dentry = child_dentry->d_parent;
- dget(parent_dentry);
+ parent_dentry = dget_parent(child_dentry);
/* find out the lower_parent_dentry in the given branch */
lower_parent_dentry =
/* locking helpers */
static inline struct dentry *lock_parent(struct dentry *dentry)
{
- struct dentry *dir = dget(dentry->d_parent);
+ struct dentry *dir = dget_parent(dentry);
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
return dir;
}
static inline struct dentry *lock_parent_wh(struct dentry *dentry)
{
- struct dentry *dir = dget(dentry->d_parent);
+ struct dentry *dir = dget_parent(dentry);
mutex_lock_nested(&dir->d_inode->i_mutex, UNIONFS_DMUTEX_WHITEOUT);
return dir;