--- initial
+++ final
@@ -1,148 +1,148 @@
 int hfi1_get_proc_affinity(int node) {
   int cpu = -1, ret, i;
   struct hfi1_affinity_node *entry;
   cpumask_var_t diff, hw_thread_mask, available_mask, intrs_mask;
-  const struct cpumask *node_mask, *proc_mask = tsk_cpus_allowed(current);
+  const struct cpumask *node_mask, *proc_mask = &current->cpus_allowed;
   struct hfi1_affinity_node_list *affinity = &node_affinity;
   struct cpu_mask_set *set = &affinity->proc;
   /*
    * check whether process/context affinity has already
    * been set
    */
   if (cpumask_weight(proc_mask) == 1) {
     hfi1_cdbg(PROC, "PID %u %s affinity set to CPU %*pbl", current->pid, current->comm, cpumask_pr_args(proc_mask));
     /*
      * Mark the pre-set CPU as used. This is atomic so we don't
      * need the lock
      */
     cpu = cpumask_first(proc_mask);
     cpumask_set_cpu(cpu, &set->used);
     goto done;
   } else if (cpumask_weight(proc_mask) < cpumask_weight(&set->mask)) {
     hfi1_cdbg(PROC, "PID %u %s affinity set to CPU set(s) %*pbl", current->pid, current->comm, cpumask_pr_args(proc_mask));
     goto done;
   }
   /*
    * The process does not have a preset CPU affinity so find one to
    * recommend using the following algorithm:
    *
    * For each user process that is opening a context on HFI Y:
    *  a) If all cores are filled, reinitialize the bitmask
    *  b) Fill real cores first, then HT cores (First set of HT
    *     cores on all physical cores, then second set of HT core,
    *     and, so on) in the following order:
    *
    *     1. Same NUMA node as HFI Y and not running an IRQ
    *        handler
    *     2. Same NUMA node as HFI Y and running an IRQ handler
    *     3. Different NUMA node to HFI Y and not running an IRQ
    *        handler
    *     4. Different NUMA node to HFI Y and running an IRQ
    *        handler
    *  c) Mark core as filled in the bitmask. As user processes are
    *     done, clear cores from the bitmask.
    */
   ret = zalloc_cpumask_var(&diff, GFP_KERNEL);
   if (!ret) goto done;
   ret = zalloc_cpumask_var(&hw_thread_mask, GFP_KERNEL);
   if (!ret) goto free_diff;
   ret = zalloc_cpumask_var(&available_mask, GFP_KERNEL);
   if (!ret) goto free_hw_thread_mask;
   ret = zalloc_cpumask_var(&intrs_mask, GFP_KERNEL);
   if (!ret) goto free_available_mask;
   mutex_lock(&affinity->lock);
   /*
    * If we've used all available HW threads, clear the mask and start
    * overloading.
    */
   if (cpumask_equal(&set->mask, &set->used)) {
     set->gen++;
     cpumask_clear(&set->used);
   }
   /*
    * If NUMA node has CPUs used by interrupt handlers, include them in the
    * interrupt handler mask.
    */
   entry = node_affinity_lookup(node);
   if (entry) {
     cpumask_copy(intrs_mask, (entry->def_intr.gen ? &entry->def_intr.mask : &entry->def_intr.used));
     cpumask_or(intrs_mask, intrs_mask, (entry->rcv_intr.gen ? &entry->rcv_intr.mask : &entry->rcv_intr.used));
     cpumask_or(intrs_mask, intrs_mask, &entry->general_intr_mask);
   }
   hfi1_cdbg(PROC, "CPUs used by interrupts: %*pbl", cpumask_pr_args(intrs_mask));
   cpumask_copy(hw_thread_mask, &set->mask);
   /*
    * If HT cores are enabled, identify which HW threads within the
    * physical cores should be used.
    */
   if (affinity->num_core_siblings > 0) {
     for (i = 0; i < affinity->num_core_siblings; i++) {
       find_hw_thread_mask(i, hw_thread_mask, affinity);
       /*
        * If there's at least one available core for this HW
        * thread number, stop looking for a core.
        *
        * diff will always be not empty at least once in this
        * loop as the used mask gets reset when
        * (set->mask == set->used) before this loop.
        */
       cpumask_andnot(diff, hw_thread_mask, &set->used);
       if (!cpumask_empty(diff)) break;
     }
   }
   hfi1_cdbg(PROC, "Same available HW thread on all physical CPUs: %*pbl", cpumask_pr_args(hw_thread_mask));
   node_mask = cpumask_of_node(node);
   hfi1_cdbg(PROC, "Device on NUMA %u, CPUs %*pbl", node, cpumask_pr_args(node_mask));
   /* Get cpumask of available CPUs on preferred NUMA */
   cpumask_and(available_mask, hw_thread_mask, node_mask);
   cpumask_andnot(available_mask, available_mask, &set->used);
   hfi1_cdbg(PROC, "Available CPUs on NUMA %u: %*pbl", node, cpumask_pr_args(available_mask));
   /*
    * At first, we don't want to place processes on the same
    * CPUs as interrupt handlers. Then, CPUs running interrupt
    * handlers are used.
    *
    * 1) If diff is not empty, then there are CPUs not running
    *    non-interrupt handlers available, so diff gets copied
    *    over to available_mask.
    * 2) If diff is empty, then all CPUs not running interrupt
    *    handlers are taken, so available_mask contains all
    *    available CPUs running interrupt handlers.
    * 3) If available_mask is empty, then all CPUs on the
    *    preferred NUMA node are taken, so other NUMA nodes are
    *    used for process assignments using the same method as
    *    the preferred NUMA node.
    */
   cpumask_andnot(diff, available_mask, intrs_mask);
   if (!cpumask_empty(diff)) cpumask_copy(available_mask, diff);
   /* If we don't have CPUs on the preferred node, use other NUMA nodes */
   if (cpumask_empty(available_mask)) {
     cpumask_andnot(available_mask, hw_thread_mask, &set->used);
     /* Excluding preferred NUMA cores */
     cpumask_andnot(available_mask, available_mask, node_mask);
     hfi1_cdbg(PROC, "Preferred NUMA node cores are taken, cores available in other NUMA nodes: %*pbl", cpumask_pr_args(available_mask));
     /*
      * At first, we don't want to place processes on the same
      * CPUs as interrupt handlers.
      */
     cpumask_andnot(diff, available_mask, intrs_mask);
     if (!cpumask_empty(diff)) cpumask_copy(available_mask, diff);
   }
   hfi1_cdbg(PROC, "Possible CPUs for process: %*pbl", cpumask_pr_args(available_mask));
   cpu = cpumask_first(available_mask);
   if (cpu >= nr_cpu_ids) /* empty */
     cpu = -1;
   else
     cpumask_set_cpu(cpu, &set->used);
   mutex_unlock(&affinity->lock);
   hfi1_cdbg(PROC, "Process assigned to CPU %d", cpu);
   free_cpumask_var(intrs_mask);
 free_available_mask:
   free_cpumask_var(available_mask);
 free_hw_thread_mask:
   free_cpumask_var(hw_thread_mask);
 free_diff:
   free_cpumask_var(diff);
 done:
   return cpu;
 }<sep>@@
expression current;
@@
-       tsk_cpus_allowed(current)
+       &current->cpus_allowed