Deleted Added
full compact
md_intel.c (275876) md_intel.c (279878)
1/*-
2 * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2000 - 2008 S��ren Schmidt <sos@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
3 * Copyright (c) 2000 - 2008 S��ren Schmidt <sos@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/10/sys/geom/raid/md_intel.c 275876 2014-12-18 07:37:21Z mav $");
29__FBSDID("$FreeBSD: stable/10/sys/geom/raid/md_intel.c 279878 2015-03-11 09:50:31Z mav $");
30
31#include <sys/param.h>
32#include <sys/bio.h>
33#include <sys/endian.h>
34#include <sys/kernel.h>
35#include <sys/kobj.h>
36#include <sys/limits.h>
37#include <sys/lock.h>

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

1482 uint16_t vendor;
1483
1484 G_RAID_DEBUG(1, "Tasting Intel on %s", cp->provider->name);
1485 mdi = (struct g_raid_md_intel_object *)md;
1486 pp = cp->provider;
1487
1488 /* Read metadata from device. */
1489 meta = NULL;
30
31#include <sys/param.h>
32#include <sys/bio.h>
33#include <sys/endian.h>
34#include <sys/kernel.h>
35#include <sys/kobj.h>
36#include <sys/limits.h>
37#include <sys/lock.h>

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

1482 uint16_t vendor;
1483
1484 G_RAID_DEBUG(1, "Tasting Intel on %s", cp->provider->name);
1485 mdi = (struct g_raid_md_intel_object *)md;
1486 pp = cp->provider;
1487
1488 /* Read metadata from device. */
1489 meta = NULL;
1490 vendor = 0xffff;
1491 disk_pos = 0;
1492 g_topology_unlock();
1493 error = g_raid_md_get_label(cp, serial, sizeof(serial));
1494 if (error != 0) {
1495 G_RAID_DEBUG(1, "Cannot get serial number from %s (error=%d).",
1496 pp->name, error);
1497 goto fail2;
1498 }
1490 disk_pos = 0;
1491 g_topology_unlock();
1492 error = g_raid_md_get_label(cp, serial, sizeof(serial));
1493 if (error != 0) {
1494 G_RAID_DEBUG(1, "Cannot get serial number from %s (error=%d).",
1495 pp->name, error);
1496 goto fail2;
1497 }
1499 len = 2;
1498 vendor = 0xffff;
1499 len = sizeof(vendor);
1500 if (pp->geom->rank == 1)
1501 g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor);
1502 meta = intel_meta_read(cp);
1503 g_topology_lock();
1504 if (meta == NULL) {
1505 if (g_raid_aggressive_spare) {
1506 if (vendor != 0x8086) {
1507 G_RAID_DEBUG(1,

--- 1207 unchanged lines hidden ---
1500 if (pp->geom->rank == 1)
1501 g_io_getattr("GEOM::hba_vendor", cp, &len, &vendor);
1502 meta = intel_meta_read(cp);
1503 g_topology_lock();
1504 if (meta == NULL) {
1505 if (g_raid_aggressive_spare) {
1506 if (vendor != 0x8086) {
1507 G_RAID_DEBUG(1,

--- 1207 unchanged lines hidden ---