}
}
-int FileStore::getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset, bool user_only)
+int FileStore::getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset)
{
set<string> omap_attrs;
map<string, bufferlist> omap_aset;
if (r >= 0 && !strncmp(buf, XATTR_NO_SPILL_OUT, sizeof(XATTR_NO_SPILL_OUT)))
spill_out = false;
- r = _fgetattrs(**fd, aset, user_only);
+ r = _fgetattrs(**fd, aset, false);
if (r < 0) {
goto out;
}
for (map<string, bufferlist>::iterator i = omap_aset.begin();
i != omap_aset.end();
++i) {
- string key;
- if (user_only) {
- if (i->first[0] != '_')
- continue;
- if (i->first == "_")
- continue;
- key = i->first.substr(1, i->first.size());
- } else {
- key = i->first;
- }
+ string key(i->first);
aset.insert(make_pair(key,
bufferptr(i->second.c_str(), i->second.length())));
}
// attrs
int getattr(coll_t cid, const ghobject_t& oid, const char *name, bufferptr &bp);
- int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset, bool user_only = false);
+ int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset);
int _setattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset,
const SequencerPosition &spos);
}
int KeyValueStore::getattrs(coll_t cid, const ghobject_t& oid,
- map<string,bufferptr>& aset, bool user_only)
+ map<string,bufferptr>& aset)
{
int r;
map<string, bufferlist> attr_aset;
for (map<string, bufferlist>::iterator i = attr_aset.begin();
i != attr_aset.end(); ++i) {
string key;
- if (user_only) {
- if (i->first[0] != '_')
- continue;
- if (i->first == "_")
- continue;
- key = i->first.substr(1, i->first.size());
- } else {
- key = i->first;
- }
+ key = i->first;
aset.insert(make_pair(key,
bufferptr(i->second.c_str(), i->second.length())));
}
// attrs
int getattr(coll_t cid, const ghobject_t& oid, const char *name,
bufferptr &bp);
- int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset,
- bool user_only = false);
+ int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset);
int _setattrs(coll_t cid, const ghobject_t& oid,
map<string, bufferptr>& aset, BufferTransaction &t);
}
int MemStore::getattrs(coll_t cid, const ghobject_t& oid,
- map<string,bufferptr>& aset, bool user_only)
+ map<string,bufferptr>& aset)
{
dout(10) << __func__ << " " << cid << " " << oid << dendl;
CollectionRef c = get_collection(cid);
ObjectRef o = c->get_object(oid);
if (!o)
return -ENOENT;
- if (user_only) {
- for (map<string,bufferptr>::iterator p = o->xattr.begin();
- p != o->xattr.end();
- ++p) {
- if (p->first.length() > 1 && p->first[0] == '_') {
- aset[p->first.substr(1)] = p->second;
- }
- }
- } else {
- aset = o->xattr;
- }
+ aset = o->xattr;
return 0;
}
bool allow_eio = false);
int fiemap(coll_t cid, const ghobject_t& oid, uint64_t offset, size_t len, bufferlist& bl);
int getattr(coll_t cid, const ghobject_t& oid, const char *name, bufferptr& value);
- int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset, bool user_only = false);
+ int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset);
int list_collections(vector<coll_t>& ls);
bool collection_exists(coll_t c);
* @param cid collection for object
* @param oid oid of object
* @param aset place to put output result.
- * @param user_only true -> only user attributes are return else all attributes are returned
* @returns 0 on success, negative error code on failure.
*/
- virtual int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset, bool user_only = false) = 0;
+ virtual int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>& aset) = 0;
/**
* getattrs -- get all of the xattrs of an object
* @param cid collection for object
* @param oid oid of object
* @param aset place to put output result.
- * @param user_only true -> only user attributes are return else all attributes are returned
* @returns 0 on success, negative error code on failure.
*/
- int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferlist>& aset, bool user_only = false) {
+ int getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferlist>& aset) {
map<string,bufferptr> bmap;
- int r = getattrs(cid, oid, bmap, user_only);
+ int r = getattrs(cid, oid, bmap);
for (map<string,bufferptr>::iterator i = bmap.begin();
i != bmap.end();
++i) {
//Handle attrs for this object
map<string,bufferptr> aset;
- ret = store->getattrs(cid, obj, aset, false);
+ ret = store->getattrs(cid, obj, aset);
if (ret) return ret;
attr_section as(aset);
ret = write_section(TYPE_ATTRS, as, file_fd);