From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/infiniband/debug/memtrack.c

Change-Id: Icba87cb7c993603fcea9dd9df52b7f35b96af0e5
---
 drivers/infiniband/debug/memtrack.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/drivers/infiniband/debug/memtrack.c
+++ b/drivers/infiniband/debug/memtrack.c
@@ -1093,9 +1093,15 @@ static ssize_t memtrack_read(struct file
 	}
 }
 
+#ifdef HAVE_PROC_OPS_STRUCT 
 static const struct proc_ops memtrack_proc_ops = {
 	.proc_read = memtrack_read,
 };
+#else
+static const struct file_operations memtrack_proc_fops = {
+        .read = memtrack_read,
+};
+#endif
 
 static const char *memtrack_proc_entry_name = "mt_memtrack";
 
@@ -1114,7 +1120,11 @@ static int create_procfs_tree(void)
 
 	for (i = 0, bit_mask = 1; i < MEMTRACK_NUM_OF_MEMTYPES; ++i, bit_mask <<= 1) {
 		if (bit_mask & track_mask) {
+#ifdef HAVE_PROC_OPS_STRUCT 
 			proc_ent = proc_create_data(rsc_names[i], S_IRUGO, memtrack_tree, &memtrack_proc_ops, NULL);
+#else
+			proc_ent = proc_create_data(rsc_names[i], S_IRUGO, memtrack_tree, &memtrack_proc_fops, NULL);
+#endif
 			if (!proc_ent) {
 				printk(KERN_INFO "Warning: Cannot create /proc/%s/%s\n",
 				       memtrack_proc_entry_name, rsc_names[i]);
