]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
kclient: only flush caps in write_inode if wait=1
authorSage Weil <sage@newdream.net>
Wed, 8 Apr 2009 23:26:22 +0000 (16:26 -0700)
committerSage Weil <sage@newdream.net>
Wed, 8 Apr 2009 23:26:22 +0000 (16:26 -0700)
commit557af5f79d1013b25d2ba5c3c4f815a877bf517d
treef677051949726a123fa5955958b0978c69ca2641
parentdbb6036c1ea71e2b224bb5a80acc8207f83e9239
kclient: only flush caps in write_inode if wait=1

The problem is that on delayed writeback, vm calls write_inode and
THEN writepages.  Which means we still have WRBUFFER caps used,
so sending a cap release then is somewhat counter productive.  If
we don't release wanted, we'll have to again later.  And if we do,
the mds will explicitly revoke our WRBUFFER caps so that it can
journal the max_size to 0.  Yuck.

So.  If wait, then do the cap flush immediately, as before.  If
!wait, queue up the caps at the front of the delay queue so that
it goes the next time we check_delayed_caps.  This catches the
sync() and umount cases (basically the same, really).

On fsync, queue the caps for write, but don't wait, since the mds
can recover the size/mtime anyway.
src/kernel/caps.c
src/kernel/file.c
src/kernel/mds_client.c