On 12/28/2011 09:11 PM, Christoph Hellwig wrote: >> >> +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? > I am suspecting that only Simple Store will assume epoch/data layout, so I think we'd better put up with this ugliness, and see if there is a real need to abstract out this operation when new backend store is added later. Plus, this causes smallest changes to adopt it to farm. Thanks, Yuan |