Re: [PATCH 07/14] VFS: Add a sample program for fsopen/fsmount [ver #6]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff Layton <jlayton@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux