mirror of
https://github.com/schoebel/mars
synced 2025-03-23 11:36:42 +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)
|
||||
{
|
||||
struct bio_brick *brick = output->brick;
|
||||
struct inode *inode;
|
||||
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;
|
||||
MARS_DBG("determined device size = %lld\n", info->current_size);
|
||||
info->backing_file = brick->filp;
|
||||
if (!brick->filp) {
|
||||
status = -ENOENT;
|
||||
}
|
||||
done:
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user