cregit-Linux how code gets into the kernel

Release 4.12 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 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 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 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 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 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 Morton2288.00%133.33%
Andrea 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 Righi41100.00%2100.00%
Total41100.00%2100.00%

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

Contributors

PersonTokensPropCommitsCommitProp
Andrew 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 Dumazet17100.00%1100.00%
Total17100.00%1100.00%


static inline void task_io_account_write(size_t bytes) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrew 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 Dumazet17100.00%1100.00%
Total17100.00%1100.00%


static inline void task_io_account_cancelled_write(size_t bytes) { }

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton9100.00%1100.00%
Total9100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Andrew Morton654.55%133.33%
Andrea 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 Righi1381.25%266.67%
Andrew 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 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 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 Righi31100.00%2100.00%
Total31100.00%2100.00%

#endif /* __TASK_IO_ACCOUNTING_OPS_INCLUDED */

Overall Contributors

PersonTokensPropCommitsCommitProp
Andrea Righi16643.57%240.00%
Andrew Morton13034.12%120.00%
Eric Dumazet8221.52%120.00%
Alexey 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.
Created with cregit.