return r;
}
+int Client::lookup_ino(inodeno_t ino)
+{
+ Mutex::Locker lock(client_lock);
+ dout(3) << "lookup_ino enter(" << ino << ") = " << dendl;
+
+ MetaRequest *req = new MetaRequest(CEPH_MDS_OP_LOOKUPINO);
+ filepath path(ino);
+ req->set_filepath(path);
+
+ int r = make_request(req, -1, -1, NULL, rand() % mdsmap->get_num_mds());
+ dout(3) << "lookup_ino exit(" << ino << ") = " << r << dendl;
+ return r;
+}
+
Fh *Client::_create_fh(Inode *in, int flags, int cmode)
{
// yay
int mknod(const char *path, mode_t mode, dev_t rdev=0);
int open(const char *path, int flags, mode_t mode=0);
int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name);
+ int lookup_ino(inodeno_t ino);
int close(int fd);
loff_t lseek(int fd, loff_t offset, int whence);
int read(int fd, char *buf, loff_t size, loff_t offset=-1);
syn_sargs.push_back(args[++i]);
syn_sargs.push_back(args[++i]);
syn_sargs.push_back(args[++i]);
+ } else if (strcmp(args[i], "lookupino") == 0) {
+ syn_modes.push_back(SYNCLIENT_MODE_LOOKUPINO);
+ syn_sargs.push_back(args[++i]);
} else if (strcmp(args[i], "chunkfile") == 0) {
syn_modes.push_back(SYNCLIENT_MODE_CHUNK);
}
}
break;
+ case SYNCLIENT_MODE_LOOKUPINO:
+ {
+ inodeno_t ino;
+ string iname = get_sarg(0);
+ sscanf(iname.c_str(), "%llx", (long long unsigned*)&ino.val);
+ if (run_me()) {
+ lookup_ino(ino);
+ }
+ }
+ break;
case SYNCLIENT_MODE_MKSNAP:
{
return r;
}
+int SyntheticClient::lookup_ino(inodeno_t ino)
+{
+ int r = client->lookup_ino(ino);
+ dout(0) << "lookup_ino(" << ino << ") = " << r << dendl;
+ return r;
+}
+
int SyntheticClient::chunk_file(string &filename)
{
int fd = client->open(filename.c_str(), O_RDONLY);
#define SYNCLIENT_MODE_DUMP 63
#define SYNCLIENT_MODE_LOOKUPHASH 70
+#define SYNCLIENT_MODE_LOOKUPINO 71
#define SYNCLIENT_MODE_TRUNCATE 200
void import_find(const char *basedir, const char *find, bool writedata);
int lookup_hash(inodeno_t ino, inodeno_t dirino, const char *name);
+ int lookup_ino(inodeno_t ino);
int chunk_file(string &filename);