inodeno_t created_ino;
bool got_created_ino = false;
ceph::unordered_map<vinodeno_t, Inode*>::iterator p;
+ UserPerm perms(uid, gid);
extra_bl.claim(reply->get_extra_bl());
if (extra_bl.length() >= 8) {
<< " got_ino " << got_created_ino
<< " ino " << created_ino
<< dendl;
- r = _do_lookup(d->dir->parent_inode, d->name, request->regetattr_mask, &target, uid, gid);
+ r = _do_lookup(d->dir->parent_inode, d->name, request->regetattr_mask,
+ &target, perms);
} else {
// if the dentry is not linked, just do our best. see #5021.
assert(0 == "how did this happen? i want logs!");
Inode *in = request->inode();
ldout(cct, 10) << "make_request got traceless reply, forcing getattr on #"
<< in->ino << dendl;
- r = _getattr(in, request->regetattr_mask, uid, gid, true);
+ r = _getattr(in, request->regetattr_mask, perms, true);
target = in;
}
if (r >= 0) {
// ===============================================================
// high level (POSIXy) interface
-int Client::_do_lookup(Inode *dir, const string& name, int mask, InodeRef *target,
- int uid, int gid)
+int Client::_do_lookup(Inode *dir, const string& name, int mask,
+ InodeRef *target, const UserPerm& perms)
{
int op = dir->snapid == CEPH_SNAPDIR ? CEPH_MDS_OP_LOOKUPSNAP : CEPH_MDS_OP_LOOKUP;
MetaRequest *req = new MetaRequest(op);
ldout(cct, 10) << "_do_lookup on " << path << dendl;
- int r = make_request(req, uid, gid, target);
+ int r = make_request(req, perms, target);
ldout(cct, 10) << "_do_lookup res is " << r << dendl;
return r;
}
{
int r = 0;
Dentry *dn = NULL;
+ UserPerm perms(uid, gid);
if (!dir->is_dir()) {
r = -ENOTDIR;
}
}
- r = _do_lookup(dir, dname, mask, target, uid, gid);
+ r = _do_lookup(dir, dname, mask, target, perms);
goto done;
hit_dn:
// internal interface
// call these with client_lock held!
- int _do_lookup(Inode *dir, const string& name, int mask, InodeRef *target, int uid, int gid);
+ int _do_lookup(Inode *dir, const string& name, int mask, InodeRef *target,
+ const UserPerm& perms);
int _lookup(Inode *dir, const string& dname, int mask, InodeRef *target, int uid, int gid);
int _lookup(Inode *dir, const string& dname, int mask, InodeRef *target,
const UserPerm& perm) {