struct pooled_vio { /* The underlying vio */ struct vio vio; /* The list entry for chaining pooled vios together */ struct list_head list_entry; /* The context set by the pool */ void *context; /* The list entry used by the pool */ struct list_head pool_entry; /* The pool this vio is allocated from */ struct vio_pool *pool;
};
/** * as_vio() - Convert a generic vdo_completion to a vio. * @completion: The completion to convert. * * Return: The completion as a vio.
*/ staticinlinestruct vio *as_vio(struct vdo_completion *completion)
{
vdo_assert_completion_type(completion, VIO_COMPLETION); return container_of(completion, struct vio, completion);
}
/** * get_vio_bio_zone_thread_id() - Get the thread id of the bio zone in which a vio should submit * its I/O. * @vio: The vio. * * Return: The id of the bio zone thread the vio should use.
*/ staticinline thread_id_t __must_check get_vio_bio_zone_thread_id(struct vio *vio)
{ return vio->completion.vdo->thread_config.bio_threads[vio->bio_zone];
}
physical_block_number_t __must_check pbn_from_vio_bio(struct bio *bio);
/** * assert_vio_in_bio_zone() - Check that a vio is running on the correct thread for its bio zone. * @vio: The vio to check.
*/ staticinlinevoid assert_vio_in_bio_zone(struct vio *vio)
{
thread_id_t expected = get_vio_bio_zone_thread_id(vio);
thread_id_t thread_id = vdo_get_callback_thread_id();
VDO_ASSERT_LOG_ONLY((expected == thread_id), "vio I/O for physical block %llu on thread %u, should be on bio zone thread %u",
(unsignedlonglong) pbn_from_vio_bio(vio->bio), thread_id,
expected);
}
int vdo_create_bio(struct bio **bio_ptr); void vdo_free_bio(struct bio *bio); int allocate_vio_components(struct vdo *vdo, enum vio_type vio_type, enum vio_priority priority, void *parent, unsignedint block_count, char *data, struct vio *vio); int __must_check create_multi_block_metadata_vio(struct vdo *vdo, enum vio_type vio_type, enum vio_priority priority, void *parent, unsignedint block_count, char *data, struct vio **vio_ptr);
/** * initialize_vio() - Initialize a vio. * @vio: The vio to initialize. * @bio: The bio this vio should use for its I/O. * @block_count: The size of this vio in vdo blocks. * @vio_type: The vio type. * @priority: The relative priority of the vio. * @vdo: The vdo for this vio.
*/ staticinlinevoid initialize_vio(struct vio *vio, struct bio *bio, unsignedint block_count, enum vio_type vio_type, enum vio_priority priority, struct vdo *vdo)
{ /* data_vio's may not span multiple blocks */
BUG_ON((vio_type == VIO_TYPE_DATA) && (block_count != 1));
/** * is_data_vio() - Check whether a vio is servicing an external data request. * @vio: The vio to check.
*/ staticinlinebool is_data_vio(struct vio *vio)
{ return (vio->type == VIO_TYPE_DATA);
}
/** * get_metadata_priority() - Convert a vio's priority to a work item priority. * @vio: The vio. * * Return: The priority with which to submit the vio's bio.
*/ staticinlineenum vdo_completion_priority get_metadata_priority(struct vio *vio)
{ return ((vio->priority == VIO_PRIORITY_HIGH) ?
BIO_Q_HIGH_PRIORITY :
BIO_Q_METADATA_PRIORITY);
}
/** * continue_vio() - Enqueue a vio to run its next callback. * @vio: The vio to continue. * * Return: The result of the current operation.
*/ staticinlinevoid continue_vio(struct vio *vio, int result)
{ if (unlikely(result != VDO_SUCCESS))
vdo_set_completion_result(&vio->completion, result);
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.