All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: "Yang, Yi Y" <yi.y.yang@intel.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: How to get the default subvolume?
Date: Fri, 8 Jul 2011 12:01:42 +0100	[thread overview]
Message-ID: <20110708110142.GC19280@carfax.org.uk> (raw)
In-Reply-To: <FC2FB65B4D919844ADE4BE3C2BB739AD6B06BC94@shsmsx501.ccr.corp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2821 bytes --]

On Fri, Jul 08, 2011 at 06:28:54PM +0800, Yang, Yi Y wrote:
> From your source, you defined some structures using python and use
> them to get and parse btrfs metadata, very advanced and complicated
> :-), do you know there is any library to provide similar APIs in
> order that I can use some advanced APIs and don't need to worry
> about frequent changes of btrfs superblock and other metadata.

   The fundamental btrfs data structures (which you'll find defined in
ctree.h in the btrfs-progs source, and which are mirrored in my python
code) won't change much, since they define the on-disk layout.
Changing those structures creates incompatible filesystems, which is a
Bad Thing, so it doesn't happen all that often.

   Hugo.

PS. On most development mailing lists, it's conventional to write your
replies below the text you're replying to, not above.

> -----Original Message-----
> From: linux-btrfs-owner@vger.kernel.org [mailto:linux-btrfs-owner@vger.kernel.org] On Behalf Of Hugo Mills
> Sent: Friday, July 08, 2011 6:13 PM
> To: Yang, Yi Y
> Cc: linux-btrfs@vger.kernel.org
> Subject: Re: How to get the default subvolume?
> 
> On Fri, Jul 08, 2011 at 06:06:02PM +0800, Yang, Yi Y wrote:
> > That's great, can you share your source code with me? I'm very eager 
> > to get this now :-)
> 
>    http://carfax.org.uk/btrfs-gui
>    http://git.darksatanic.net/repo/btrfs-gui.git/
> 
>    You probably want the btrfsgui.hlp.subvol.sv_list() function.
> 
>    Hugo.
> 
> > -----Original Message-----
> > From: Hugo Mills [mailto:hugo@carfax.org.uk]
> > Sent: Friday, July 08, 2011 5:58 PM
> > To: Yang, Yi Y
> > Cc: linux-btrfs@vger.kernel.org
> > Subject: Re: How to get the default subvolume?
> > 
> > On Fri, Jul 08, 2011 at 05:58:02PM +0800, Yi Yang wrote:
> > > I know I can set the default subvolume for a btrfs fs using
> > > 
> > > sudo btrfs subvolume set-default 256 /btrfs/mnt
> > > 
> > > But after that, how can get the default subvolume name? In my 
> > > opinion, btrfs-progs should provide "btrfs subvolume get-default 
> > > /btrfs/mnm" to get the default subvolume id and name, I think it is 
> > > very easy to do this in btrfs-progs and btrfs kernel space.
> > 
> >    I don't think the current btrfs-progs will do it. As you pointed 
> > out though, it's pretty easy to write the code to get the information 
> > (I implemented it for btrfs-gui without any additional kernel code, 
> > for example). We just need someone to implement it. :)
> > 
> >    I'd do it myself, but there's about a dozen things higher up my priority list right now.
> > 
> >    Hugo.
> > 
> 

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
                      --- vi: The core of evil. ---                      

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

      reply	other threads:[~2011-07-08 11:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-08  9:58 How to get the default subvolume? Yi Yang
2011-07-08  9:58 ` Hugo Mills
2011-07-08 10:01   ` Andreas Philipp
2011-07-08 10:06   ` Yang, Yi Y
2011-07-08 10:13     ` Hugo Mills
2011-07-08 10:28       ` Yang, Yi Y
2011-07-08 11:01         ` Hugo Mills [this message]

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=20110708110142.GC19280@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=yi.y.yang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.