mirror of
https://github.com/schoebel/mars
synced 2025-04-04 15:30:12 +00:00
mars_bio: fix size update in get_info()
This commit is contained in:
parent
a9e7affde5
commit
e76694df49
13
mars_bio.c
13
mars_bio.c
@ -190,13 +190,20 @@ out:
|
|||||||
static int bio_get_info(struct bio_output *output, struct mars_info *info)
|
static int bio_get_info(struct bio_output *output, struct mars_info *info)
|
||||||
{
|
{
|
||||||
struct bio_brick *brick = output->brick;
|
struct bio_brick *brick = output->brick;
|
||||||
|
struct inode *inode;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
|
if (unlikely(!brick->filp ||
|
||||||
|
!brick->filp->f_mapping ||
|
||||||
|
!(inode = brick->filp->f_mapping->host))) {
|
||||||
|
status = -ENOENT;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
brick->total_size = inode->i_size;
|
||||||
info->current_size = brick->total_size;
|
info->current_size = brick->total_size;
|
||||||
MARS_DBG("determined device size = %lld\n", info->current_size);
|
MARS_DBG("determined device size = %lld\n", info->current_size);
|
||||||
info->backing_file = brick->filp;
|
info->backing_file = brick->filp;
|
||||||
if (!brick->filp) {
|
done:
|
||||||
status = -ENOENT;
|
|
||||||
}
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user