cregit-Linux how code gets into the kernel

Release 4.7 include/crypto/scatterwalk.h

Directory: include/crypto
/*
 * Cryptographic scatter and gather helpers.
 *
 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
 * Copyright (c) 2002 Adam J. Richter <adam@yggdrasil.com>
 * Copyright (c) 2004 Jean-Luc Cooke <jlcooke@certainkey.com>
 * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
 *
 * 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.
 *
 */

#ifndef _CRYPTO_SCATTERWALK_H

#define _CRYPTO_SCATTERWALK_H

#include <asm/kmap_types.h>
#include <crypto/algapi.h>
#include <linux/hardirq.h>
#include <linux/highmem.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/scatterlist.h>
#include <linux/sched.h>


static inline void scatterwalk_crypto_chain(struct scatterlist *head, struct scatterlist *sg, int chain, int num) { if (chain) { head->length += sg->length; sg = sg_next(sg); } if (sg) sg_chain(head, num, sg); else sg_mark_end(head); }

Contributors

PersonTokensPropCommitsCommitProp
steffen klassertsteffen klassert6196.83%133.33%
dan williamsdan williams11.59%133.33%
cristian stoicacristian stoica11.59%133.33%
Total63100.00%3100.00%


static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, struct scatter_walk *walk_out) { return !(((sg_page(walk_in->sg) - sg_page(walk_out->sg)) << PAGE_SHIFT) + (int)(walk_in->offset - walk_out->offset)); }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu2341.82%125.00%
andrew mortonandrew morton2240.00%125.00%
jens axboejens axboe610.91%125.00%
christophe saoutchristophe saout47.27%125.00%
Total55100.00%4100.00%


static inline unsigned int scatterwalk_pagelen(struct scatter_walk *walk) { unsigned int len = walk->sg->offset + walk->sg->length - walk->offset; unsigned int len_this_page = offset_in_page(~walk->offset) + 1; return len_this_page > len ? len : len_this_page; }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu5496.43%150.00%
andrew mortonandrew morton23.57%150.00%
Total56100.00%2100.00%


static inline unsigned int scatterwalk_clamp(struct scatter_walk *walk, unsigned int nbytes) { unsigned int len_this_page = scatterwalk_pagelen(walk); return nbytes > len_this_page ? len_this_page : nbytes; }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu2571.43%375.00%
andrew mortonandrew morton1028.57%125.00%
Total35100.00%4100.00%


static inline void scatterwalk_advance(struct scatter_walk *walk, unsigned int nbytes) { walk->offset += nbytes; }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu22100.00%1100.00%
Total22100.00%1100.00%


static inline unsigned int scatterwalk_aligned(struct scatter_walk *walk, unsigned int alignmask) { return !(walk->offset & alignmask); }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu27100.00%1100.00%
Total27100.00%1100.00%


static inline struct page *scatterwalk_page(struct scatter_walk *walk) { return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu2790.00%150.00%
jens axboejens axboe310.00%150.00%
Total30100.00%2100.00%


static inline void scatterwalk_unmap(void *vaddr) { kunmap_atomic(vaddr); }

Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu1593.75%150.00%
americo wangamerico wang16.25%150.00%
Total16100.00%2100.00%

void scatterwalk_start(struct scatter_walk *walk, struct scatterlist *sg); void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, size_t nbytes, int out); void *scatterwalk_map(struct scatter_walk *walk); void scatterwalk_done(struct scatter_walk *walk, int out, int more); void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, unsigned int start, unsigned int nbytes, int out); int scatterwalk_bytes_sglen(struct scatterlist *sg, int num_bytes); struct scatterlist *scatterwalk_ffwd(struct scatterlist dst[2], struct scatterlist *src, unsigned int len); #endif /* _CRYPTO_SCATTERWALK_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
herbert xuherbert xu26257.71%950.00%
andrew mortonandrew morton10322.69%211.11%
steffen klassertsteffen klassert6113.44%15.56%
joel fernandesjoel fernandes122.64%15.56%
jens axboejens axboe91.98%15.56%
christophe saoutchristophe saout40.88%15.56%
americo wangamerico wang10.22%15.56%
cristian stoicacristian stoica10.22%15.56%
dan williamsdan williams10.22%15.56%
Total454100.00%18100.00%
Directory: include/crypto
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}