[Drbd-dev] [PATCH-drbd9] compat: i_mutex is replaced by i_rwsem

Nick Wang nwang at suse.com
Thu Jun 9 16:39:46 CEST 2016


In v4.7(commit 9902af79), i_mutex is replaced by i_rwsem,
while inode_lock() work as usual.

This patch is for drbd-9.0.

Signed-off-by: Nick Wang <nwang at suse.com>

CC: Philipp Reisner <philipp.reisner at linbit.com>
CC: Lars Ellenberg <lars.ellenberg at linbit.com>
CC: drbd-dev at lists.linbit.com
---
 drbd/drbd_debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drbd/drbd_debugfs.c b/drbd/drbd_debugfs.c
index 91292c3..959a576 100644
--- a/drbd/drbd_debugfs.c
+++ b/drbd/drbd_debugfs.c
@@ -1074,7 +1074,7 @@ static int drbd_single_open_peer_device(struct file *file,
 	parent = file->f_path.dentry->d_parent;
 	if (!parent || !parent->d_inode)
 		goto out;
-	mutex_lock(&parent->d_inode->i_mutex);
+	inode_lock(d_inode(parent));
 	if (!simple_positive(file->f_path.dentry))
 		goto out_unlock;
 
@@ -1083,7 +1083,7 @@ static int drbd_single_open_peer_device(struct file *file,
 
 	if (got_connection && got_device) {
 		int ret;
-		mutex_unlock(&parent->d_inode->i_mutex);
+		inode_unlock(d_inode(parent));
 		ret = single_open(file, show, peer_device);
 		if (ret) {
 			kref_put(&connection->kref, drbd_destroy_connection);
@@ -1097,7 +1097,7 @@ static int drbd_single_open_peer_device(struct file *file,
 	if (got_device)
 		kref_put(&device->kref, drbd_destroy_device);
 out_unlock:
-	mutex_unlock(&parent->d_inode->i_mutex);
+	inode_unlock(d_inode(parent));
 out:
 	return -ESTALE;
 }
-- 
1.8.5.6



More information about the drbd-dev mailing list