Deleted Added
full compact
g_cache.c (227309) g_cache.c (243333)
1/*-
2 * Copyright (c) 2006 Ruslan Ermilov <ru@FreeBSD.org>
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 Ruslan Ermilov <ru@FreeBSD.org>
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/cache/g_cache.c 227309 2011-11-07 15:43:11Z ed $");
28__FBSDID("$FreeBSD: head/sys/geom/cache/g_cache.c 243333 2012-11-20 12:32:18Z jh $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/lock.h>
35#include <sys/mutex.h>
36#include <sys/bio.h>

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

497 }
498
499 /* Check for duplicate unit. */
500 if (g_cache_find_device(mp, (const char *)&md->md_name) != NULL) {
501 G_CACHE_DEBUG(0, "Provider %s already exists.", md->md_name);
502 return (NULL);
503 }
504
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/lock.h>
35#include <sys/mutex.h>
36#include <sys/bio.h>

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

497 }
498
499 /* Check for duplicate unit. */
500 if (g_cache_find_device(mp, (const char *)&md->md_name) != NULL) {
501 G_CACHE_DEBUG(0, "Provider %s already exists.", md->md_name);
502 return (NULL);
503 }
504
505 gp = g_new_geomf(mp, md->md_name);
505 gp = g_new_geomf(mp, "%s", md->md_name);
506 sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
507 sc->sc_type = type;
508 sc->sc_bshift = bshift;
509 sc->sc_bsize = 1 << bshift;
510 sc->sc_zone = uma_zcreate("gcache", sc->sc_bsize, NULL, NULL, NULL, NULL,
511 UMA_ALIGN_PTR, 0);
512 mtx_init(&sc->sc_mtx, "GEOM CACHE mutex", NULL, MTX_DEF);
513 for (i = 0; i < G_CACHE_BUCKETS; i++)

--- 503 unchanged lines hidden ---
506 sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
507 sc->sc_type = type;
508 sc->sc_bshift = bshift;
509 sc->sc_bsize = 1 << bshift;
510 sc->sc_zone = uma_zcreate("gcache", sc->sc_bsize, NULL, NULL, NULL, NULL,
511 UMA_ALIGN_PTR, 0);
512 mtx_init(&sc->sc_mtx, "GEOM CACHE mutex", NULL, MTX_DEF);
513 for (i = 0; i < G_CACHE_BUCKETS; i++)

--- 503 unchanged lines hidden ---