@@ -98,7 +98,6 @@ IFile *ImageFile::__open_ro_target_file(const std::string &path) {
9898IFile *ImageFile::__open_ro_target_remote (const std::string &dir, const std::string &data_digest,
9999 const uint64_t size, int layer_index) {
100100 std::string url;
101- int64_t extra_range, rand_wait;
102101
103102 if (conf.repoBlobUrl () == " " ) {
104103 set_failed (" empty repoBlobUrl" );
@@ -126,7 +125,6 @@ IFile *ImageFile::__open_ro_target_remote(const std::string &dir, const std::str
126125IFile *ImageFile::__open_ro_remote (const std::string &dir, const std::string &digest,
127126 const uint64_t size, int layer_index) {
128127 std::string url;
129- int64_t extra_range, rand_wait;
130128
131129 if (conf.repoBlobUrl () == " " ) {
132130 set_failed (" empty repoBlobUrl" );
@@ -184,8 +182,8 @@ IFile *ImageFile::__open_ro_remote(const std::string &dir, const std::string &di
184182 LOG_WARN (" failed to open source file, ignore download" );
185183 } else {
186184 BKDL::BkDownload *obj =
187- new BKDL::BkDownload (switch_file, srcfile, size, dir, conf. download (). maxMBps () ,
188- conf.download ().tryCnt (), this , digest, m_status );
185+ new BKDL::BkDownload (switch_file, srcfile, size, dir, digest, url, m_status ,
186+ conf. download (). maxMBps (), conf.download ().tryCnt (), conf. download (). blockSize () );
189187 LOG_DEBUG (" add to download list for `" , dir);
190188 dl_list.push_back (obj);
191189 }
@@ -203,16 +201,17 @@ void ImageFile::start_bk_dl_thread() {
203201 uint64_t extra_range = conf.download ().delayExtra ();
204202 extra_range = (extra_range <= 0 ) ? 30 : extra_range;
205203 uint64_t delay_sec = (rand () % extra_range) + conf.download ().delay ();
206-
204+ LOG_INFO (" background download is enabled, delay `, maxMBps `, tryCnt `, blockSize `" ,
205+ delay_sec, conf.download ().maxMBps (), conf.download ().tryCnt (), conf.download ().blockSize ());
207206 dl_thread_jh = photon::thread_enable_join (
208207 photon::thread_create11 (&BKDL::bk_download_proc, dl_list, delay_sec, m_status));
209208}
210209
211210struct ParallelOpenTask {
212211 std::vector<IFile *> &files;
213212 int eno = 0 ;
214- std::vector<ImageConfigNS::LayerConfig> &layers;
215213 int i = 0 , nlayers;
214+ std::vector<ImageConfigNS::LayerConfig> &layers;
216215
217216 int get_next_job_index () {
218217 LOG_DEBUG (" create job, layer_id: `" , i);
@@ -372,8 +371,6 @@ LSMT::IFileRW *ImageFile::open_upper(ImageConfigNS::UpperConfig &upper) {
372371 IFile *target_file = NULL ;
373372 LSMT::IFileRW *ret = NULL ;
374373
375- int dafa_file_flags = O_RDWR;
376-
377374 data_file = new_sure_file_by_path (upper.data ().c_str (), O_RDWR, this );
378375 if (!data_file) {
379376 LOG_ERROR (" open(`,flags), `:`" , upper.data (), errno, strerror (errno));
0 commit comments