Skip to content

Commit cebb5a6

Browse files
committed
client: clean up the queue_cap_snap() code to remove unnecessary check
If the 'dirty' is true then 'dirty & CEPH_CAP_ANY_WR' will always be true. Fixes: https://tracker.ceph.com/issues/59343 Signed-off-by: Xiubo Li <[email protected]>
1 parent 6262351 commit cebb5a6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/client/Client.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4053,15 +4053,13 @@ void Client::queue_cap_snap(Inode *in, SnapContext& old_snapc)
40534053
in->cap_snaps.rbegin()->second.writing) {
40544054
ldout(cct, 10) << __func__ << " already have pending cap_snap on " << *in << dendl;
40554055
return;
4056-
} else if (in->caps_dirty() ||
4057-
(used & CEPH_CAP_FILE_WR) ||
4058-
(dirty & CEPH_CAP_ANY_WR)) {
4056+
} else if (dirty || (used & CEPH_CAP_FILE_WR)) {
40594057
const auto &capsnapem = in->cap_snaps.emplace(std::piecewise_construct, std::make_tuple(old_snapc.seq), std::make_tuple(in));
40604058
ceph_assert(capsnapem.second); /* element inserted */
40614059
CapSnap &capsnap = capsnapem.first->second;
40624060
capsnap.context = old_snapc;
40634061
capsnap.issued = in->caps_issued();
4064-
capsnap.dirty = in->caps_dirty();
4062+
capsnap.dirty = dirty;
40654063

40664064
capsnap.dirty_data = (used & CEPH_CAP_FILE_BUFFER);
40674065

0 commit comments

Comments
 (0)