aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-10-14 17:27:38 -0400
committerSage Weil <sage@newdream.net>2009-10-15 21:14:35 -0400
commitafcdaea3f2a78ce4873bd7e98a6d603bda23d167 (patch)
tree08defc298e2c27816d70bd41c8c3ecc80a82ba79 /fs/ceph/mds_client.c
parentcdc35f96277314bbfeefd0505410cabd69aebd8d (diff)
ceph: flush dirty caps via the cap_dirty list
Previously we were flushing dirty caps by passing an extra flag when traversing the delayed caps list. Besides being a bit ugly, that can also miss caps that are dirty but didn't result in a cap requeue: notably, mark_caps_dirty(). Separate the flushing into a separate helper, and traverse the cap_dirty list. This also brings i_dirty_item in line with i_dirty_caps: we are on the list IFF caps != 0. We carry an inode ref IFF dirty_caps|flushing_caps != 0. Lose the unused return value from __ceph_mark_caps_dirty(). Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 2b19da31a8b3..12d66c0572ac 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -2504,7 +2504,7 @@ static void delayed_work(struct work_struct *work)
2504 int renew_caps; 2504 int renew_caps;
2505 2505
2506 dout("mdsc delayed_work\n"); 2506 dout("mdsc delayed_work\n");
2507 ceph_check_delayed_caps(mdsc, 0); 2507 ceph_check_delayed_caps(mdsc);
2508 2508
2509 mutex_lock(&mdsc->mutex); 2509 mutex_lock(&mdsc->mutex);
2510 renew_interval = mdsc->mdsmap->m_session_timeout >> 2; 2510 renew_interval = mdsc->mdsmap->m_session_timeout >> 2;
@@ -2627,7 +2627,7 @@ void ceph_mdsc_pre_umount(struct ceph_mds_client *mdsc)
2627 mdsc->stopping = 1; 2627 mdsc->stopping = 1;
2628 2628
2629 drop_leases(mdsc); 2629 drop_leases(mdsc);
2630 ceph_check_delayed_caps(mdsc, 1); 2630 ceph_flush_dirty_caps(mdsc);
2631 wait_requests(mdsc); 2631 wait_requests(mdsc);
2632} 2632}
2633 2633
@@ -2677,7 +2677,7 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc)
2677 mutex_unlock(&mdsc->mutex); 2677 mutex_unlock(&mdsc->mutex);
2678 dout("sync want tid %lld flush_seq %lld\n", want_tid, want_flush); 2678 dout("sync want tid %lld flush_seq %lld\n", want_tid, want_flush);
2679 2679
2680 ceph_check_delayed_caps(mdsc, 1); 2680 ceph_flush_dirty_caps(mdsc);
2681 2681
2682 wait_unsafe_requests(mdsc, want_tid); 2682 wait_unsafe_requests(mdsc, want_tid);
2683 wait_event(mdsc->cap_flushing_wq, check_cap_flush(mdsc, want_flush)); 2683 wait_event(mdsc->cap_flushing_wq, check_cap_flush(mdsc, want_flush));