cregit-Linux how code gets into the kernel

Release 4.7 drivers/block/zram/zcomp_lz4.c

/*
 * Copyright (C) 2014 Sergey Senozhatsky.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/lz4.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>

#include "zcomp_lz4.h"


static void *zcomp_lz4_create(gfp_t flags) { void *ret; ret = kmalloc(LZ4_MEM_COMPRESS, flags); if (!ret) ret = __vmalloc(LZ4_MEM_COMPRESS, flags | __GFP_HIGHMEM, PAGE_KERNEL); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
kyeongdon kimkyeongdon kim2659.09%125.00%
sergey senozhatskysergey senozhatsky1431.82%250.00%
minchan kimminchan kim49.09%125.00%
Total44100.00%4100.00%


static void zcomp_lz4_destroy(void *private) { kvfree(private); }

Contributors

PersonTokensPropCommitsCommitProp
sergey senozhatskysergey senozhatsky1493.33%150.00%
kyeongdon kimkyeongdon kim16.67%150.00%
Total15100.00%2100.00%


static int zcomp_lz4_compress(const unsigned char *src, unsigned char *dst, size_t *dst_len, void *private) { /* return : Success if return 0 */ return lz4_compress(src, PAGE_SIZE, dst, dst_len, private); }

Contributors

PersonTokensPropCommitsCommitProp
sergey senozhatskysergey senozhatsky40100.00%1100.00%
Total40100.00%1100.00%


static int zcomp_lz4_decompress(const unsigned char *src, size_t src_len, unsigned char *dst) { size_t dst_len = PAGE_SIZE; /* return : Success if return 0 */ return lz4_decompress_unknownoutputsize(src, src_len, dst, &dst_len); }

Contributors

PersonTokensPropCommitsCommitProp
sergey senozhatskysergey senozhatsky39100.00%1100.00%
Total39100.00%1100.00%

struct zcomp_backend zcomp_lz4 = { .compress = zcomp_lz4_compress, .decompress = zcomp_lz4_decompress, .create = zcomp_lz4_create, .destroy = zcomp_lz4_destroy, .name = "lz4", };

Overall Contributors

PersonTokensPropCommitsCommitProp
sergey senozhatskysergey senozhatsky15180.32%250.00%
kyeongdon kimkyeongdon kim3317.55%125.00%
minchan kimminchan kim42.13%125.00%
Total188100.00%4100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}