mm: remove the pgprot argument to __vmalloc
[linux-2.6-block.git] / kernel / bpf / core.c
index 916f5132a9848dfc46982557a2fa126aad792c55..cf6fe9107f5c0b9fc622d00c783d2c014ab658ac 100644 (file)
@@ -82,7 +82,7 @@ struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flag
        struct bpf_prog *fp;
 
        size = round_up(size, PAGE_SIZE);
-       fp = __vmalloc(size, gfp_flags, PAGE_KERNEL);
+       fp = __vmalloc(size, gfp_flags);
        if (fp == NULL)
                return NULL;
 
@@ -232,7 +232,7 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
        if (ret)
                return NULL;
 
-       fp = __vmalloc(size, gfp_flags, PAGE_KERNEL);
+       fp = __vmalloc(size, gfp_flags);
        if (fp == NULL) {
                __bpf_prog_uncharge(fp_old->aux->user, delta);
        } else {
@@ -262,10 +262,10 @@ void __bpf_prog_free(struct bpf_prog *fp)
 
 int bpf_prog_calc_tag(struct bpf_prog *fp)
 {
-       const u32 bits_offset = SHA_MESSAGE_BYTES - sizeof(__be64);
+       const u32 bits_offset = SHA1_BLOCK_SIZE - sizeof(__be64);
        u32 raw_size = bpf_prog_tag_scratch_size(fp);
-       u32 digest[SHA_DIGEST_WORDS];
-       u32 ws[SHA_WORKSPACE_WORDS];
+       u32 digest[SHA1_DIGEST_WORDS];
+       u32 ws[SHA1_WORKSPACE_WORDS];
        u32 i, bsize, psize, blocks;
        struct bpf_insn *dst;
        bool was_ld_map;
@@ -277,7 +277,7 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
        if (!raw)
                return -ENOMEM;
 
-       sha_init(digest);
+       sha1_init(digest);
        memset(ws, 0, sizeof(ws));
 
        /* We need to take out the map fd for the digest calculation
@@ -308,8 +308,8 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
        memset(&raw[psize], 0, raw_size - psize);
        raw[psize++] = 0x80;
 
-       bsize  = round_up(psize, SHA_MESSAGE_BYTES);
-       blocks = bsize / SHA_MESSAGE_BYTES;
+       bsize  = round_up(psize, SHA1_BLOCK_SIZE);
+       blocks = bsize / SHA1_BLOCK_SIZE;
        todo   = raw;
        if (bsize - psize >= sizeof(__be64)) {
                bits = (__be64 *)(todo + bsize - sizeof(__be64));
@@ -320,12 +320,12 @@ int bpf_prog_calc_tag(struct bpf_prog *fp)
        *bits = cpu_to_be64((psize - 1) << 3);
 
        while (blocks--) {
-               sha_transform(digest, todo, ws);
-               todo += SHA_MESSAGE_BYTES;
+               sha1_transform(digest, todo, ws);
+               todo += SHA1_BLOCK_SIZE;
        }
 
        result = (__force __be32 *)digest;
-       for (i = 0; i < SHA_DIGEST_WORDS; i++)
+       for (i = 0; i < SHA1_DIGEST_WORDS; i++)
                result[i] = cpu_to_be32(digest[i]);
        memcpy(fp->tag, result, sizeof(fp->tag));
 
@@ -1089,7 +1089,7 @@ static struct bpf_prog *bpf_prog_clone_create(struct bpf_prog *fp_other,
        gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | gfp_extra_flags;
        struct bpf_prog *fp;
 
-       fp = __vmalloc(fp_other->pages * PAGE_SIZE, gfp_flags, PAGE_KERNEL);
+       fp = __vmalloc(fp_other->pages * PAGE_SIZE, gfp_flags);
        if (fp != NULL) {
                /* aux->prog still points to the fp_other one, so
                 * when promoting the clone to the real program,