linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: read global reserve size from space infos
@ 2014-04-22 13:20 David Sterba
  2014-04-22 14:09 ` Hugo Mills
  0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2014-04-22 13:20 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Kernels 3.15 > export the global block reserve as a space info presented
by 'btrfs fi df' but would display 'unknown' instead of some meaningful
string.

Signed-off-by: David Sterba <dsterba@suse.cz>
---

Global_rsv or GlobalRsv or Globalrsv or something else?

 cmds-filesystem.c | 2 ++
 ctree.h           | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 306f715475ac..5a3bbca91458 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -129,6 +129,8 @@ static char *group_type_str(u64 flag)
 		return "Metadata";
 	case BTRFS_BLOCK_GROUP_DATA|BTRFS_BLOCK_GROUP_METADATA:
 		return "Data+Metadata";
+	case BTRFS_SPACE_INFO_GLOBAL_RSV:
+		return "Global_rsv";
 	default:
 		return "unknown";
 	}
diff --git a/ctree.h b/ctree.h
index a4d2cd114614..7e8ced718931 100644
--- a/ctree.h
+++ b/ctree.h
@@ -861,6 +861,8 @@ struct btrfs_csum_item {
 /* used in struct btrfs_balance_args fields */
 #define BTRFS_AVAIL_ALLOC_BIT_SINGLE	(1ULL << 48)
 
+#define BTRFS_SPACE_INFO_GLOBAL_RSV    (1ULL << 49)
+
 #define BTRFS_QGROUP_STATUS_OFF			0
 #define BTRFS_QGROUP_STATUS_ON			1
 #define BTRFS_QGROUP_STATUS_SCANNING		2
-- 
1.9.0


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

* Re: [PATCH] btrfs-progs: read global reserve size from space infos
  2014-04-22 13:20 [PATCH] btrfs-progs: read global reserve size from space infos David Sterba
@ 2014-04-22 14:09 ` Hugo Mills
  2014-04-22 15:12   ` Xavier Bassery
  0 siblings, 1 reply; 5+ messages in thread
From: Hugo Mills @ 2014-04-22 14:09 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

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

On Tue, Apr 22, 2014 at 03:20:00PM +0200, David Sterba wrote:
> Kernels 3.15 > export the global block reserve as a space info presented
> by 'btrfs fi df' but would display 'unknown' instead of some meaningful
> string.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> ---
> 
> Global_rsv or GlobalRsv or Globalrsv or something else?

   Personally, I'd probably go for the camel case GlobalRsv, or
possibly GlbReserve. (Assuming that it's going to be only a single
token without whitespace to make parsing easier).

   Hugo.

>  cmds-filesystem.c | 2 ++
>  ctree.h           | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/cmds-filesystem.c b/cmds-filesystem.c
> index 306f715475ac..5a3bbca91458 100644
> --- a/cmds-filesystem.c
> +++ b/cmds-filesystem.c
> @@ -129,6 +129,8 @@ static char *group_type_str(u64 flag)
>  		return "Metadata";
>  	case BTRFS_BLOCK_GROUP_DATA|BTRFS_BLOCK_GROUP_METADATA:
>  		return "Data+Metadata";
> +	case BTRFS_SPACE_INFO_GLOBAL_RSV:
> +		return "Global_rsv";
>  	default:
>  		return "unknown";
>  	}
> diff --git a/ctree.h b/ctree.h
> index a4d2cd114614..7e8ced718931 100644
> --- a/ctree.h
> +++ b/ctree.h
> @@ -861,6 +861,8 @@ struct btrfs_csum_item {
>  /* used in struct btrfs_balance_args fields */
>  #define BTRFS_AVAIL_ALLOC_BIT_SINGLE	(1ULL << 48)
>  
> +#define BTRFS_SPACE_INFO_GLOBAL_RSV    (1ULL << 49)
> +
>  #define BTRFS_QGROUP_STATUS_OFF			0
>  #define BTRFS_QGROUP_STATUS_ON			1
>  #define BTRFS_QGROUP_STATUS_SCANNING		2

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- Some days,  it's just not worth gnawing through the straps. ---   

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

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

* Re: [PATCH] btrfs-progs: read global reserve size from space infos
  2014-04-22 14:09 ` Hugo Mills
