From: Eric Wheeler <bcache@lists.ewheeler.net>
To: Kent Overstreet <kent.overstreet@gmail.com>
Cc: linux-bcache@vger.kernel.org
Subject: Re: bcachefs: can bcachefs export block devices?
Date: Wed, 3 Aug 2016 17:30:02 -0700 (PDT) [thread overview]
Message-ID: <alpine.LRH.2.11.1608031727480.10662@mail.ewheeler.net> (raw)
In-Reply-To: <20160525225113.GA20180@kmo-pixel>
On Wed, 25 May 2016, Kent Overstreet wrote:
> On Wed, May 25, 2016 at 02:47:29PM -0700, Eric Wheeler wrote:
> >
> > I have a few bcachefs questions that pertain to its use with block
> > devices.
> >
> > Does bcachefs's implementation reuse and update the existing
> > bcache code such that the block device driver inherits the bcachefs
> > improvements? I understand the cache superblock changed, maybe the cached
> > dev super too.
>
> Yes, all of the existing functionality is still there (though some of it's
> broken at the moment because I haven't been running those tests; if you're
> interested in using bcache-dev for the old style caching (there are performance
> and robustness improvements) it wouldn't take me long to get it working again).
>
> > Can bcachefs provide /dev/bcacheN devices without loop.ko?
> >
> > If so, are these simply filesystem objects (files)?
>
> No, at least not currently - the "export a block device" code and the filesystem
> code are effectively thin wrappers around the core bcache IO path (bch_read()
> and bch_write()) - but the two different interfaces don't have anything to do
> with each other.
>
> The way it works is the first 4096 inode numbers are owned by the block device
> interface - inodes in that range are for either cached devices or thin
> provisioned volumes. The filesystem code owns inode numbers >= 4096.
>
> So while blockdev volumes/cached data do have inodes, they're not reachable via
> the filesystem because there will never be dirents that point to them (also,
> they use a different inode type with extra fields for the UUID/label).
>
> However - there isn't anything preventing us from writing a bit of new code and
> hooking it up to an ioctl or sysfs interface to say "look up this path and
> create a block device for that file". The only remotely tricky bit would be
> pagecache cache coherency, but I think you get the new block device to just use
> the same address_space (pagecache cache for an inode) as the filesystem inode.
>
> So, probably doable in ~100 lines of code or so.
Hey Kent,
I noticed that blockdev.c got an overhaul in bcache-dev recently. Getting
closer to blockdev export from bcachefs?
Actually it looks like you've been pretty busy on that branch in general.
What's new?
--
Eric Wheeler
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2016-08-04 0:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 21:47 bcachefs: can bcachefs export block devices? Eric Wheeler
2016-05-25 22:51 ` Kent Overstreet
2016-05-28 2:45 ` Eric Wheeler
2016-08-04 6:08 ` Kent Overstreet
2016-08-04 23:46 ` Eric Wheeler
2016-08-06 4:34 ` Kent Overstreet
2017-02-09 22:17 ` Eric Wheeler
2017-02-09 22:41 ` Martin Raiber
2016-08-04 0:30 ` Eric Wheeler [this message]
2016-08-04 6:04 ` Kent Overstreet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LRH.2.11.1608031727480.10662@mail.ewheeler.net \
--to=bcache@lists.ewheeler.net \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).