Skip to content

Commit b3d0ab7

Browse files
author
Jens Axboe
committed
exofs: add bdi backing to mount session
This ensures that dirty data gets flushed properly. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 9df9c8b commit b3d0ab7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

fs/exofs/exofs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
#include <linux/fs.h>
3737
#include <linux/time.h>
38+
#include <linux/backing-dev.h>
3839
#include "common.h"
3940

4041
/* FIXME: Remove once pnfs hits mainline
@@ -92,6 +93,7 @@ struct exofs_sb_info {
9293
struct exofs_layout layout; /* Default files layout,
9394
* contains the variable osd_dev
9495
* array. Keep last */
96+
struct backing_dev_info bdi;
9597
struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
9698
};
9799

fs/exofs/super.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ static void exofs_put_super(struct super_block *sb)
302302
_exofs_print_device("Unmounting", NULL, sbi->layout.s_ods[0],
303303
sbi->layout.s_pid);
304304

305+
bdi_destroy(&sbi->bdi);
305306
exofs_free_sbi(sbi);
306307
sb->s_fs_info = NULL;
307308
}
@@ -546,6 +547,10 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
546547
if (!sbi)
547548
return -ENOMEM;
548549

550+
ret = bdi_setup_and_register(&sbi->bdi, "exofs", BDI_CAP_MAP_COPY);
551+
if (ret)
552+
goto free_bdi;
553+
549554
/* use mount options to fill superblock */
550555
od = osduld_path_lookup(opts->dev_name);
551556
if (IS_ERR(od)) {
@@ -612,6 +617,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
612617
}
613618

614619
/* set up operation vectors */
620+
sb->s_bdi = &sbi->bdi;
615621
sb->s_fs_info = sbi;
616622
sb->s_op = &exofs_sops;
617623
sb->s_export_op = &exofs_export_ops;
@@ -643,6 +649,8 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent)
643649
return 0;
644650

645651
free_sbi:
652+
bdi_destroy(&sbi->bdi);
653+
free_bdi:
646654
EXOFS_ERR("Unable to mount exofs on %s pid=0x%llx err=%d\n",
647655
opts->dev_name, sbi->layout.s_pid, ret);
648656
exofs_free_sbi(sbi);

0 commit comments

Comments
 (0)