Deleted Added
full compact
vfs_bio.c (260385) vfs_bio.c (267494)
1/*-
2 * Copyright (c) 2004 Poul-Henning Kamp
3 * Copyright (c) 1994,1997 John S. Dyson
4 * Copyright (c) 2013 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Konstantin Belousov
8 * under sponsorship from the FreeBSD Foundation.

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

38 * Author: John S. Dyson
39 * Significant help during the development and debugging phases
40 * had been provided by David Greenman, also of the FreeBSD core team.
41 *
42 * see man buf(9) for more info.
43 */
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004 Poul-Henning Kamp
3 * Copyright (c) 1994,1997 John S. Dyson
4 * Copyright (c) 2013 The FreeBSD Foundation
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Konstantin Belousov
8 * under sponsorship from the FreeBSD Foundation.

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

38 * Author: John S. Dyson
39 * Significant help during the development and debugging phases
40 * had been provided by David Greenman, also of the FreeBSD core team.
41 *
42 * see man buf(9) for more info.
43 */
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: stable/10/sys/kern/vfs_bio.c 260385 2014-01-07 01:32:23Z scottl $");
46__FBSDID("$FreeBSD: stable/10/sys/kern/vfs_bio.c 267494 2014-06-15 05:15:38Z kib $");
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/bio.h>
51#include <sys/conf.h>
52#include <sys/buf.h>
53#include <sys/devicestat.h>
54#include <sys/eventhandler.h>

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

72#include <vm/vm_param.h>
73#include <vm/vm_kern.h>
74#include <vm/vm_pageout.h>
75#include <vm/vm_page.h>
76#include <vm/vm_object.h>
77#include <vm/vm_extern.h>
78#include <vm/vm_map.h>
79#include "opt_compat.h"
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/bio.h>
51#include <sys/conf.h>
52#include <sys/buf.h>
53#include <sys/devicestat.h>
54#include <sys/eventhandler.h>

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

72#include <vm/vm_param.h>
73#include <vm/vm_kern.h>
74#include <vm/vm_pageout.h>
75#include <vm/vm_page.h>
76#include <vm/vm_object.h>
77#include <vm/vm_extern.h>
78#include <vm/vm_map.h>
79#include "opt_compat.h"
80#include "opt_directio.h"
81#include "opt_swap.h"
82
83static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer");
84
85struct bio_ops bioops; /* I/O operation notification */
86
87struct buf_ops buf_ops_bio = {
88 .bop_name = "buf_ops_bio",

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

346 if (lvalue > INT_MAX)
347 /* On overflow, still write out a long to trigger ENOMEM. */
348 return (sysctl_handle_long(oidp, &lvalue, 0, req));
349 ivalue = lvalue;
350 return (sysctl_handle_int(oidp, &ivalue, 0, req));
351}
352#endif
353
80#include "opt_swap.h"
81
82static MALLOC_DEFINE(M_BIOBUF, "biobuf", "BIO buffer");
83
84struct bio_ops bioops; /* I/O operation notification */
85
86struct buf_ops buf_ops_bio = {
87 .bop_name = "buf_ops_bio",

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

345 if (lvalue > INT_MAX)
346 /* On overflow, still write out a long to trigger ENOMEM. */
347 return (sysctl_handle_long(oidp, &lvalue, 0, req));
348 ivalue = lvalue;
349 return (sysctl_handle_int(oidp, &ivalue, 0, req));
350}
351#endif
352
354#ifdef DIRECTIO
355extern void ffs_rawread_setup(void);
356#endif /* DIRECTIO */
357
358/*
359 * bqlock:
360 *
361 * Return the appropriate queue lock based on the index.
362 */
363static inline struct mtx *
364bqlock(int qindex)
365{

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

734 * swbufs are used as temporary holders for I/O, such as paging I/O.
735 * We have no less then 16 and no more then 256.
736 */
737 nswbuf = max(min(nbuf/4, 256), 16);
738#ifdef NSWBUF_MIN
739 if (nswbuf < NSWBUF_MIN)
740 nswbuf = NSWBUF_MIN;
741#endif
353/*
354 * bqlock:
355 *
356 * Return the appropriate queue lock based on the index.
357 */
358static inline struct mtx *
359bqlock(int qindex)
360{

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

729 * swbufs are used as temporary holders for I/O, such as paging I/O.
730 * We have no less then 16 and no more then 256.
731 */
732 nswbuf = max(min(nbuf/4, 256), 16);
733#ifdef NSWBUF_MIN
734 if (nswbuf < NSWBUF_MIN)
735 nswbuf = NSWBUF_MIN;
736#endif
742#ifdef DIRECTIO
743 ffs_rawread_setup();
744#endif
745
746 /*
747 * Reserve space for the buffer cache buffers
748 */
749 swbuf = (void *)v;
750 v = (caddr_t)(swbuf + nswbuf);
751 buf = (void *)v;
752 v = (caddr_t)(buf + nbuf);

--- 3835 unchanged lines hidden ---
737
738 /*
739 * Reserve space for the buffer cache buffers
740 */
741 swbuf = (void *)v;
742 v = (caddr_t)(swbuf + nswbuf);
743 buf = (void *)v;
744 v = (caddr_t)(buf + nbuf);

--- 3835 unchanged lines hidden ---