dm-ioctl.c (b7db9956e57c8151b930d5e5fe5c766e6aad3ff7) dm-ioctl.c (82b1519b345d61dcfae526e3fcb08128f39f9bcc)
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"

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

421 * Now loop through filling out the names.
422 */
423 for (i = 0; i < NUM_BUCKETS; i++) {
424 list_for_each_entry (hc, _name_buckets + i, name_list) {
425 if (old_nl)
426 old_nl->next = (uint32_t) ((void *) nl -
427 (void *) old_nl);
428 disk = dm_disk(hc->md);
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"

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

421 * Now loop through filling out the names.
422 */
423 for (i = 0; i < NUM_BUCKETS; i++) {
424 list_for_each_entry (hc, _name_buckets + i, name_list) {
425 if (old_nl)
426 old_nl->next = (uint32_t) ((void *) nl -
427 (void *) old_nl);
428 disk = dm_disk(hc->md);
429 nl->dev = huge_encode_dev(disk_devt(disk));
429 nl->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor));
430 nl->next = 0;
431 strcpy(nl->name, hc->name);
432
433 old_nl = nl;
434 nl = align_ptr(((void *) ++nl) + strlen(hc->name) + 1);
435 }
436 }
437

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

534 struct dm_table *table;
535
536 param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG |
537 DM_ACTIVE_PRESENT_FLAG);
538
539 if (dm_suspended(md))
540 param->flags |= DM_SUSPEND_FLAG;
541
430 nl->next = 0;
431 strcpy(nl->name, hc->name);
432
433 old_nl = nl;
434 nl = align_ptr(((void *) ++nl) + strlen(hc->name) + 1);
435 }
436 }
437

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

534 struct dm_table *table;
535
536 param->flags &= ~(DM_SUSPEND_FLAG | DM_READONLY_FLAG |
537 DM_ACTIVE_PRESENT_FLAG);
538
539 if (dm_suspended(md))
540 param->flags |= DM_SUSPEND_FLAG;
541
542 param->dev = huge_encode_dev(disk_devt(disk));
542 param->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor));
543
544 /*
545 * Yes, this will be out of date by the time it gets back
546 * to userland, but it is still very useful for
547 * debugging.
548 */
549 param->open_count = dm_open_count(md);
550
543
544 /*
545 * Yes, this will be out of date by the time it gets back
546 * to userland, but it is still very useful for
547 * debugging.
548 */
549 param->open_count = dm_open_count(md);
550
551 if (get_disk_ro(disk))
551 if (disk->policy)
552 param->flags |= DM_READONLY_FLAG;
553
554 param->event_nr = dm_get_event_nr(md);
555
556 table = dm_get_table(md);
557 if (table) {
558 param->flags |= DM_ACTIVE_PRESENT_FLAG;
559 param->target_count = dm_table_get_num_targets(table);

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

1126 * Retrieves a list of devices used by a particular dm device.
1127 */
1128static void retrieve_deps(struct dm_table *table,
1129 struct dm_ioctl *param, size_t param_size)
1130{
1131 unsigned int count = 0;
1132 struct list_head *tmp;
1133 size_t len, needed;
552 param->flags |= DM_READONLY_FLAG;
553
554 param->event_nr = dm_get_event_nr(md);
555
556 table = dm_get_table(md);
557 if (table) {
558 param->flags |= DM_ACTIVE_PRESENT_FLAG;
559 param->target_count = dm_table_get_num_targets(table);

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

1126 * Retrieves a list of devices used by a particular dm device.
1127 */
1128static void retrieve_deps(struct dm_table *table,
1129 struct dm_ioctl *param, size_t param_size)
1130{
1131 unsigned int count = 0;
1132 struct list_head *tmp;
1133 size_t len, needed;
1134 struct dm_dev *dd;
1134 struct dm_dev_internal *dd;
1135 struct dm_target_deps *deps;
1136
1137 deps = get_result_buffer(param, param_size, &len);
1138
1139 /*
1140 * Count the devices.
1141 */
1142 list_for_each (tmp, dm_table_get_devices(table))

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

1152 }
1153
1154 /*
1155 * Fill in the devices.
1156 */
1157 deps->count = count;
1158 count = 0;
1159 list_for_each_entry (dd, dm_table_get_devices(table), list)
1135 struct dm_target_deps *deps;
1136
1137 deps = get_result_buffer(param, param_size, &len);
1138
1139 /*
1140 * Count the devices.
1141 */
1142 list_for_each (tmp, dm_table_get_devices(table))

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

1152 }
1153
1154 /*
1155 * Fill in the devices.
1156 */
1157 deps->count = count;
1158 count = 0;
1159 list_for_each_entry (dd, dm_table_get_devices(table), list)
1160 deps->dev[count++] = huge_encode_dev(dd->bdev->bd_dev);
1160 deps->dev[count++] = huge_encode_dev(dd->dm_dev.bdev->bd_dev);
1161
1162 param->data_size = param->data_start + needed;
1163}
1164
1165static int table_deps(struct dm_ioctl *param, size_t param_size)
1166{
1167 int r = 0;
1168 struct mapped_device *md;

--- 393 unchanged lines hidden ---
1161
1162 param->data_size = param->data_start + needed;
1163}
1164
1165static int table_deps(struct dm_ioctl *param, size_t param_size)
1166{
1167 int r = 0;
1168 struct mapped_device *md;

--- 393 unchanged lines hidden ---