mirror of
https://github.com/schoebel/mars
synced 2025-02-21 23:06:51 +00:00
infra: initialize IO transfer metadata correctly
This commit is contained in:
parent
27fd43cb31
commit
5a5ea9bc52
@ -164,8 +164,8 @@ struct mref_object {
|
||||
|
||||
struct mars_info {
|
||||
loff_t current_size;
|
||||
int transfer_order;
|
||||
int transfer_size;
|
||||
int tf_align; // transfer alignment constraint
|
||||
int tf_min_size; // transfer is only possible in multiples of this
|
||||
};
|
||||
|
||||
// brick stuff
|
||||
|
@ -879,6 +879,8 @@ static int aio_get_info(struct aio_output *output, struct mars_info *info)
|
||||
!file->f_mapping->host))
|
||||
return -EINVAL;
|
||||
|
||||
info->tf_align = 1;
|
||||
info->tf_min_size = 1;
|
||||
info->current_size = i_size_read(file->f_mapping->host);
|
||||
MARS_DBG("determined file size = %lld\n", info->current_size);
|
||||
|
||||
|
@ -224,6 +224,9 @@ static int bio_get_info(struct bio_output *output, struct mars_info *info)
|
||||
status = -ENOENT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
info->tf_align = 512;
|
||||
info->tf_min_size = 512;
|
||||
brick->total_size = inode->i_size;
|
||||
info->current_size = brick->total_size;
|
||||
MARS_DBG("determined device size = %lld\n", info->current_size);
|
||||
|
@ -68,8 +68,8 @@ EXPORT_SYMBOL_GPL(mref_type);
|
||||
|
||||
const struct meta mars_info_meta[] = {
|
||||
META_INI(current_size, struct mars_info, FIELD_INT),
|
||||
META_INI(transfer_order, struct mars_info, FIELD_INT),
|
||||
META_INI(transfer_size, struct mars_info, FIELD_INT),
|
||||
META_INI(tf_align, struct mars_info, FIELD_INT),
|
||||
META_INI(tf_min_size, struct mars_info, FIELD_INT),
|
||||
{}
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(mars_info_meta);
|
||||
|
@ -480,6 +480,8 @@ static int sio_get_info(struct sio_output *output, struct mars_info *info)
|
||||
if (unlikely(!file || !file->f_mapping || !file->f_mapping->host))
|
||||
return -EINVAL;
|
||||
|
||||
info->tf_align = 1;
|
||||
info->tf_min_size = 1;
|
||||
info->current_size = i_size_read(file->f_mapping->host);
|
||||
MARS_DBG("determined file size = %lld\n", info->current_size);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user