mirror of https://github.com/schoebel/mars
infra: clean buffer cache on opening block devices
This commit is contained in:
parent
6aede1fc62
commit
6eb5cefc19
|
@ -48,7 +48,6 @@ DECLARE_RWSEM(mapfree_mutex);
|
|||
static
|
||||
LIST_HEAD(mapfree_list);
|
||||
|
||||
static
|
||||
void mapfree_pages(struct mapfree_info *mf, int grace_keep)
|
||||
{
|
||||
struct address_space *mapping;
|
||||
|
|
|
@ -72,6 +72,8 @@ void mapfree_put(struct mapfree_info *mf);
|
|||
|
||||
void mapfree_set(struct mapfree_info *mf, loff_t min, loff_t max);
|
||||
|
||||
void mapfree_pages(struct mapfree_info *mf, int grace_keep);
|
||||
|
||||
////////////////// dirty IOs on the fly //////////////////
|
||||
|
||||
void mf_insert_dirty(struct mapfree_info *mf, struct dirty_info *di);
|
||||
|
|
|
@ -743,7 +743,7 @@ static int bio_switch(struct bio_brick *brick)
|
|||
MARS_ERR("cannot open file '%s'\n", path);
|
||||
goto done;
|
||||
}
|
||||
|
||||
mapfree_pages(brick->mf, -1);
|
||||
if (unlikely(!(mapping = brick->mf->mf_filp->f_mapping) ||
|
||||
!(inode = mapping->host))) {
|
||||
MARS_ERR("internal problem with '%s'\n", path);
|
||||
|
|
Loading…
Reference in New Issue