From 5f8df2de1a1a7ca6ca27d9590ec54c5db3072668 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Jul 2010 09:38:13 -0700 Subject: [PATCH] --- yaml --- r: 208851 b: refs/heads/master c: 2d9c98ae97c18e8b1c363af6a2e51d5d9e8c5e04 h: refs/heads/master i: 208849: c09491419630a866b4a5c4da07463f40cc101c5d 208847: b0039a49c341a69946336ef0faa6731bdf09260f v: v3 --- [refs] | 2 +- trunk/fs/ceph/super.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 420dbcb0b8de..256d16ade0bf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b8cd07e78eaa49857e882f4199309f86aeb80bbd +refs/heads/master: 2d9c98ae97c18e8b1c363af6a2e51d5d9e8c5e04 diff --git a/trunk/fs/ceph/super.c b/trunk/fs/ceph/super.c index d80699a4dc26..7f751f2850ba 100644 --- a/trunk/fs/ceph/super.c +++ b/trunk/fs/ceph/super.c @@ -102,12 +102,21 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf) } -static int ceph_syncfs(struct super_block *sb, int wait) +static int ceph_sync_fs(struct super_block *sb, int wait) { - dout("sync_fs %d\n", wait); + struct ceph_client *client = ceph_sb_to_client(sb); + + if (!wait) { + dout("sync_fs (non-blocking)\n"); + ceph_flush_dirty_caps(&client->mdsc); + dout("sync_fs (non-blocking) done\n"); + return 0; + } + + dout("sync_fs (blocking)\n"); ceph_osdc_sync(&ceph_sb_to_client(sb)->osdc); ceph_mdsc_sync(&ceph_sb_to_client(sb)->mdsc); - dout("sync_fs %d done\n", wait); + dout("sync_fs (blocking) done\n"); return 0; } @@ -278,7 +287,7 @@ static const struct super_operations ceph_super_ops = { .alloc_inode = ceph_alloc_inode, .destroy_inode = ceph_destroy_inode, .write_inode = ceph_write_inode, - .sync_fs = ceph_syncfs, + .sync_fs = ceph_sync_fs, .put_super = ceph_put_super, .show_options = ceph_show_options, .statfs = ceph_statfs,