Commit 5163d90076729413cb882d3dd5c3d3cfb5b9f035

Authored by Jens Axboe
1 parent 8044f7f468

coda: add bdi backing to mount session

This ensures that dirty data gets flushed properly.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff

... ... @@ -167,6 +167,10 @@
167 167 return -EBUSY;
168 168 }
169 169  
  170 + error = bdi_setup_and_register(&vc->bdi, "coda", BDI_CAP_MAP_COPY);
  171 + if (error)
  172 + goto bdi_err;
  173 +
170 174 vc->vc_sb = sb;
171 175  
172 176 sb->s_fs_info = vc;
... ... @@ -175,6 +179,7 @@
175 179 sb->s_blocksize_bits = 12;
176 180 sb->s_magic = CODA_SUPER_MAGIC;
177 181 sb->s_op = &coda_super_operations;
  182 + sb->s_bdi = &vc->bdi;
178 183  
179 184 /* get root fid from Venus: this needs the root inode */
180 185 error = venus_rootfid(sb, &fid);
... ... @@ -200,6 +205,8 @@
200 205 return 0;
201 206  
202 207 error:
  208 + bdi_destroy(&vc->bdi);
  209 + bdi_err:
203 210 if (root)
204 211 iput(root);
205 212 if (vc)
... ... @@ -210,6 +217,7 @@
210 217  
211 218 static void coda_put_super(struct super_block *sb)
212 219 {
  220 + bdi_destroy(&coda_vcp(sb)->bdi);
213 221 coda_vcp(sb)->vc_sb = NULL;
214 222 sb->s_fs_info = NULL;
215 223  
include/linux/coda_psdev.h
1 1 #ifndef __CODA_PSDEV_H
2 2 #define __CODA_PSDEV_H
3 3  
  4 +#include <linux/backing-dev.h>
4 5 #include <linux/magic.h>
5 6  
6 7 #define CODA_PSDEV_MAJOR 67
... ... @@ -17,6 +18,7 @@
17 18 struct list_head vc_processing;
18 19 int vc_inuse;
19 20 struct super_block *vc_sb;
  21 + struct backing_dev_info bdi;
20 22 };
21 23  
22 24