]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/mempolicy.c
drm/nouveau/core: remove some left-over pieces from the porting process
[mirror_ubuntu-artful-kernel.git] / mm / mempolicy.c
index 1d771e4200d222eea46458bdd6089279a78ffeb5..4ada3be6e2521278de6da6e110995d63ccd7ed8f 100644 (file)
@@ -1602,8 +1602,14 @@ static unsigned interleave_nodes(struct mempolicy *policy)
  * task can change it's policy.  The system default policy requires no
  * such protection.
  */
-unsigned slab_node(struct mempolicy *policy)
+unsigned slab_node(void)
 {
+       struct mempolicy *policy;
+
+       if (in_interrupt())
+               return numa_node_id();
+
+       policy = current->mempolicy;
        if (!policy || policy->flags & MPOL_F_LOCAL)
                return numa_node_id();
 
@@ -2556,7 +2562,7 @@ int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context)
                break;
 
        default:
-               BUG();
+               return -EINVAL;
        }
 
        l = strlen(policy_modes[mode]);