int Client::_opendir(const char *name, DirResult **dirpp)
{
- *dirpp = new DirResult(name);
+ filepath path(name, 1); // FIXME: always relative to root, for now.
+ *dirpp = new DirResult(path);
// do we have the inode in our cache?
// if so, should be we ask for a different dirfrag?
- filepath path(name);
Dentry *dn = lookup(path);
if (dn && dn->inode) {
(*dirpp)->inode = dn->inode;
dout(10) << "_readdir_get_frag " << dirp << " on " << dirp->path << " fg " << fg << dendl;
MClientRequest *req = new MClientRequest(MDS_OP_READDIR, messenger->get_myinst());
- req->set_path(dirp->path);
+ req->set_filepath(dirp->path);
req->head.args.readdir.frag = fg;
// FIXME where does FUSE maintain user information
static const int64_t MASK = (1 << SHIFT) - 1;
static const off_t END = 1ULL << (SHIFT + 32);
- string path;
+ filepath path;
Inode *inode;
int64_t offset; // high bits: frag_t, low bits: an offset
map<frag_t, vector<DirEntry> > buffer;
- DirResult(const char *p, Inode *in=0) : path(p), inode(in), offset(0) {
- if (inode) inode->get();
- }
- DirResult(const string &p, Inode *in=0) : path(p), inode(in), offset(0) {
+ DirResult(const filepath &fp, Inode *in=0) : path(fp), inode(in), offset(0) {
if (inode) inode->get();
}