return 0;
}
-int PeerReplayer::remote_mkdir(const std::string &epath, const struct ceph_statx &stx,
- const FHandles &fh) {
+int PeerReplayer::SyncMechanism::remote_mkdir(const std::string &epath, const struct ceph_statx &stx) {
dout(10) << ": remote epath=" << epath << dendl;
- int r = ceph_mkdirat(m_remote_mount, fh.r_fd_dir_root, epath.c_str(), stx.stx_mode & ~S_IFDIR);
+ int r = ceph_mkdirat(m_remote, m_fh->r_fd_dir_root, epath.c_str(), stx.stx_mode & ~S_IFDIR);
if (r < 0 && r != -EEXIST) {
derr << ": failed to create remote directory=" << epath << ": " << cpp_strerror(r)
<< dendl;
return r;
}
- r = ceph_chownat(m_remote_mount, fh.r_fd_dir_root, epath.c_str(), stx.stx_uid, stx.stx_gid,
+ r = ceph_chownat(m_remote, m_fh->r_fd_dir_root, epath.c_str(), stx.stx_uid, stx.stx_gid,
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to chown remote directory=" << epath << ": " << cpp_strerror(r)
return r;
}
- r = ceph_chmodat(m_remote_mount, fh.r_fd_dir_root, epath.c_str(), stx.stx_mode & ~S_IFMT,
+ r = ceph_chmodat(m_remote, m_fh->r_fd_dir_root, epath.c_str(), stx.stx_mode & ~S_IFMT,
AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to chmod remote directory=" << epath << ": " << cpp_strerror(r)
struct timespec times[] = {{stx.stx_atime.tv_sec, stx.stx_atime.tv_nsec},
{stx.stx_mtime.tv_sec, stx.stx_mtime.tv_nsec}};
- r = ceph_utimensat(m_remote_mount, fh.r_fd_dir_root, epath.c_str(), times, AT_SYMLINK_NOFOLLOW);
+ r = ceph_utimensat(m_remote, m_fh->r_fd_dir_root, epath.c_str(), times, AT_SYMLINK_NOFOLLOW);
if (r < 0) {
derr << ": failed to change [am]time on remote directory=" << epath << ": "
<< cpp_strerror(r) << dendl;
}
if (S_ISDIR(stx.stx_mode)) {
- r = remote_mkdir(epath, stx, fh);
+ r = syncm->remote_mkdir(epath, stx);
if (r < 0) {
break;
}
bool pop_dataq_entry(PeerReplayer::SyncEntry &out);
void mark_crawl_finished();
+ int remote_mkdir(const std::string &epath, const struct ceph_statx &stx);
protected:
MountRef m_local;
MountRef m_remote;
boost::optional<Snapshot> prev);
int do_sync_snaps(const std::string &dir_root);
- int remote_mkdir(const std::string &epath, const struct ceph_statx &stx, const FHandles &fh);
int remote_file_op(std::shared_ptr<SyncMechanism>& syncm, const std::string &dir_root,
const std::string &epath, const struct ceph_statx &stx,
bool sync_check, const FHandles &fh, bool need_data_sync, bool need_attr_sync);