Hi, I managed to build it tonight. Although, it took some tuning. The problem is with bcache.h header file (the one that resides in include/trace/events/). It includes "alloc_types.h", but there is no alloc_types.h in that directory. I think, you use customized Makefile with extra directories added to -I argument. I fixed it by moving alloc_types and clock_types headers to include/trace/events/ from the bcache module directory. I attached the diff if anyone is interested. To anyone who wants to build this bcache version: you'll need to either rebase the code on the kernel version you are working with or extract a diff from bcache-dev branch against 4.1 vanilla kernel and then apply it to your kernel, then the patch I attached. Or probably Kent will fix it soon enough, so you won't need silly workarounds. On Fri, Jul 17, 2015 at 10:12 PM, Kent Overstreet <kent.overstreet@xxxxxxxxx> wrote: > On Fri, Jul 17, 2015 at 08:01:43PM -0400, Denis Bychkov wrote: >> Hi, >> >> I actually tried to compile that code recently (maybe 5 days ago) and >> it did not change since then. There was a bunch of trivial errors, >> that I was able to fix - files moved around without #include updated, >> types missing. But at some point I ran into something definitely >> non-trivial: there is a variable in io.c, which is supposed to have a >> node id in it, but the init code commented out and there is no obvious >> way to fix it. So I gave up. I definitely tried the branch you are >> talking about - bcache-dev. > > It didn't build? Weird - can you post some of the compiler errors you were > seeing, as well as your archictecture/gcc version? I don't know of any build > errors right now... > >> >> Here is the I code I mentioned: >> >> static void bch_read_retry(struct bbio *bbio) >> { >> struct bio *bio = &bbio->bio; >> struct bio *parent; >> u64 inode; >> >> trace_bcache_read_retry(bio); >> >> /* >> * This used to be a leaf bio from bch_read_fn(), but >> * since we don't know what happened to the btree in >> * the meantime, we have to re-submit it via the >> * top-level bch_read() entry point. Before doing that, >> * we have to reset the bio, preserving the biovec. >> * >> * The inode, offset and size come from the bbio's key, >> * which was set by bch_read_fn(). >> */ >> //inode = bbio->key.k.p.inode; >> parent = bio->bi_private; >> >> bch_bbio_reset(bbio); >> bio_chain(bio, parent); >> >> bch_read(bbio->ca->set, bio, inode); >> bio_endio(parent, 0); /* for bio_chain() in bch_read_fn() */ >> bio_endio(bio, 0); >> } > > The read retry path is currently non functional, since I added > checksumming/compression support - the read path needs a fair bit more work. But > that shouldn't cause a build error - and the race the retry path is for is damn > near impossible to trigger without fault injection (I don't think I've ever seen > it happen without fault injection). -- Denis
Attachment:
bcache-fix-includes.patch
Description: Binary data