[openib-general] [patch] convert ipath_driver from i_sem to i_mutex

Bernhard Fischer rep.nop at aon.at
Mon Jan 30 03:15:12 PST 2006


Hi,

I don't know when exactly the i_sem to i_mutex conversion was done. In
2.6.16 this patch is needed to build the ipath driver.

Signed-off-by: Bernhard Fischer <rep.nop at aon.at>


Please apply.

-------------- next part --------------
Index: infiniband/hw/ipath/ipath_driver.c
===================================================================
--- infiniband/hw/ipath/ipath_driver.c	(revision 5203)
+++ infiniband/hw/ipath/ipath_driver.c	(working copy)
@@ -2754,7 +2754,12 @@ static loff_t ipath_llseek(struct file *
 	loff_t ret;
 
 	/* range checking is done where offset is used, not here. */
+/* XXX remove this compatibility hack */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
 	down(&fp->f_dentry->d_inode->i_sem);
+#else
+	mutex_lock(&fp->f_dentry->d_inode->i_mutex);
+#endif
 	if (!whence)
 		ret = fp->f_pos = off;
 	else if (whence == 1) {
@@ -2762,7 +2767,11 @@ static loff_t ipath_llseek(struct file *
 		ret = fp->f_pos;
 	} else
 		ret = -EINVAL;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
 	up(&fp->f_dentry->d_inode->i_sem);
+#else
+	mutex_unlock(&fp->f_dentry->d_inode->i_mutex);
+#endif
 	_IPATH_DBG("New offset %llx from seek %llx whence=%d\n", fp->f_pos, off,
 		   whence);
 


More information about the general mailing list