diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-07-04 06:06:41 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-07-27 21:00:42 -0400 |
commit | 0e2943878942aee7100c94d0d40c49087dac12cb (patch) | |
tree | 8611ba2813ab13fd5a36a70dbd5005b29818d40e /fs/ceph/snap.c | |
parent | e4500b5e35c213e0f97be7cb69328c0877203a79 (diff) |
ceph: unify cap flush and snapcap flush
This patch includes following changes
- Assign flush tid to snapcap flush
- Remove session's s_cap_snaps_flushing list. Add inode to session's
s_cap_flushing list instead. Inode is removed from the list when
there is no pending snapcap flush or cap flush.
- make __kick_flushing_caps() re-send both snapcap flushes and cap
flushes.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/snap.c')
-rw-r--r-- | fs/ceph/snap.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index eadf2c33edc6..20d5b0cdf655 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
@@ -520,9 +520,7 @@ void ceph_queue_cap_snap(struct ceph_inode_info *ci) | |||
520 | ihold(inode); | 520 | ihold(inode); |
521 | 521 | ||
522 | atomic_set(&capsnap->nref, 1); | 522 | atomic_set(&capsnap->nref, 1); |
523 | capsnap->ci = ci; | ||
524 | INIT_LIST_HEAD(&capsnap->ci_item); | 523 | INIT_LIST_HEAD(&capsnap->ci_item); |
525 | INIT_LIST_HEAD(&capsnap->flushing_item); | ||
526 | 524 | ||
527 | capsnap->follows = old_snapc->seq; | 525 | capsnap->follows = old_snapc->seq; |
528 | capsnap->issued = __ceph_caps_issued(ci, NULL); | 526 | capsnap->issued = __ceph_caps_issued(ci, NULL); |
@@ -800,7 +798,7 @@ static void flush_snaps(struct ceph_mds_client *mdsc) | |||
800 | ihold(inode); | 798 | ihold(inode); |
801 | spin_unlock(&mdsc->snap_flush_lock); | 799 | spin_unlock(&mdsc->snap_flush_lock); |
802 | spin_lock(&ci->i_ceph_lock); | 800 | spin_lock(&ci->i_ceph_lock); |
803 | __ceph_flush_snaps(ci, &session, 0); | 801 | __ceph_flush_snaps(ci, &session); |
804 | spin_unlock(&ci->i_ceph_lock); | 802 | spin_unlock(&ci->i_ceph_lock); |
805 | iput(inode); | 803 | iput(inode); |
806 | spin_lock(&mdsc->snap_flush_lock); | 804 | spin_lock(&mdsc->snap_flush_lock); |