Skip to contentSkip to conversation

ceph: always try to flush the snaps in ceph_check_caps

PATCH New [email protected] 1 participant 1 message May 27, 2020 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: always try to flush the snaps in ceph_check_caps

From: Xiubo Li <[email protected]>

The ceph_flush_snaps() will never have a change to be called and we can do it in the ceph_check_caps().

---
 fs/ceph/caps.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
fs/ceph/caps.c +3 -5
index 27c2e60..62a066e 100644
@@ -3019,7 +3019,7 @@ static int ceph_try_drop_cap_snap(struct ceph_inode_info *ci,
 void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
 {
 	struct inode *inode = &ci->vfs_inode;
-	int last = 0, put = 0, flushsnaps = 0, wake = 0;
+	int last = 0, put = 0, wake = 0;
 
 	spin_lock(&ci->i_ceph_lock);
 	if (had & CEPH_CAP_PIN)
@@ -3052,8 +3052,8 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
 				capsnap->writing = 0;
 				if (ceph_try_drop_cap_snap(ci, capsnap))
 					put++;
-				else if (__ceph_finish_cap_snap(ci, capsnap))
-					flushsnaps = 1;
+				else
+				       __ceph_finish_cap_snap(ci, capsnap);
 				wake = 1;
 			}
 			if (ci->i_wrbuffer_ref_head == 0 &&
@@ -3074,8 +3074,6 @@ void ceph_put_cap_refs(struct ceph_inode_info *ci, int had)
 
 	if (last)
 		ceph_check_caps(ci, 0, NULL);
-	else if (flushsnaps)
-		ceph_flush_snaps(ci, NULL);
 	if (wake)
 		wake_up_all(&ci->i_cap_wq);
 	while (put-- > 0)
Signature · 1 line
1.8.3.1