}
-// low-level attr helpers
-int FileStore::_getattr(coll_t cid, const hobject_t& oid, const char *name, bufferptr& bp)
-{
- char val[100];
- int l = lfn_getxattr(cid, oid, name, val, sizeof(val));
- if (l >= 0) {
- bp = buffer::create(l);
- memcpy(bp.c_str(), val, l);
- } else if (l == -ERANGE) {
- l = lfn_getxattr(cid, oid, name, 0, 0);
- if (l > 0) {
- bp = buffer::create(l);
- l = lfn_getxattr(cid, oid, name, bp.c_str(), l);
- }
- }
- return l;
-}
-
-int FileStore::_getattr(const char *fn, const char *name, bufferptr& bp)
-{
- char val[100];
- int l = chain_getxattr(fn, name, val, sizeof(val));
- if (l >= 0) {
- bp = buffer::create(l);
- memcpy(bp.c_str(), val, l);
- } else if (l == -ERANGE) {
- l = chain_getxattr(fn, name, 0, 0);
- if (l > 0) {
- bp = buffer::create(l);
- l = chain_getxattr(fn, name, bp.c_str(), l);
- }
- }
- assert(!m_filestore_fail_eio || l != -EIO);
- return l;
-}
-
-
// objects
int FileStore::getattr(coll_t cid, const hobject_t& oid, const char *name, bufferptr &bp)
int getattr(coll_t cid, const hobject_t& oid, const char *name, bufferptr &bp);
int getattrs(coll_t cid, const hobject_t& oid, map<string,bufferptr>& aset, bool user_only = false);
- int _getattr(coll_t cid, const hobject_t& oid, const char *name, bufferptr& bp);
- int _getattr(const char *fn, const char *name, bufferptr& bp);
-
int _setattrs(coll_t cid, const hobject_t& oid, map<string,bufferptr>& aset,
const SequencerPosition &spos);
int _rmattr(coll_t cid, const hobject_t& oid, const char *name,