cregit-Linux how code gets into the kernel

Release 4.7 include/linux/task_io_accounting_ops.h

Directory: include/linux
/*
 * Task I/O accounting operations
 */
#ifndef __TASK_IO_ACCOUNTING_OPS_INCLUDED

#define __TASK_IO_ACCOUNTING_OPS_INCLUDED

#include <linux/sched.h>

#ifdef CONFIG_TASK_IO_ACCOUNTING

static inline void task_io_account_read(size_t bytes) { current->ioac.read_bytes += bytes; }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton18100.00%1100.00%
Total18100.00%1100.00%

/* * We approximate number of blocks, because we account bytes only. * A 'block' is 512 bytes */
static inline unsigned long task_io_get_inblock(const struct task_struct *p) { return p->ioac.read_bytes >> 9; }

Contributors

PersonTokensPropCommitsCommitProp
eric dumazeteric dumazet23100.00%1100.00%
Total23100.00%1100.00%


static inline void task_io_account_write(size_t bytes) { current->ioac.write_bytes += bytes; }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton18100.00%1100.00%
Total18100.00%1100.00%

/* * We approximate number of blocks, because we account bytes only. * A 'block' is 512 bytes */
static inline unsigned long task_io_get_oublock(const struct task_struct *p) { return p->ioac.write_bytes >> 9; }

Contributors

PersonTokensPropCommitsCommitProp
eric dumazeteric dumazet23100.00%1100.00%
Total23100.00%1100.00%


static inline void task_io_account_cancelled_write(size_t bytes) { current->ioac.cancelled_write_bytes += bytes; }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton18100.00%1100.00%
Total18100.00%1100.00%


static inline void task_io_accounting_init(struct task_io_accounting *ioac) { memset(ioac, 0, sizeof(*ioac)); }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton2288.00%133.33%
andrea righiandrea righi312.00%266.67%
Total25100.00%3100.00%


static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, struct task_io_accounting *src) { dst->read_bytes += src->read_bytes; dst->write_bytes += src->write_bytes; dst->cancelled_write_bytes += src->cancelled_write_bytes; }

Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi41100.00%2100.00%
Total41100.00%2100.00%

#else
static inline void task_io_account_read(size_t bytes) { }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton9100.00%1100.00%
Total9100.00%1100.00%


static inline unsigned long task_io_get_inblock(const struct task_struct *p) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
eric dumazeteric dumazet17100.00%1100.00%
Total17100.00%1100.00%


static inline void task_io_account_write(size_t bytes) { }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton9100.00%1100.00%
Total9100.00%1100.00%


static inline unsigned long task_io_get_oublock(const struct task_struct *p) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
eric dumazeteric dumazet17100.00%1100.00%
Total17100.00%1100.00%


static inline void task_io_account_cancelled_write(size_t bytes) { }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton9100.00%1100.00%
Total9100.00%1100.00%


static inline void task_io_accounting_init(struct task_io_accounting *ioac) { }

Contributors

PersonTokensPropCommitsCommitProp
andrew mortonandrew morton654.55%133.33%
andrea righiandrea righi545.45%266.67%
Total11100.00%3100.00%


static inline void task_blk_io_accounting_add(struct task_io_accounting *dst, struct task_io_accounting *src) { }

Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi1381.25%266.67%
andrew mortonandrew morton318.75%133.33%
Total16100.00%3100.00%

#endif /* CONFIG_TASK_IO_ACCOUNTING */ #ifdef CONFIG_TASK_XACCT
static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, struct task_io_accounting *src) { dst->rchar += src->rchar; dst->wchar += src->wchar; dst->syscr += src->syscr; dst->syscw += src->syscw; }

Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi49100.00%2100.00%
Total49100.00%2100.00%

#else
static inline void task_chr_io_accounting_add(struct task_io_accounting *dst, struct task_io_accounting *src) { }

Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi16100.00%2100.00%
Total16100.00%2100.00%

#endif /* CONFIG_TASK_XACCT */
static inline void task_io_accounting_add(struct task_io_accounting *dst, struct task_io_accounting *src) { task_chr_io_accounting_add(dst, src); task_blk_io_accounting_add(dst, src); }

Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi31100.00%2100.00%
Total31100.00%2100.00%

#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */

Overall Contributors

PersonTokensPropCommitsCommitProp
andrea righiandrea righi16643.57%240.00%
andrew mortonandrew morton13034.12%120.00%
eric dumazeteric dumazet8221.52%120.00%
alexey dobriyanalexey dobriyan30.79%120.00%
Total381100.00%5100.00%
Directory: include/linux
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}