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

Function ceph_readdir_snapdiff

src/libcephfs.cc:924–949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922}
923
924extern "C" int ceph_readdir_snapdiff(struct ceph_snapdiff_info* snapdiff,
925 struct ceph_snapdiff_entry_t* out)
926{
927 if (!snapdiff->cmount->is_mounted()) {
928 /* also sets errno to signal errors. */
929 errno = ENOTCONN;
930 return -errno;
931 }
932 dir_result_t* d1 = reinterpret_cast<dir_result_t*>(snapdiff->dir1);
933 dir_result_t* d2 = reinterpret_cast<dir_result_t*>(snapdiff->dir_aux);
934 if (!d1 || !d2 || !d1->inode || !d2->inode) {
935 errno = EINVAL;
936 return -errno;
937 }
938 snapid_t snapid;
939 int r = snapdiff->cmount->get_client()->readdir_snapdiff(
940 d1,
941 d2->inode->snapid,
942 &(out->dir_entry),
943 &snapid);
944 if (r >= 0) {
945 // converting snapid_t to uint64_t to avoid snapid_t exposure
946 out->snapid = snapid;
947 }
948 return r;
949}
950
951extern "C" int ceph_close_snapdiff(struct ceph_snapdiff_info* snapdiff)
952{

Callers 2

next_entryMethod · 0.85

Calls 3

readdir_snapdiffMethod · 0.80
is_mountedMethod · 0.45
get_clientMethod · 0.45

Tested by 1