From: Sage Weil Date: Thu, 3 Apr 2008 14:01:50 +0000 (-0700) Subject: kclient: cleanly flush dirty pages at umount X-Git-Tag: v0.2~216 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0fd60634c1369854ecd31643818fdfd8dfde3b2d;p=ceph.git kclient: cleanly flush dirty pages at umount --- diff --git a/src/TODO b/src/TODO index a72066fe355..636cd590f97 100644 --- a/src/TODO +++ b/src/TODO @@ -27,6 +27,7 @@ kernel client - vfs - can we use dentry_path(), if it gets merged into mainline? - io / osd client + - writepages should do io on more than 14 pages at a time! - carry wrbuffer/rdcache caps until data is flushed - this should make the utimes bit kick in - invalidate cache pages? diff --git a/src/kernel/client.c b/src/kernel/client.c index 84cffe331d1..5b6a12da6e6 100644 --- a/src/kernel/client.c +++ b/src/kernel/client.c @@ -217,6 +217,11 @@ fail: return ERR_PTR(err); } +void ceph_umount_start(struct ceph_client *cl) +{ + ceph_mdsc_stop(&cl->mdsc); +} + void ceph_destroy_client(struct ceph_client *cl) { dout(10, "destroy_client %p\n", cl); @@ -224,8 +229,6 @@ void ceph_destroy_client(struct ceph_client *cl) /* unmount */ /* ... */ - ceph_mdsc_stop(&cl->mdsc); - ceph_messenger_destroy(cl->msgr); put_client_counter(); kfree(cl); diff --git a/src/kernel/super.c b/src/kernel/super.c index 343ff1005f8..8fb7953aef2 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -43,6 +43,7 @@ static int ceph_write_inode(struct inode *inode, int unused) static void ceph_put_super(struct super_block *s) { dout(30, "ceph_put_super\n"); + ceph_umount_start(ceph_client(s)); return; } @@ -515,8 +516,8 @@ static void ceph_kill_sb(struct super_block *s) { struct ceph_client *client = ceph_sb_to_client(s); dout(1, "kill_sb %p\n", s); + kill_anon_super(s); /* will call put_super after sb is r/o */ ceph_destroy_client(client); - kill_anon_super(s); } diff --git a/src/kernel/super.h b/src/kernel/super.h index 3a16ff721f1..527be8fd60b 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -333,6 +333,7 @@ extern void ceph_destroy_client(struct ceph_client *cl); extern int ceph_mount(struct ceph_client *client, struct ceph_mount_args *args, struct vfsmount *mnt); +extern void ceph_umount_start(struct ceph_client *cl); extern const char *ceph_msg_type_name(int type);