dm-table.c (d2ce70a119f844225c10f133f8b957d540027b0f) dm-table.c (55a62eef8d1b50ceff3b7bf46851103bdcc7e5b0)
1/*
2 * Copyright (C) 2001 Sistina Software (UK) Limited.
3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

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

817
818 r = tgt->type->ctr(tgt, argc, argv);
819 kfree(argv);
820 if (r)
821 goto bad;
822
823 t->highs[t->num_targets++] = tgt->begin + tgt->len - 1;
824
1/*
2 * Copyright (C) 2001 Sistina Software (UK) Limited.
3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

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

817
818 r = tgt->type->ctr(tgt, argc, argv);
819 kfree(argv);
820 if (r)
821 goto bad;
822
823 t->highs[t->num_targets++] = tgt->begin + tgt->len - 1;
824
825 if (!tgt->num_discard_requests && tgt->discards_supported)
826 DMWARN("%s: %s: ignoring discards_supported because num_discard_requests is zero.",
825 if (!tgt->num_discard_bios && tgt->discards_supported)
826 DMWARN("%s: %s: ignoring discards_supported because num_discard_bios is zero.",
827 dm_device_name(t->md), type);
828
829 return 0;
830
831 bad:
832 DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);
833 dm_put_target_type(tgt->type);
834 return r;

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

1354 * Require at least one underlying device to support flushes.
1355 * t->devices includes internal dm devices such as mirror logs
1356 * so we need to use iterate_devices here, which targets
1357 * supporting flushes must provide.
1358 */
1359 while (i < dm_table_get_num_targets(t)) {
1360 ti = dm_table_get_target(t, i++);
1361
827 dm_device_name(t->md), type);
828
829 return 0;
830
831 bad:
832 DMERR("%s: %s: %s", dm_device_name(t->md), type, tgt->error);
833 dm_put_target_type(tgt->type);
834 return r;

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

1354 * Require at least one underlying device to support flushes.
1355 * t->devices includes internal dm devices such as mirror logs
1356 * so we need to use iterate_devices here, which targets
1357 * supporting flushes must provide.
1358 */
1359 while (i < dm_table_get_num_targets(t)) {
1360 ti = dm_table_get_target(t, i++);
1361
1362 if (!ti->num_flush_requests)
1362 if (!ti->num_flush_bios)
1363 continue;
1364
1365 if (ti->flush_supported)
1366 return 1;
1367
1368 if (ti->type->iterate_devices &&
1369 ti->type->iterate_devices(ti, device_flush_capable, &flush))
1370 return 1;

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

1433static bool dm_table_supports_write_same(struct dm_table *t)
1434{
1435 struct dm_target *ti;
1436 unsigned i = 0;
1437
1438 while (i < dm_table_get_num_targets(t)) {
1439 ti = dm_table_get_target(t, i++);
1440
1363 continue;
1364
1365 if (ti->flush_supported)
1366 return 1;
1367
1368 if (ti->type->iterate_devices &&
1369 ti->type->iterate_devices(ti, device_flush_capable, &flush))
1370 return 1;

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

1433static bool dm_table_supports_write_same(struct dm_table *t)
1434{
1435 struct dm_target *ti;
1436 unsigned i = 0;
1437
1438 while (i < dm_table_get_num_targets(t)) {
1439 ti = dm_table_get_target(t, i++);
1440
1441 if (!ti->num_write_same_requests)
1441 if (!ti->num_write_same_bios)
1442 return false;
1443
1444 if (!ti->type->iterate_devices ||
1445 !ti->type->iterate_devices(ti, device_not_write_same_capable, NULL))
1446 return false;
1447 }
1448
1449 return true;

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

1651 * require at least one underlying device to support discards.
1652 * t->devices includes internal dm devices such as mirror logs
1653 * so we need to use iterate_devices here, which targets
1654 * supporting discard selectively must provide.
1655 */
1656 while (i < dm_table_get_num_targets(t)) {
1657 ti = dm_table_get_target(t, i++);
1658
1442 return false;
1443
1444 if (!ti->type->iterate_devices ||
1445 !ti->type->iterate_devices(ti, device_not_write_same_capable, NULL))
1446 return false;
1447 }
1448
1449 return true;

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

1651 * require at least one underlying device to support discards.
1652 * t->devices includes internal dm devices such as mirror logs
1653 * so we need to use iterate_devices here, which targets
1654 * supporting discard selectively must provide.
1655 */
1656 while (i < dm_table_get_num_targets(t)) {
1657 ti = dm_table_get_target(t, i++);
1658
1659 if (!ti->num_discard_requests)
1659 if (!ti->num_discard_bios)
1660 continue;
1661
1662 if (ti->discards_supported)
1663 return 1;
1664
1665 if (ti->type->iterate_devices &&
1666 ti->type->iterate_devices(ti, device_discard_capable, NULL))
1667 return 1;
1668 }
1669
1670 return 0;
1671}
1660 continue;
1661
1662 if (ti->discards_supported)
1663 return 1;
1664
1665 if (ti->type->iterate_devices &&
1666 ti->type->iterate_devices(ti, device_discard_capable, NULL))
1667 return 1;
1668 }
1669
1670 return 0;
1671}