mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Linux 4.7 compat: inode_lock() and friends
Linux 4.7 changes i_mutex to i_rwsem, and we should used inode_lock and
inode_lock_shared to do exclusive and shared lock respectively.
We use spl_inode_lock{,_shared}() to hide the difference. Note that on older
kernel you'll always take an exclusive lock.
We also add all other inode_lock friends. And nested users now should
explicitly call spl_inode_lock_nested with correct subclass.
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue zfsonlinux/zfs#4665
Closes #549
This commit is contained in:
committed by
Brian Behlendorf
parent
39cd90ef08
commit
fdbc1ba99d
@@ -352,7 +352,8 @@ spl_kern_path_locked(const char *name, struct path *path)
|
||||
if (rc)
|
||||
return (ERR_PTR(rc));
|
||||
|
||||
spl_inode_lock(parent.dentry->d_inode);
|
||||
/* use I_MUTEX_PARENT because vfs_unlink needs it */
|
||||
spl_inode_lock_nested(parent.dentry->d_inode, I_MUTEX_PARENT);
|
||||
|
||||
dentry = lookup_one_len(basename, parent.dentry, len);
|
||||
if (IS_ERR(dentry)) {
|
||||
|
||||
Reference in New Issue
Block a user