add gcd and fs: move bdev code out of buffer.c