FileStore: remove the user_only param from _fgetattrs

Nobody sets it to true, so remove it!

Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
Greg Farnum 2014-05-20 13:09:26 -07:00
parent bb4e3a9fbc
commit f9787224ba
2 changed files with 9 additions and 17 deletions

View File

@ -2946,7 +2946,7 @@ int FileStore::_clone(coll_t cid, const ghobject_t& oldoid, const ghobject_t& ne
{
char buf[2];
map<string, bufferptr> aset;
r = _fgetattrs(**o, aset, false);
r = _fgetattrs(**o, aset);
if (r < 0)
goto out3;
@ -3537,7 +3537,7 @@ int FileStore::_fgetattr(int fd, const char *name, bufferptr& bp)
return l;
}
int FileStore::_fgetattrs(int fd, map<string,bufferptr>& aset, bool user_only)
int FileStore::_fgetattrs(int fd, map<string,bufferptr>& aset)
{
// get attr list
char names1[100];
@ -3571,17 +3571,9 @@ int FileStore::_fgetattrs(int fd, map<string,bufferptr>& aset, bool user_only)
while (name < end) {
char *attrname = name;
if (parse_attrname(&name)) {
char *set_name = name;
bool can_get = true;
if (user_only) {
if (*set_name =='_')
set_name++;
else
can_get = false;
}
if (*set_name && can_get) {
if (*name) {
dout(20) << "fgetattrs " << fd << " getting '" << name << "'" << dendl;
int r = _fgetattr(fd, attrname, aset[set_name]);
int r = _fgetattr(fd, attrname, aset[name]);
if (r < 0)
return r;
}
@ -3719,7 +3711,7 @@ int FileStore::getattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr>
if (r >= 0 && !strncmp(buf, XATTR_NO_SPILL_OUT, sizeof(XATTR_NO_SPILL_OUT)))
spill_out = false;
r = _fgetattrs(**fd, aset, false);
r = _fgetattrs(**fd, aset);
if (r < 0) {
goto out;
}
@ -3790,7 +3782,7 @@ int FileStore::_setattrs(coll_t cid, const ghobject_t& oid, map<string,bufferptr
else
spill_out = 1;
r = _fgetattrs(**fd, inline_set, false);
r = _fgetattrs(**fd, inline_set);
assert(!m_filestore_fail_eio || r != -EIO);
dout(15) << "setattrs " << cid << "/" << oid << dendl;
@ -3925,7 +3917,7 @@ int FileStore::_rmattrs(coll_t cid, const ghobject_t& oid,
spill_out = false;
}
r = _fgetattrs(**fd, aset, false);
r = _fgetattrs(**fd, aset);
if (r >= 0) {
for (map<string,bufferptr>::iterator p = aset.begin(); p != aset.end(); ++p) {
char n[CHAIN_XATTR_MAX_NAME_LEN];
@ -4030,7 +4022,7 @@ int FileStore::collection_getattrs(coll_t cid, map<string,bufferptr>& aset)
r = -errno;
goto out;
}
r = _fgetattrs(fd, aset, false);
r = _fgetattrs(fd, aset);
VOID_TEMP_FAILURE_RETRY(::close(fd));
out:
dout(10) << "collection_getattrs " << fn << " = " << r << dendl;

View File

@ -461,7 +461,7 @@ public:
int _remove(coll_t cid, const ghobject_t& oid, const SequencerPosition &spos);
int _fgetattr(int fd, const char *name, bufferptr& bp);
int _fgetattrs(int fd, map<string,bufferptr>& aset, bool user_only);
int _fgetattrs(int fd, map<string,bufferptr>& aset);
int _fsetattrs(int fd, map<string, bufferptr> &aset);
void _start_sync();