Skip to content

Commit ab3d3ac

Browse files
committed
rgw/posix: name the lock_guard in BucketCacheEntry::reclaim()
resolves compiler warning: rgw/driver/posix/bucket_cache.h: In instantiation of ‘bool file::listing::BucketCacheEntry<D, B>::reclaim(const cohort::lru::ObjectFactory*) [with D = rgw::sal::POSIXDriver; B = rgw::sal::POSIXBucket]’: src/rgw/driver/posix/bucket_cache.h:139:8: required from here 139 | bool reclaim(const cohort::lru::ObjectFactory* newobj_fac) { | ^~~~~~~ src/rgw/driver/posix/bucket_cache.h:147:7: warning: ignoring return value of ‘std::lock_guard<_Mutex>::lock_guard(mutex_type&) [with _Mutex = std::mutex; mutex_type = std::mutex]’, declared with attribute ‘nodiscard’ [-Wunused-result] 147 | lock_guard{mtx}; | ^~~~~~~~~~ Signed-off-by: Casey Bodley <[email protected]>
1 parent e5d33fa commit ab3d3ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rgw/driver/posix/bucket_cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct BucketCacheEntry : public cohort::lru::Object
144144
{ /* anon block */
145145
/* in this case, we are being called from a context which holds
146146
* A partition lock, and this may be still in use */
147-
lock_guard{mtx};
147+
auto lock = lock_guard{mtx};
148148
if (! deleted()) {
149149
flags |= FLAG_DELETED;
150150
bc->recycle_count++;

0 commit comments

Comments
 (0)