> > +static void get_store_dir(struct strbuf *buf, int epoch) > +{ > + if (!strcmp(store.driver_name, "simple")) > + strbuf_addf(buf, "%s%08u", obj_path, epoch); > + else if (!strcmp(store.driver_name, "farm")) > + strbuf_addf(buf, "%s", obj_path); > +} Wouldn't it be better to have a get_store_dir in struct store_driver instead of hardcoding the store names here? > int update_epoch_store(uint32_t epoch) > { > - char new[1024]; > - > - snprintf(new, sizeof(new), "%s%08u/", obj_path, epoch); > - mkdir(new, def_dmode); > + if (!strcmp(store.driver_name, "simple")) { > + char new[1024]; > > + snprintf(new, sizeof(new), "%s%08u/", obj_path, epoch); > + mkdir(new, def_dmode); > + } Same here. |