Skip to content

Commit c947013

Browse files
committed
Merge PR ceph#55914 into main
* refs/pull/55914/head: mds: do not use item item_caps in two different lists mds: add new item item_to_flush Reviewed-by: Xiubo Li <[email protected]> Reviewed-by: Venky Shankar <[email protected]>
2 parents e420ce8 + 207a9be commit c947013

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/mds/CInode.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ CInode::CInode(MDCache *c, bool auth, snapid_t f, snapid_t l) :
328328
item_dirty_dirfrag_dir(this),
329329
item_dirty_dirfrag_nest(this),
330330
item_dirty_dirfrag_dirfragtree(this),
331+
item_to_flush(this),
331332
pop(c->decayrate),
332333
quiescelock(this, &quiescelock_type),
333334
versionlock(this, &versionlock_type),

src/mds/CInode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter<CIno
10841084
elist<CInode*>::item item_dirty_dirfrag_dir;
10851085
elist<CInode*>::item item_dirty_dirfrag_nest;
10861086
elist<CInode*>::item item_dirty_dirfrag_dirfragtree;
1087+
elist<CInode*>::item item_to_flush;
10871088

10881089
// also update RecoveryQueue::RecoveryQueue() if you change this
10891090
elist<CInode*>::item& item_recover_queue = item_dirty_dirfrag_dir;

src/mds/Locker.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class LockerLogContext : public MDSLogContextBase {
7272
};
7373

7474
Locker::Locker(MDSRank *m, MDCache *c) :
75-
need_snapflush_inodes(member_offset(CInode, item_caps)), mds(m), mdcache(c) {}
75+
need_snapflush_inodes(member_offset(CInode, item_to_flush)), mds(m), mdcache(c) {}
7676

7777

7878
void Locker::dispatch(const cref_t<Message> &m)
@@ -2311,7 +2311,7 @@ void Locker::file_update_finish(CInode *in, MutationRef& mut, unsigned flags,
23112311
lock->put_wrlock();
23122312
}
23132313
in->item_open_file.remove_myself();
2314-
in->item_caps.remove_myself();
2314+
in->item_to_flush.remove_myself();
23152315
eval_cap_gather(in, &need_issue);
23162316
}
23172317
}
@@ -3179,15 +3179,15 @@ void Locker::snapflush_nudge(CInode *in)
31793179
_rdlock_kick(hlock, true);
31803180
} else {
31813181
// also, requeue, in case of unstable lock
3182-
need_snapflush_inodes.push_back(&in->item_caps);
3182+
need_snapflush_inodes.push_back(&in->item_to_flush);
31833183
}
31843184
}
31853185

31863186
void Locker::mark_need_snapflush_inode(CInode *in)
31873187
{
31883188
ceph_assert(in->last != CEPH_NOSNAP);
3189-
if (!in->item_caps.is_on_list()) {
3190-
need_snapflush_inodes.push_back(&in->item_caps);
3189+
if (!in->item_to_flush.is_on_list()) {
3190+
need_snapflush_inodes.push_back(&in->item_to_flush);
31913191
utime_t now = ceph_clock_now();
31923192
in->last_dirstat_prop = now;
31933193
dout(10) << "mark_need_snapflush_inode " << *in << " - added at " << now << dendl;
@@ -4295,7 +4295,7 @@ void Locker::caps_tick()
42954295
CInode *in = need_snapflush_inodes.front();
42964296
if (in->last_dirstat_prop >= cutoff)
42974297
break;
4298-
in->item_caps.remove_myself();
4298+
in->item_to_flush.remove_myself();
42994299
snapflush_nudge(in);
43004300
if (in == last)
43014301
break;

src/mds/MDCache.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ void MDCache::remove_inode(CInode *o)
333333
inode_map.erase(o->ino());
334334
} else {
335335
o->item_caps.remove_myself();
336+
o->item_to_flush.remove_myself();
336337
snap_inode_map.erase(o->vino());
337338
}
338339

0 commit comments

Comments
 (0)