#include "ocf_env.h"
#include "ocf_io_priv.h"
#include "utils/utils_refcnt.h"
+#include "utils/utils_io_allocator.h"
+
+struct ocf_volume_extended {
+ ocf_io_allocator_type_t allocator_type;
+};
struct ocf_volume_type {
const struct ocf_volume_properties *properties;
- env_allocator *allocator;
+ struct ocf_io_allocator allocator;
};
struct ocf_volume {
};
int ocf_volume_type_init(struct ocf_volume_type **type,
- const struct ocf_volume_properties *properties);
+ const struct ocf_volume_properties *properties,
+ const struct ocf_volume_extended *extended);
void ocf_volume_type_deinit(struct ocf_volume_type *type);
static inline void ocf_volume_submit_metadata(struct ocf_io *io)
{
- ENV_BUG_ON(!io->volume->type->properties->ops.submit_metadata);
+ ocf_volume_t volume = ocf_io_get_volume(io);
- io->volume->type->properties->ops.submit_metadata(io);
+ ENV_BUG_ON(!volume->type->properties->ops.submit_metadata);
+
+ volume->type->properties->ops.submit_metadata(io);
}
static inline void ocf_volume_submit_write_zeroes(struct ocf_io *io)
{
- ENV_BUG_ON(!io->volume->type->properties->ops.submit_write_zeroes);
+ ocf_volume_t volume = ocf_io_get_volume(io);
+
+ ENV_BUG_ON(!volume->type->properties->ops.submit_write_zeroes);
- io->volume->type->properties->ops.submit_write_zeroes(io);
+ volume->type->properties->ops.submit_write_zeroes(io);
}
#endif /*__OCF_VOLUME_PRIV_H__ */