From a8e05cb22bac11e2694e800724b8300ec0cd343f Mon Sep 17 00:00:00 2001 From: Mike Marciniszyn Date: Wed, 25 Jul 2012 12:33:31 -0400 Subject: [PATCH] IB/ipath: backport qib_fs.c before 2.6.35 Signed-off-by: Mike Marciniszyn --- patches/0011-ipath-fs-backport.patch | 76 ++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 patches/0011-ipath-fs-backport.patch diff --git a/patches/0011-ipath-fs-backport.patch b/patches/0011-ipath-fs-backport.patch new file mode 100644 index 0000000..2945b73 --- /dev/null +++ b/patches/0011-ipath-fs-backport.patch @@ -0,0 +1,76 @@ +IB/ipath: backport qib_fs.c before 2.6.35 + +Signed-off-by: Mike Marciniszyn + +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, + }; + -- 2.41.0