linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Subvolumes and /proc/self/mountinfo
@ 2012-06-19  0:39 H. Peter Anvin
  2012-06-19 14:22 ` Calvin Walton
  2012-06-19 23:49 ` Chris Mason
  0 siblings, 2 replies; 14+ messages in thread
From: H. Peter Anvin @ 2012-06-19  0:39 UTC (permalink / raw)
  To: linux-btrfs

I'm trying to figure out an algorithm from taking an arbitrary mounted
btrfs directory and break it down into:

<device(s), subvolume, subpath>

where, keep in mind, <subpath> may not actually be part of the mount.

/proc/self/mountinfo seems to have some of that information, however, it
does not appear to distinguish between non-default subvolumes and
directories.  At the same time, once I have mounted a subvolume I see
its name in the root btrfs directory even if I didn't access it.

Questions, thus:

a. Are subvolumes always part of the "root" namespace?  If so, is it the
mounted root, the default subvolume, or subvolume 0 which always exposes
these other subvolumes?  Are there disambiguation rules so that if I
have /btrfs/root/blah and "blah" is both a subvolume and a directory (I
presume that can happen?)

b. Are there better ways (walking the tree using BTRFS_IOC_TREE_SEARCH?)
to accomplish this than using /proc/self/mountinfo?

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-06-20 23:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-19  0:39 Subvolumes and /proc/self/mountinfo H. Peter Anvin
2012-06-19 14:22 ` Calvin Walton
2012-06-19 23:35   ` H. Peter Anvin
2012-06-20  1:27     ` Fajar A. Nugraha
2012-06-20  8:21     ` Hugo Mills
2012-06-19 23:49 ` Chris Mason
2012-06-20  0:03   ` H. Peter Anvin
2012-06-20 13:34     ` Chris Mason
2012-06-20 15:59       ` H. Peter Anvin
2012-06-20  0:39   ` Helmut Hullen
2012-06-20  1:16     ` cwillu
2012-06-20  3:22       ` H. Peter Anvin
2012-06-20  6:31         ` Fajar A. Nugraha
2012-06-20 23:43           ` H. Peter Anvin

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).