]> git.openfabrics.org - ~emulex/tmp/compat-rdma/.git/commitdiff
IB/ipath: backport qib_fs.c before 2.6.35
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 25 Jul 2012 16:33:31 +0000 (12:33 -0400)
committerMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 25 Jul 2012 16:33:31 +0000 (12:33 -0400)
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
patches/0011-ipath-fs-backport.patch [new file with mode: 0644]

diff --git a/patches/0011-ipath-fs-backport.patch b/patches/0011-ipath-fs-backport.patch
new file mode 100644 (file)
index 0000000..2945b73
--- /dev/null
@@ -0,0 +1,76 @@
+IB/ipath: backport qib_fs.c before 2.6.35
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+
+diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c b/drivers/infiniband/hw/ipath/ipath_fs.c
+index a4de9d5..5ec9c66 100644
+--- a/drivers/infiniband/hw/ipath/ipath_fs.c
++++ b/drivers/infiniband/hw/ipath/ipath_fs.c
+@@ -57,7 +57,9 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry,
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       inode->i_ino = get_next_ino();
++#endif
+       inode->i_mode = mode;
+       inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+       inode->i_private = data;
+@@ -277,11 +279,21 @@ static int remove_file(struct dentry *parent, char *name)
+               goto bail;
+       }
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++      spin_lock(&dcache_lock);
++#endif
+       spin_lock(&tmp->d_lock);
+       if (!(d_unhashed(tmp) && tmp->d_inode)) {
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              dget_locked(tmp);
++#else
+               dget_dlock(tmp);
++#endif
+               __d_drop(tmp);
+               spin_unlock(&tmp->d_lock);
++#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,36))
++              spin_unlock(&dcache_lock);
++#endif
+               simple_unlink(parent->d_inode, tmp);
+       } else
+               spin_unlock(&tmp->d_lock);
+@@ -358,6 +370,7 @@ bail:
+       return ret;
+ }
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+ static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
+                       int flags, const char *dev_name, void *data)
+ {
+@@ -365,6 +378,15 @@ static struct dentry *ipathfs_mount(struct file_system_type *fs_type,
+       ret = mount_single(fs_type, flags, data, ipathfs_fill_super);
+       if (!IS_ERR(ret))
+               ipath_super = ret->d_sb;
++#else
++static int ipathfs_get_sb(struct file_system_type *fs_type, int flags,
++                      const char *dev_name, void *data, struct vfsmount *mnt)
++{
++      int ret = get_sb_single(fs_type, flags, data,
++                                      ipathfs_fill_super, mnt);
++      if (ret >= 0)
++              ipath_super = mnt->mnt_sb;
++#endif
+       return ret;
+ }
+@@ -407,7 +429,11 @@ bail:
+ static struct file_system_type ipathfs_fs_type = {
+       .owner =        THIS_MODULE,
+       .name =         "ipathfs",
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36))
+       .mount =        ipathfs_mount,
++#else
++      .get_sb =   ipathfs_get_sb,
++#endif
+       .kill_sb =      ipathfs_kill_super,
+ };