dm-ioctl.c (5af8c4e0fac9838428bd718040b664043a05f37c) dm-ioctl.c (9c47008d13add50ec4597a8b9eee200c515282c8)
1/*
2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
3 * Copyright (C) 2004 - 2006 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

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

1042 }
1043
1044 next = spec->next;
1045 }
1046
1047 return dm_table_complete(table);
1048}
1049
1/*
2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
3 * Copyright (C) 2004 - 2006 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

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

1042 }
1043
1044 next = spec->next;
1045 }
1046
1047 return dm_table_complete(table);
1048}
1049
1050static int table_prealloc_integrity(struct dm_table *t,
1051 struct mapped_device *md)
1052{
1053 struct list_head *devices = dm_table_get_devices(t);
1054 struct dm_dev_internal *dd;
1055
1056 list_for_each_entry(dd, devices, list)
1057 if (bdev_get_integrity(dd->dm_dev.bdev))
1058 return blk_integrity_register(dm_disk(md), NULL);
1059
1060 return 0;
1061}
1062
1050static int table_load(struct dm_ioctl *param, size_t param_size)
1051{
1052 int r;
1053 struct hash_cell *hc;
1054 struct dm_table *t;
1055 struct mapped_device *md;
1056
1057 md = find_device(param);

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

1063 goto out;
1064
1065 r = populate_table(t, param, param_size);
1066 if (r) {
1067 dm_table_destroy(t);
1068 goto out;
1069 }
1070
1063static int table_load(struct dm_ioctl *param, size_t param_size)
1064{
1065 int r;
1066 struct hash_cell *hc;
1067 struct dm_table *t;
1068 struct mapped_device *md;
1069
1070 md = find_device(param);

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

1076 goto out;
1077
1078 r = populate_table(t, param, param_size);
1079 if (r) {
1080 dm_table_destroy(t);
1081 goto out;
1082 }
1083
1084 r = table_prealloc_integrity(t, md);
1085 if (r) {
1086 DMERR("%s: could not register integrity profile.",
1087 dm_device_name(md));
1088 dm_table_destroy(t);
1089 goto out;
1090 }
1091
1071 down_write(&_hash_lock);
1072 hc = dm_get_mdptr(md);
1073 if (!hc || hc->md != md) {
1074 DMWARN("device has been removed from the dev hash table.");
1075 dm_table_destroy(t);
1076 up_write(&_hash_lock);
1077 r = -ENXIO;
1078 goto out;

--- 484 unchanged lines hidden ---
1092 down_write(&_hash_lock);
1093 hc = dm_get_mdptr(md);
1094 if (!hc || hc->md != md) {
1095 DMWARN("device has been removed from the dev hash table.");
1096 dm_table_destroy(t);
1097 up_write(&_hash_lock);
1098 r = -ENXIO;
1099 goto out;

--- 484 unchanged lines hidden ---