Messages in this thread | | | From | David Howells <> | Subject | Re: [PATCH 07/14] VFS: Add a sample program for fsopen/fsmount [ver #6] | Date | Thu, 26 Oct 2017 23:40:24 +0100 |
| |
Jeff Layton <jlayton@redhat.com> wrote:
> So to make sure I understand.... > > Suppose I want to do a bind mount with the new API. Would I do something > like this? > > mfd = fsopen("???"); > write(mfd, "s /path/to/old/mount");
You would have to use something other than "s" as that indicates the medium source, but there are plenty of other options. Alternatively, something like:
mfd = mntopen("/path/to/old/mount", ...);
You would need some way to retrieve the fs type, though. Maybe the first read() you do will return it:
char fstype[256]; read(mfd, fstype, 256);
ends up with:
"fs <type>"
in the buffer, though I think I'd prefer it to be manually elicited.
> write(mfd, "o bind");
This is unnecessary as you can just do:
> fsmount(mfd, ...);
at this point to achieve the effect.
> That seems a bit klunkier than before as I now need to pay attention to > the fstype. I guess I'd have to scrape /proc/mounts for that info?
I haven't worked out this interface yet. I'm not sure it's actually necessary at this point, though it'd be nice to have.
David
| |