From b042774f092c6fddb0234dc8efda9d645d86e11a Mon Sep 17 00:00:00 2001 From: Giuseppe Baccini Date: Wed, 22 Nov 2023 16:28:13 +0100 Subject: [PATCH] rgw/sfs: RGW_ATTR_OBJECT_RETENTION, avoid redundant copy in writer.cc In SFSAtomicWriter::complete(), when put RGW_ATTR_OBJECT_RETENTION attribute in attrs, directly encode RGWObjectRetention object in the map. Signed-off-by: Giuseppe Baccini --- src/rgw/driver/sfs/writer.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rgw/driver/sfs/writer.cc b/src/rgw/driver/sfs/writer.cc index f0058bbcbe7456..c63e81684276bd 100644 --- a/src/rgw/driver/sfs/writer.cc +++ b/src/rgw/driver/sfs/writer.cc @@ -332,9 +332,7 @@ int SFSAtomicWriter::complete( bucketref->get_info().obj_lock.get_lock_until_date(now); string mode = bucketref->get_info().obj_lock.get_mode(); RGWObjectRetention obj_retention(mode, lock_until_date); - bufferlist bl; - obj_retention.encode(bl); - attrs[RGW_ATTR_OBJECT_RETENTION] = bl; + encode(obj_retention, attrs[RGW_ATTR_OBJECT_RETENTION]); } }