aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-06-08 04:03:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-11 21:36:15 -0400
commit80e09fb942d38beb19dcffbeb14d496beeb0a989 (patch)
treecdaa5cf4baf745ee4c83b8e03cb75581e7ea1ffa
parent561e47ce7244168788d4ecef9a2271df204b3c89 (diff)
exofs: add ->sync_fs
Add a ->sync_fs method for data integrity syncs, and reimplement ->write_super ontop of it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/exofs/super.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/exofs/super.c b/fs/exofs/super.c
index 49e16af4e619..8216c5b77b53 100644
--- a/fs/exofs/super.c
+++ b/fs/exofs/super.c
@@ -200,18 +200,18 @@ static const struct export_operations exofs_export_ops;
200/* 200/*
201 * Write the superblock to the OSD 201 * Write the superblock to the OSD
202 */ 202 */
203static void exofs_write_super(struct super_block *sb) 203static int exofs_sync_fs(struct super_block *sb, int wait)
204{ 204{
205 struct exofs_sb_info *sbi; 205 struct exofs_sb_info *sbi;
206 struct exofs_fscb *fscb; 206 struct exofs_fscb *fscb;
207 struct osd_request *or; 207 struct osd_request *or;
208 struct osd_obj_id obj; 208 struct osd_obj_id obj;
209 int ret; 209 int ret = -ENOMEM;
210 210
211 fscb = kzalloc(sizeof(struct exofs_fscb), GFP_KERNEL); 211 fscb = kzalloc(sizeof(struct exofs_fscb), GFP_KERNEL);
212 if (!fscb) { 212 if (!fscb) {
213 EXOFS_ERR("exofs_write_super: memory allocation failed.\n"); 213 EXOFS_ERR("exofs_write_super: memory allocation failed.\n");
214 return; 214 return -ENOMEM;
215 } 215 }
216 216
217 lock_super(sb); 217 lock_super(sb);
@@ -249,6 +249,15 @@ out:
249 unlock_kernel(); 249 unlock_kernel();
250 unlock_super(sb); 250 unlock_super(sb);
251 kfree(fscb); 251 kfree(fscb);
252 return ret;
253}
254
255static void exofs_write_super(struct super_block *sb)
256{
257 if (!(sb->s_flags & MS_RDONLY))
258 exofs_sync_fs(sb, 1);
259 else
260 sb->s_dirt = 0;
252} 261}
253 262
254/* 263/*
@@ -493,6 +502,7 @@ static const struct super_operations exofs_sops = {
493 .delete_inode = exofs_delete_inode, 502 .delete_inode = exofs_delete_inode,
494 .put_super = exofs_put_super, 503 .put_super = exofs_put_super,
495 .write_super = exofs_write_super, 504 .write_super = exofs_write_super,
505 .sync_fs = exofs_sync_fs,
496 .statfs = exofs_statfs, 506 .statfs = exofs_statfs,
497}; 507};
498 508