dm-table.c (cc6cbe141a20f6d876b161b60af38d93935bfa85) dm-table.c (36a0456fbf2d9680bf9af81b39daf4a8e22cb1b8)
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"

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

49 unsigned int counts[MAX_DEPTH]; /* in nodes */
50 sector_t *index[MAX_DEPTH];
51
52 unsigned int num_targets;
53 unsigned int num_allocated;
54 sector_t *highs;
55 struct dm_target *targets;
56
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"

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

49 unsigned int counts[MAX_DEPTH]; /* in nodes */
50 sector_t *index[MAX_DEPTH];
51
52 unsigned int num_targets;
53 unsigned int num_allocated;
54 sector_t *highs;
55 struct dm_target *targets;
56
57 struct target_type *immutable_target_type;
57 unsigned integrity_supported:1;
58 unsigned singleton:1;
59
60 /*
61 * Indicates the rw permissions for the new logical
62 * device. This should be a combination of FMODE_READ
63 * and FMODE_WRITE.
64 */

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

775 }
776
777 if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) {
778 DMERR("%s: target type %s may not be included in read-only tables",
779 dm_device_name(t->md), type);
780 return -EINVAL;
781 }
782
58 unsigned integrity_supported:1;
59 unsigned singleton:1;
60
61 /*
62 * Indicates the rw permissions for the new logical
63 * device. This should be a combination of FMODE_READ
64 * and FMODE_WRITE.
65 */

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

776 }
777
778 if (dm_target_always_writeable(tgt->type) && !(t->mode & FMODE_WRITE)) {
779 DMERR("%s: target type %s may not be included in read-only tables",
780 dm_device_name(t->md), type);
781 return -EINVAL;
782 }
783
784 if (t->immutable_target_type) {
785 if (t->immutable_target_type != tgt->type) {
786 DMERR("%s: immutable target type %s cannot be mixed with other target types",
787 dm_device_name(t->md), t->immutable_target_type->name);
788 return -EINVAL;
789 }
790 } else if (dm_target_is_immutable(tgt->type)) {
791 if (t->num_targets) {
792 DMERR("%s: immutable target type %s cannot be mixed with other target types",
793 dm_device_name(t->md), tgt->type->name);
794 return -EINVAL;
795 }
796 t->immutable_target_type = tgt->type;
797 }
798
783 tgt->table = t;
784 tgt->begin = start;
785 tgt->len = len;
786 tgt->error = "Unknown error";
787
788 /*
789 * Does this target adjoin the previous one ?
790 */

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

932 return 0;
933}
934
935unsigned dm_table_get_type(struct dm_table *t)
936{
937 return t->type;
938}
939
799 tgt->table = t;
800 tgt->begin = start;
801 tgt->len = len;
802 tgt->error = "Unknown error";
803
804 /*
805 * Does this target adjoin the previous one ?
806 */

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

948 return 0;
949}
950
951unsigned dm_table_get_type(struct dm_table *t)
952{
953 return t->type;
954}
955
956struct target_type *dm_table_get_immutable_target_type(struct dm_table *t)
957{
958 return t->immutable_target_type;
959}
960
940bool dm_table_request_based(struct dm_table *t)
941{
942 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
943}
944
945int dm_table_alloc_md_mempools(struct dm_table *t)
946{
947 unsigned type = dm_table_get_type(t);

--- 608 unchanged lines hidden ---
961bool dm_table_request_based(struct dm_table *t)
962{
963 return dm_table_get_type(t) == DM_TYPE_REQUEST_BASED;
964}
965
966int dm_table_alloc_md_mempools(struct dm_table *t)
967{
968 unsigned type = dm_table_get_type(t);

--- 608 unchanged lines hidden ---