@ 2014-04-22 15:12   ` Xavier Bassery
  2014-04-23 13:30     ` David Sterba
  0 siblings, 1 reply; 5+ messages in thread
From: Xavier Bassery @ 2014-04-22 15:12 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Hugo Mills, David Sterba

On Tue, 22 Apr 2014 15:09:00 +0100
Hugo Mills <hugo@carfax.org.uk> wrote:

> On Tue, Apr 22, 2014 at 03:20:00PM +0200, David Sterba wrote:
> > Kernels 3.15 > export the global block reserve as a space info
> > presented by 'btrfs fi df' but would display 'unknown' instead of
> > some meaningful string.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.cz>
> > ---
> > 
> > Global_rsv or GlobalRsv or Globalrsv or something else?
> 
>    Personally, I'd probably go for the camel case GlobalRsv, or
> possibly GlbReserve. (Assuming that it's going to be only a single
> token without whitespace to make parsing easier).

I second the camel case (if whitespace is to be avoided) and if I may
put my two cents in, what about GlobalReserve?
As pointed by Hugo, this has the same length as Data+Metadata.

Xavier

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

* Re: [PATCH] btrfs-progs: read global reserve size from space infos
  2014-04-22 15:12   ` Xavier Bassery
@ 2014-04-23 13:30     ` David Sterba
  2014-04-23 14:09       ` Chris Mason
  0 siblings, 1 reply; 5+ messages in thread
From: David Sterba @ 2014-04-23 13:30 UTC (permalink / raw)
  To: Xavier Bassery; +Cc: linux-btrfs, Hugo Mills

On Tue, Apr 22, 2014 at 05:12:34PM +0200, Xavier Bassery wrote:
> > > Global_rsv or GlobalRsv or Globalrsv or something else?
> > 
> >    Personally, I'd probably go for the camel case GlobalRsv, or
> > possibly GlbReserve. (Assuming that it's going to be only a single
> > token without whitespace to make parsing easier).
> 
> I second the camel case (if whitespace is to be avoided) and if I may
> put my two cents in, what about GlobalReserve?
> As pointed by Hugo, this has the same length as Data+Metadata.

Sounds good, thank you both for input.

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

* Re: [PATCH] btrfs-progs: read global reserve size from space infos
  2014-04-23 13:30     ` David Sterba
@ 2014-04-23 14:09       ` Chris Mason
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Mason @ 2014-04-23 14:09 UTC (permalink / raw)
  To: dsterba, Xavier Bassery, linux-btrfs, Hugo Mills



On 04/23/2014 09:30 AM, David Sterba wrote:
> On Tue, Apr 22, 2014 at 05:12:34PM +0200, Xavier Bassery wrote:
>>>> Global_rsv or GlobalRsv or Globalrsv or something else?
>>>
>>>     Personally, I'd probably go for the camel case GlobalRsv, or
>>> possibly GlbReserve. (Assuming that it's going to be only a single
>>> token without whitespace to make parsing easier).
>>
>> I second the camel case (if whitespace is to be avoided) and if I may
>> put my two cents in, what about GlobalReserve?
>> As pointed by Hugo, this has the same length as Data+Metadata.
>
> Sounds good, thank you both for input.

GlobalReserve gets my vote too.

-chris


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

end of thread, other threads:[~2014-04-23 14:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-22 13:20 [PATCH] btrfs-progs: read global reserve size from space infos David Sterba
2014-04-22 14:09 ` Hugo Mills
2014-04-22 15:12   ` Xavier Bassery
2014-04-23 13:30     ` David Sterba
2014-04-23 14:09       ` Chris Mason

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