ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: xiubli@redhat.com
To: jlayton@kernel.org, idryomov@gmail.com, zyan@redhat.com
Cc: pdonnell@redhat.com, ceph-devel@vger.kernel.org,
	Xiubo Li <xiubli@redhat.com>
Subject: [PATCH] ceph: always try to flush the snaps in ceph_check_caps
Date: Tue, 26 May 2020 23:34:30 -0400	[thread overview]
Message-ID: <1590550470-31278-1-git-send-email-xiubli@redhat.com> (raw)

From: Xiubo Li <xiubli@redhat.com>

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

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/caps.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 27c2e60..62a066e 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -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)
-- 
1.8.3.1

                 reply	other threads:[~2020-05-27  3:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1590550470-31278-1-git-send-email-xiubli@redhat.com \
    --to=xiubli@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=pdonnell@redhat.com \
    --cc=zyan@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).