Deleted Added
full compact
kern_physio.c (295707) kern_physio.c (297633)
1/*-
2 * Copyright (c) 1994 John S. Dyson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 4 unchanged lines hidden (view full) ---

13 * documentation and/or other materials provided with the distribution.
14 * 3. Absolutely no warranty of function or purpose is made by the author
15 * John S. Dyson.
16 * 4. Modifications may be freely made to this file if the above conditions
17 * are met.
18 */
19
20#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1994 John S. Dyson
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 4 unchanged lines hidden (view full) ---

13 * documentation and/or other materials provided with the distribution.
14 * 3. Absolutely no warranty of function or purpose is made by the author
15 * John S. Dyson.
16 * 4. Modifications may be freely made to this file if the above conditions
17 * are met.
18 */
19
20#include <sys/cdefs.h>
21__FBSDID("$FreeBSD: head/sys/kern/kern_physio.c 295707 2016-02-17 17:16:02Z imp $");
21__FBSDID("$FreeBSD: head/sys/kern/kern_physio.c 297633 2016-04-07 04:23:25Z trasz $");
22
23#include <sys/param.h>
24#include <sys/systm.h>
25#include <sys/bio.h>
26#include <sys/buf.h>
27#include <sys/conf.h>
28#include <sys/malloc.h>
29#include <sys/proc.h>
22
23#include <sys/param.h>
24#include <sys/systm.h>
25#include <sys/bio.h>
26#include <sys/buf.h>
27#include <sys/conf.h>
28#include <sys/malloc.h>
29#include <sys/proc.h>
30#include <sys/racct.h>
30#include <sys/uio.h>
31#include <geom/geom.h>
32
33#include <vm/vm.h>
34#include <vm/vm_page.h>
35#include <vm/vm_extern.h>
36#include <vm/vm_map.h>
37

--- 66 unchanged lines hidden (view full) ---

104 maxpages = btoc(MAXPHYS);
105 pages = pbuf->b_pages;
106 }
107 prot = VM_PROT_READ;
108 if (uio->uio_rw == UIO_READ)
109 prot |= VM_PROT_WRITE; /* Less backwards than it looks */
110 error = 0;
111 for (i = 0; i < uio->uio_iovcnt; i++) {
31#include <sys/uio.h>
32#include <geom/geom.h>
33
34#include <vm/vm.h>
35#include <vm/vm_page.h>
36#include <vm/vm_extern.h>
37#include <vm/vm_map.h>
38

--- 66 unchanged lines hidden (view full) ---

105 maxpages = btoc(MAXPHYS);
106 pages = pbuf->b_pages;
107 }
108 prot = VM_PROT_READ;
109 if (uio->uio_rw == UIO_READ)
110 prot |= VM_PROT_WRITE; /* Less backwards than it looks */
111 error = 0;
112 for (i = 0; i < uio->uio_iovcnt; i++) {
113#ifdef RACCT
114 if (racct_enable) {
115 PROC_LOCK(curproc);
116 if (uio->uio_rw == UIO_READ) {
117 racct_add_force(curproc, RACCT_READBPS,
118 uio->uio_iov[i].iov_len);
119 racct_add_force(curproc, RACCT_READIOPS, 1);
120 } else {
121 racct_add_force(curproc, RACCT_WRITEBPS,
122 uio->uio_iov[i].iov_len);
123 racct_add_force(curproc, RACCT_WRITEIOPS, 1);
124 }
125 PROC_UNLOCK(curproc);
126 }
127#endif /* RACCT */
128
112 while (uio->uio_iov[i].iov_len) {
113 g_reset_bio(bp);
114 if (uio->uio_rw == UIO_READ) {
115 bp->bio_cmd = BIO_READ;
116 curthread->td_ru.ru_inblock++;
117 } else {
118 bp->bio_cmd = BIO_WRITE;
119 curthread->td_ru.ru_oublock++;

--- 89 unchanged lines hidden ---
129 while (uio->uio_iov[i].iov_len) {
130 g_reset_bio(bp);
131 if (uio->uio_rw == UIO_READ) {
132 bp->bio_cmd = BIO_READ;
133 curthread->td_ru.ru_inblock++;
134 } else {
135 bp->bio_cmd = BIO_WRITE;
136 curthread->td_ru.ru_oublock++;

--- 89 unchanged lines hidden ---