MCPcopy Create free account
hub / github.com/ceph/ceph / readdir_r_cb

Method readdir_r_cb

src/client/Client.cc:9984–10020  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9982}
9983
9984int Client::readdir_r_cb(dir_result_t* d,
9985 add_dirent_cb_t cb,
9986 void* p,
9987 unsigned want,
9988 unsigned flags,
9989 bool getref)
9990{
9991 auto fill_readdir_cb = [](dir_result_t* dirp,
9992 MetaRequest* req,
9993 InodeRef& diri,
9994 frag_t fg) {
9995 filepath path;
9996 diri->make_nosnap_relative_path(path);
9997 req->set_filepath(path);
9998 req->set_inode(diri.get());
9999 req->head.args.readdir.frag = fg;
10000 req->head.args.readdir.flags = CEPH_READDIR_REPLY_BITFLAGS;
10001 if (dirp->last_name.length()) {
10002 req->path2.set_path(dirp->last_name);
10003 } else if (dirp->hash_order()) {
10004 req->head.args.readdir.offset_hash = dirp->offset_high();
10005 }
10006 req->dirp = dirp;
10007 };
10008 int op = CEPH_MDS_OP_READDIR;
10009 if (d->inode && d->inode->snapid == CEPH_SNAPDIR)
10010 op = CEPH_MDS_OP_LSSNAP;
10011 return _readdir_r_cb(op,
10012 d,
10013 cb,
10014 fill_readdir_cb,
10015 p,
10016 want,
10017 flags,
10018 getref,
10019 false);
10020}
10021
10022//
10023// NB: this is used for both readdir and readdir_snapdiff results processing

Callers 1

fuse_ll_readdirFunction · 0.80

Calls 8

set_inodeMethod · 0.80
hash_orderMethod · 0.80
offset_highMethod · 0.80
set_filepathMethod · 0.45
getMethod · 0.45
lengthMethod · 0.45
set_pathMethod · 0.45

Tested by

no test coverage detected