exofs: add bdi backing to mount session
This ensures that dirty data gets flushed properly. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
9df9c8b930
commit
b3d0ab7e60
2 changed files with 10 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/time.h>
|
#include <linux/time.h>
|
||||||
|
#include <linux/backing-dev.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
/* FIXME: Remove once pnfs hits mainline
|
/* FIXME: Remove once pnfs hits mainline
|
||||||
|
@ -92,6 +93,7 @@ struct exofs_sb_info {
|
||||||
struct exofs_layout layout; /* Default files layout,
|
struct exofs_layout layout; /* Default files layout,
|
||||||
* contains the variable osd_dev
|
* contains the variable osd_dev
|
||||||
* array. Keep last */
|
* array. Keep last */
|
||||||
|
struct backing_dev_info bdi;
|
||||||
struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
|
struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -302,6 +302,7 @@ static void exofs_put_super(struct super_block *sb)
|
||||||
_exofs_print_device("Unmounting", NULL, sbi->layout.s_ods[0],
|
_exofs_print_device("Unmounting", NULL, sbi->layout.s_ods[0],
|
||||||
sbi->layout.s_pid);
|
sbi->layout.s_pid);
|
||||||
|
|
||||||
|
bdi_destroy(&sbi->bdi);
|
||||||
exofs_free_sbi(sbi);
|
exofs_free_sbi(sbi);
|
||||||
sb->s_fs_info = NULL;
|
sb->s_fs_info = NULL;
|
||||||
}
|
}
|
||||||
|
@ -546,6 +547,10 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
if (!sbi)
|
if (!sbi)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
ret = bdi_setup_and_register(&sbi->bdi, "exofs", BDI_CAP_MAP_COPY);
|
||||||
|
if (ret)
|
||||||
|
goto free_bdi;
|
||||||
|
|
||||||
/* use mount options to fill superblock */
|
/* use mount options to fill superblock */
|
||||||
od = osduld_path_lookup(opts->dev_name);
|
od = osduld_path_lookup(opts->dev_name);
|
||||||
if (IS_ERR(od)) {
|
if (IS_ERR(od)) {
|
||||||
|
@ -612,6 +617,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set up operation vectors */
|
/* set up operation vectors */
|
||||||
|
sb->s_bdi = &sbi->bdi;
|
||||||
sb->s_fs_info = sbi;
|
sb->s_fs_info = sbi;
|
||||||
sb->s_op = &exofs_sops;
|
sb->s_op = &exofs_sops;
|
||||||
sb->s_export_op = &exofs_export_ops;
|
sb->s_export_op = &exofs_export_ops;
|
||||||
|
@ -643,6 +649,8 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free_sbi:
|
free_sbi:
|
||||||
|
bdi_destroy(&sbi->bdi);
|
||||||
|
free_bdi:
|
||||||
EXOFS_ERR("Unable to mount exofs on %s pid=0x%llx err=%d\n",
|
EXOFS_ERR("Unable to mount exofs on %s pid=0x%llx err=%d\n",
|
||||||
opts->dev_name, sbi->layout.s_pid, ret);
|
opts->dev_name, sbi->layout.s_pid, ret);
|
||||||
exofs_free_sbi(sbi);
|
exofs_free_sbi(sbi);
|
||||||
|
|
Loading…
Add table
Reference in a new issue