Commit 5163d900 authored by Jens Axboe's avatar Jens Axboe

coda: add bdi backing to mount session

This ensures that dirty data gets flushed properly.
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 8044f7f4
...@@ -167,6 +167,10 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -167,6 +167,10 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
return -EBUSY; return -EBUSY;
} }
error = bdi_setup_and_register(&vc->bdi, "coda", BDI_CAP_MAP_COPY);
if (error)
goto bdi_err;
vc->vc_sb = sb; vc->vc_sb = sb;
sb->s_fs_info = vc; sb->s_fs_info = vc;
...@@ -175,6 +179,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -175,6 +179,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
sb->s_blocksize_bits = 12; sb->s_blocksize_bits = 12;
sb->s_magic = CODA_SUPER_MAGIC; sb->s_magic = CODA_SUPER_MAGIC;
sb->s_op = &coda_super_operations; sb->s_op = &coda_super_operations;
sb->s_bdi = &vc->bdi;
/* get root fid from Venus: this needs the root inode */ /* get root fid from Venus: this needs the root inode */
error = venus_rootfid(sb, &fid); error = venus_rootfid(sb, &fid);
...@@ -200,6 +205,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -200,6 +205,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
return 0; return 0;
error: error:
bdi_destroy(&vc->bdi);
bdi_err:
if (root) if (root)
iput(root); iput(root);
if (vc) if (vc)
...@@ -210,6 +217,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent) ...@@ -210,6 +217,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
static void coda_put_super(struct super_block *sb) static void coda_put_super(struct super_block *sb)
{ {
bdi_destroy(&coda_vcp(sb)->bdi);
coda_vcp(sb)->vc_sb = NULL; coda_vcp(sb)->vc_sb = NULL;
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
......
#ifndef __CODA_PSDEV_H #ifndef __CODA_PSDEV_H
#define __CODA_PSDEV_H #define __CODA_PSDEV_H
#include <linux/backing-dev.h>
#include <linux/magic.h> #include <linux/magic.h>
#define CODA_PSDEV_MAJOR 67 #define CODA_PSDEV_MAJOR 67
...@@ -17,6 +18,7 @@ struct venus_comm { ...@@ -17,6 +18,7 @@ struct venus_comm {
struct list_head vc_processing; struct list_head vc_processing;
int vc_inuse; int vc_inuse;
struct super_block *vc_sb; struct super_block *vc_sb;
struct backing_dev_info bdi;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment