1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: relocate segment flags

Move flags for segments to segtype header where it seems more closely
related as the features are related to segtype and not activation.

Use unsigned #define - since it's more common in lvm2 source code
for bit flags.
This commit is contained in:
Zdenek Kabelac 2014-02-27 14:46:11 +01:00
parent 47b15b805e
commit 07ba047116
2 changed files with 15 additions and 25 deletions

View File

@ -52,31 +52,6 @@ struct lv_activate_opts {
* that follows. */
};
/* target attribute flags */
#define MIRROR_LOG_CLUSTERED 0x00000001U
/* snapshot target attribute flags */
enum {
SNAPSHOT_FEATURE_FIXED_LEAK = (1 << 0), /* version 1.12 */
};
/* thin target attribute flags */
enum {
/* bitfields - new features from 1.1 version */
THIN_FEATURE_DISCARDS = (1 << 0),
THIN_FEATURE_EXTERNAL_ORIGIN = (1 << 1),
THIN_FEATURE_HELD_ROOT = (1 << 2),
THIN_FEATURE_BLOCK_SIZE = (1 << 3),
THIN_FEATURE_DISCARDS_NON_POWER_2 = (1 << 4),
THIN_FEATURE_METADATA_RESIZE = (1 << 5),
THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND = (1 << 6),
};
/* raid target attribute flags */
enum {
RAID_FEATURE_RAID10 = (1 << 0), /* version 1.3 */
};
void set_activation(int activation);
int activation(void);

View File

@ -141,6 +141,9 @@ struct segment_type *init_error_segtype(struct cmd_context *cmd);
struct segment_type *init_free_segtype(struct cmd_context *cmd);
struct segment_type *init_unknown_segtype(struct cmd_context *cmd,
const char *name);
#define RAID_FEATURE_RAID10 (1U << 0) /* version 1.3 */
#ifdef RAID_INTERNAL
int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
@ -149,6 +152,14 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
int init_replicator_segtype(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
#define THIN_FEATURE_DISCARDS (1U << 0)
#define THIN_FEATURE_EXTERNAL_ORIGIN (1U << 1)
#define THIN_FEATURE_HELD_ROOT (1U << 2)
#define THIN_FEATURE_BLOCK_SIZE (1U << 3)
#define THIN_FEATURE_DISCARDS_NON_POWER_2 (1U << 4)
#define THIN_FEATURE_METADATA_RESIZE (1U << 5)
#define THIN_FEATURE_EXTERNAL_ORIGIN_EXTEND (1U << 6)
#ifdef THIN_INTERNAL
int init_thin_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
@ -157,10 +168,14 @@ int init_thin_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
int init_cache_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
#endif
#define SNAPSHOT_FEATURE_FIXED_LEAK (1U << 0) /* version 1.12 */
#ifdef SNAPSHOT_INTERNAL
struct segment_type *init_snapshot_segtype(struct cmd_context *cmd);
#endif
#define MIRROR_LOG_CLUSTERED (1U << 0)
#ifdef MIRRORED_INTERNAL
struct segment_type *init_mirrored_segtype(struct cmd_context *cmd);
#endif