From: Samuel Just Date: Thu, 21 Feb 2013 21:25:49 +0000 (-0800) Subject: FileStore::_setattrs: only do omap operations if necessary X-Git-Tag: v0.59~152^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2ec04f96337b53e5f3de0c679be24e7184048e7f;p=ceph.git FileStore::_setattrs: only do omap operations if necessary Signed-off-by: Samuel Just --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index a7390361d468..deab9ede8759 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -3882,13 +3882,18 @@ int FileStore::_setattrs(coll_t cid, const hobject_t& oid, map } } - if (g_conf->filestore_xattr_use_omap) { + if (omap_remove.size()) { + assert(g_conf->filestore_xattr_use_omap); r = object_map->remove_xattrs(oid, omap_remove, &spos); if (r < 0 && r != -ENOENT) { dout(10) << __func__ << " could not remove_xattrs r = " << r << dendl; assert(!m_filestore_fail_eio || r != -EIO); goto out_close; } + } + + if (omap_set.size()) { + assert(g_conf->filestore_xattr_use_omap); r = object_map->set_xattrs(oid, omap_set, &spos); if (r < 0) { dout(10) << __func__ << " could not set_xattrs r = " << r << dendl;