dm-table.c (5af8c4e0fac9838428bd718040b664043a05f37c) dm-table.c (9c47008d13add50ec4597a8b9eee200c515282c8)
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"

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

874 for (k = 0; k < KEYS_PER_NODE; k++)
875 if (node[k] >= sector)
876 break;
877 }
878
879 return &t->targets[(KEYS_PER_NODE * n) + k];
880}
881
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"

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

874 for (k = 0; k < KEYS_PER_NODE; k++)
875 if (node[k] >= sector)
876 break;
877 }
878
879 return &t->targets[(KEYS_PER_NODE * n) + k];
880}
881
882/*
883 * Set the integrity profile for this device if all devices used have
884 * matching profiles.
885 */
886static void dm_table_set_integrity(struct dm_table *t)
887{
888 struct list_head *devices = dm_table_get_devices(t);
889 struct dm_dev_internal *prev = NULL, *dd = NULL;
890
891 if (!blk_get_integrity(dm_disk(t->md)))
892 return;
893
894 list_for_each_entry(dd, devices, list) {
895 if (prev &&
896 blk_integrity_compare(prev->dm_dev.bdev->bd_disk,
897 dd->dm_dev.bdev->bd_disk) < 0) {
898 DMWARN("%s: integrity not set: %s and %s mismatch",
899 dm_device_name(t->md),
900 prev->dm_dev.bdev->bd_disk->disk_name,
901 dd->dm_dev.bdev->bd_disk->disk_name);
902 goto no_integrity;
903 }
904 prev = dd;
905 }
906
907 if (!prev || !bdev_get_integrity(prev->dm_dev.bdev))
908 goto no_integrity;
909
910 blk_integrity_register(dm_disk(t->md),
911 bdev_get_integrity(prev->dm_dev.bdev));
912
913 return;
914
915no_integrity:
916 blk_integrity_register(dm_disk(t->md), NULL);
917
918 return;
919}
920
882void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
883{
884 /*
885 * Make sure we obey the optimistic sub devices
886 * restrictions.
887 */
888 blk_queue_max_sectors(q, t->limits.max_sectors);
889 q->max_phys_segments = t->limits.max_phys_segments;

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

894 q->seg_boundary_mask = t->limits.seg_boundary_mask;
895 q->bounce_pfn = t->limits.bounce_pfn;
896
897 if (t->limits.no_cluster)
898 queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
899 else
900 queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q);
901
921void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
922{
923 /*
924 * Make sure we obey the optimistic sub devices
925 * restrictions.
926 */
927 blk_queue_max_sectors(q, t->limits.max_sectors);
928 q->max_phys_segments = t->limits.max_phys_segments;

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

933 q->seg_boundary_mask = t->limits.seg_boundary_mask;
934 q->bounce_pfn = t->limits.bounce_pfn;
935
936 if (t->limits.no_cluster)
937 queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q);
938 else
939 queue_flag_set_unlocked(QUEUE_FLAG_CLUSTER, q);
940
941 dm_table_set_integrity(t);
902}
903
904unsigned int dm_table_get_num_targets(struct dm_table *t)
905{
906 return t->num_targets;
907}
908
909struct list_head *dm_table_get_devices(struct dm_table *t)

--- 128 unchanged lines hidden ---
942}
943
944unsigned int dm_table_get_num_targets(struct dm_table *t)
945{
946 return t->num_targets;
947}
948
949struct list_head *dm_table_get_devices(struct dm_table *t)

--- 128 unchanged lines hidden ---