enum notifier_state { /* Notifications are allowed but not in progress */
MAY_NOTIFY, /* A notification is in progress */
NOTIFYING, /* Notifications are not allowed */
MAY_NOT_NOTIFY, /* A notification has completed */
NOTIFIED,
};
/** * typedef vdo_read_only_notification_fn - A function to notify a listener that the VDO has gone * read-only. * @listener: The object to notify. * @parent: The completion to notify in order to acknowledge the notification.
*/ typedefvoid (*vdo_read_only_notification_fn)(void *listener, struct vdo_completion *parent);
/* * An object to be notified when the VDO enters read-only mode
*/ struct read_only_listener { /* The listener */ void *listener; /* The method to call to notify the listener */
vdo_read_only_notification_fn notify; /* A pointer to the next listener */ struct read_only_listener *next;
};
struct vdo_thread { struct vdo *vdo;
thread_id_t thread_id; struct vdo_work_queue *queue; /* * Each thread maintains its own notion of whether the VDO is read-only so that the * read-only state can be checked from any base thread without worrying about * synchronization or thread safety. This does mean that knowledge of the VDO going * read-only does not occur simultaneously across the VDO's threads, but that does not seem * to cause any problems.
*/ bool is_read_only; /* * A list of objects waiting to be notified on this thread that the VDO has entered * read-only mode.
*/ struct read_only_listener *listeners; struct registered_thread allocating_thread;
};
/* Keep struct bio statistics atomically */ struct atomic_bio_stats {
atomic64_t read; /* Number of not REQ_WRITE bios */
atomic64_t write; /* Number of REQ_WRITE bios */
atomic64_t discard; /* Number of REQ_DISCARD bios */
atomic64_t flush; /* Number of REQ_FLUSH bios */
atomic64_t empty_flush; /* Number of REQ_PREFLUSH bios without data */
atomic64_t fua; /* Number of REQ_FUA bios */
};
struct read_only_notifier { /* The completion for entering read-only mode */ struct vdo_completion completion; /* A completion waiting for notifications to be drained or enabled */ struct vdo_completion *waiter; /* Lock to protect the next two fields */
spinlock_t lock; /* The code of the error which put the VDO into read-only mode */ int read_only_error; /* The current state of the notifier (values described above) */ enum notifier_state state;
};
/* * The thread ID returned when the current thread is not a vdo thread, or can not be determined * (usually due to being at interrupt context).
*/ #define VDO_INVALID_THREAD_ID ((thread_id_t) -1)
struct vdo_super_block { /* The vio for reading and writing the super block to disk */ struct vio vio; /* A buffer to hold the super block */
u8 *buffer; /* Whether this super block may not be written */ bool unwritable;
};
/* The atomic version of the state of this vdo */
atomic_t state; /* The full state of all components */ struct vdo_component_states states; /* * A counter value to attach to thread names and log messages to identify the individual * device.
*/ unsignedint instance; /* The read-only notifier */ struct read_only_notifier read_only_notifier; /* The load-time configuration of this vdo */ struct device_config *device_config; /* The thread mapping */ struct thread_config thread_config;
/* The super block */ struct vdo_super_block super_block;
/* The partitioning of the underlying storage */ struct layout layout; struct layout next_layout; struct dm_kcopyd_client *partition_copier;
/* The block map */ struct block_map *block_map;
/* The journal for block map recovery */ struct recovery_journal *recovery_journal;
/* The slab depot */ struct slab_depot *depot;
/* The compressed-block packer */ struct packer *packer; /* Whether incoming data should be compressed */ bool compressing;
/* The handler for flush requests */ struct flusher *flusher;
/* The state the vdo was in when loaded (primarily for unit tests) */ enum vdo_state load_state;
/* The logical zones of this vdo */ struct logical_zones *logical_zones;
/* The physical zones of this vdo */ struct physical_zones *physical_zones;
/* The hash lock zones of this vdo */ struct hash_zones *hash_zones;
/* Bio submission manager used for sending bios to the storage device. */ struct io_submitter *io_submitter;
/* The pool of data_vios for servicing incoming bios */ struct data_vio_pool *data_vio_pool;
/* The manager for administrative operations */ struct vdo_administrator admin;
/* N blobs of context data for LZ4 code, one per CPU thread. */ char **compression_context;
};
/** * vdo_uses_bio_ack_queue() - Indicate whether the vdo is configured to use a separate work queue * for acknowledging received and processed bios. * @vdo: The vdo. * * Note that this directly controls the handling of write operations, but the compile-time flag * VDO_USE_BIO_ACK_QUEUE_FOR_READ is also checked for read operations. * * Return: Whether a bio-acknowledgement work queue is in use.
*/ staticinlinebool vdo_uses_bio_ack_queue(struct vdo *vdo)
{ return vdo->device_config->thread_counts.bio_ack_threads > 0;
}
/** * typedef vdo_filter_fn - Method type for vdo matching methods. * * A filter function returns false if the vdo doesn't match.
*/ typedefbool (*vdo_filter_fn)(struct vdo *vdo, constvoid *context);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.