Wrapfs: use inode_un/lock helper macros
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 3 Apr 2016 21:22:07 +0000 (17:22 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Dec 2016 19:05:25 +0000 (14:05 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/inode.c
fs/wrapfs/wrapfs.h

index 4c43ce7227e85620175695681a57d539193fcca5..ce180b899045550f185d818322a369c5bbd84c10 100644 (file)
@@ -410,10 +410,10 @@ static int wrapfs_setattr(struct dentry *dentry, struct iattr *ia)
         * unlinked (no inode->i_sb and i_ino==0.  This happens if someone
         * tries to open(), unlink(), then ftruncate() a file.
         */
-       mutex_lock(&d_inode(lower_dentry)->i_mutex);
+       inode_lock(d_inode(lower_dentry));
        err = notify_change(lower_dentry, &lower_ia, /* note: lower_ia */
                            NULL);
-       mutex_unlock(&d_inode(lower_dentry)->i_mutex);
+       inode_unlock(d_inode(lower_dentry));
        if (err)
                goto out;
 
index c5b9fdeb86d58795573092f44e5da67bf88288b1..f5cad27c66ffd6258813bfd2b68dc1d13507f9c8 100644 (file)
@@ -193,13 +193,13 @@ static inline void wrapfs_put_reset_lower_path(const struct dentry *dent)
 static inline struct dentry *lock_parent(struct dentry *dentry)
 {
        struct dentry *dir = dget_parent(dentry);
-       mutex_lock_nested(&d_inode(dir)->i_mutex, I_MUTEX_PARENT);
+       inode_lock_nested(d_inode(dir), I_MUTEX_PARENT);
        return dir;
 }
 
 static inline void unlock_dir(struct dentry *dir)
 {
-       mutex_unlock(&d_inode(dir)->i_mutex);
+       inode_unlock(d_inode(dir));
        dput(dir);
 }
 #endif /* not _WRAPFS_H_ */