lkml.org 
[lkml]   [2017]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 07/14] VFS: Add a sample program for fsopen/fsmount [ver #6]
Date
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

\
 
 \ /
  Last update: 2017-10-27 00:41    [W:0.154 / U:1.404 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site