summaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2020-03-18 20:34:20 +0100
committerIlya Dryomov <idryomov@gmail.com>2020-06-01 13:22:52 +0200
commitd7dbfb4f2bdb037758f46271f75ea6c8d35626b4 (patch)
tree25abcdbae29060e0d69c1c8661d175093b37688b /fs/ceph
parentceph: split up __finish_cap_flush (diff)
downloadlinux-d7dbfb4f2bdb037758f46271f75ea6c8d35626b4.tar.xz
linux-d7dbfb4f2bdb037758f46271f75ea6c8d35626b4.zip
ceph: add comments for handle_cap_flush_ack logic
Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/caps.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 74d05e5db68d..056ad0d99438 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -3471,14 +3471,26 @@ static void handle_cap_flush_ack(struct inode *inode, u64 flush_tid,
bool wake_mdsc = false;
list_for_each_entry_safe(cf, tmp_cf, &ci->i_cap_flush_list, i_list) {
+ /* Is this the one that was flushed? */
if (cf->tid == flush_tid)
cleaned = cf->caps;
- if (cf->caps == 0) /* capsnap */
+
+ /* Is this a capsnap? */
+ if (cf->caps == 0)
continue;
+
if (cf->tid <= flush_tid) {
+ /*
+ * An earlier or current tid. The FLUSH_ACK should
+ * represent a superset of this flush's caps.
+ */
wake_ci |= __detach_cap_flush_from_ci(ci, cf);
list_add_tail(&cf->i_list, &to_remove);
} else {
+ /*
+ * This is a later one. Any caps in it are still dirty
+ * so don't count them as cleaned.
+ */
cleaned &= ~cf->caps;
if (!cleaned)
break;