linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
To: Josef Bacik <jbacik@fb.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup.
Date: Wed, 4 Mar 2015 09:49:45 +0800	[thread overview]
Message-ID: <54F664B9.1090803@cn.fujitsu.com> (raw)
In-Reply-To: <1423563862-9151-1-git-send-email-yangds.fnst@cn.fujitsu.com>

On 02/10/2015 06:24 PM, Dongsheng Yang wrote:
> Hi all,
> 	This patchset is based on [Btrfs: qgroup: part-3: bug fixes.]
>
> I am introducing a type to qgroup, then we can get the numbers what we
> only care about.
>
> Easy way to get the code for testing:
> 	btrfs: https://yangdongsheng@github.com/yangdongsheng/linux.git qgroup_type
>    btrfs-progs: https://yangdongsheng@github.com/yangdongsheng/btrfs-progs.git qgroup_type
> with the patches applied in this series, both in btrfs and btrfs-progs:

Any comment on this patchset?
I think it's a good enhancement for qgroup.

Thanx
>
> [root@atest-guest linux_btrfs]# mkfs.btrfs -O qgroup-type /dev/sdc -f
> Btrfs v3.18-76-ga900a61
> See http://btrfs.wiki.kernel.org for more information.
>
> Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
> Turning ON incompat feature 'skinny-metadata': reduced-size metadata extent refs
> Turning ON incompat feature 'qgroup-type': create qgroup in different type
> fs created label (null) on /dev/sdc
> 	nodesize 16384 leafsize 16384 sectorsize 4096 size 10.00GiB
> [root@atest-guest linux_btrfs]# mount /dev/sdc  /mnt/
> [root@atest-guest linux_btrfs]# btrfs quota enable /mnt
> [root@atest-guest linux_btrfs]# btrfs qgroup show -prce /mnt
> qgroupid         rfer         excl     max_rfer     max_excl parent  child type
> --------         ----         ----     --------     -------- ------  ----- ----
> 0/5          16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> [root@atest-guest linux_btrfs]# btrfs qgroup show -prce /mnt
> qgroupid         rfer         excl     max_rfer     max_excl parent  child type
> --------         ----         ----     --------     -------- ------  ----- ----
> 0/5          16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> 0/257        16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data <--- default type is mixed.
> [root@atest-guest linux_btrfs]# btrfs sub create --qgroup-type data /mnt/sub1
> Create subvolume '/mnt/sub1'
> Set qgroup arguments:
> 	qgroup type: data
> [root@atest-guest linux_btrfs]# btrfs qgroup show -prce /mnt
> qgroupid         rfer         excl     max_rfer     max_excl parent  child type
> --------         ----         ----     --------     -------- ------  ----- ----
> 0/5          16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> 0/257        16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> 0/258           0.00B        0.00B        0.00B        0.00B ---     ---   data     	 <--- create a data qgroup
> [root@atest-guest linux_btrfs]# btrfs qgroup limit -e 5M 0/258 /mnt
> [root@atest-guest linux_btrfs]# btrfs qgroup show -prce /mnt
> qgroupid         rfer         excl     max_rfer     max_excl parent  child type
> --------         ----         ----     --------     -------- ------  ----- ----
> 0/5          16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> 0/257        16.00KiB     16.00KiB        0.00B        0.00B ---     ---   metadata,data
> 0/258           0.00B        0.00B        0.00B      5.00MiB ---     ---   data
> [root@atest-guest linux_btrfs]# dd if=/dev/zero of=/mnt/sub1/data bs=1024
> dd: error writing \u2018/mnt/sub1/data\u2019: Disk quota exceeded
> 5121+0 records in
> 5120+0 records out
> 5242880 bytes (5.2 MB) copied, 0.0218646 s, 240 MB/s
> [root@atest-guest linux_btrfs]# sync
> [root@atest-guest linux_btrfs]# ll /mnt/sub1/data
> -rw-r--r--. 1 root root 5242880 Feb 10 16:17 /mnt/sub1/data
> [root@atest-guest linux_btrfs]# btrfs qgroup show -prce --raw /mnt
> qgroupid         rfer         excl     max_rfer     max_excl parent  child type
> --------         ----         ----     --------     -------- ------  ----- ----
> 0/5             16384        16384            0            0 ---     ---   metadata,data
> 0/257           16384        16384            0            0 ---     ---   metadata,data
> 0/258         5242880      5242880            0      5242880 ---     ---   data   	<--- excl == max_excl == data_size == 5M == 5242880
>
> Dongsheng Yang (7):
>    Btrfs: qgroup: Add type to btrfs_qgroup.
>    btrfs: qgroup: apply type to the recording and accounting.
>    btrfs: qgroup: Apply type to btrfs_qgroup_inherit().
>    btrfs: qgroup: Apply qgroup type to qgroup creating.
>    btrfs: qgroup: Apply qgroup type to subvol creating.
>    btrfs: qgroup: apply type to quota rescan.
>    btrfs: qgroup: fix a bug when type of parent is different with
>      child's.
>
>   fs/btrfs/ctree.h              |  10 ++-
>   fs/btrfs/extent-tree.c        |  48 ++++++-----
>   fs/btrfs/ioctl.c              |  49 ++++++++---
>   fs/btrfs/qgroup.c             | 186 ++++++++++++++++++++++++++++--------------
>   fs/btrfs/qgroup.h             |  29 ++++++-
>   fs/btrfs/tests/qgroup-tests.c |  19 +++--
>   fs/btrfs/transaction.c        |  13 +--
>   include/uapi/linux/btrfs.h    |   1 +
>   8 files changed, 246 insertions(+), 109 deletions(-)
>


  parent reply	other threads:[~2015-03-04  1:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 10:24 [RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup Dongsheng Yang
2015-02-10 10:24 ` [PATCH 1/4] btrfs-progs: Add type to qgroup Dongsheng Yang
2015-02-10 10:24 ` [PATCH 1/7] Btrfs: qgroup: Add type to btrfs_qgroup Dongsheng Yang
2015-02-10 10:24 ` [PATCH 2/4] btrfs-progs: specify qgroup type when creating subvolume Dongsheng Yang
2015-02-10 10:24 ` [PATCH 2/7] btrfs: qgroup: apply type to the recording and accounting Dongsheng Yang
2015-02-10 10:24 ` [PATCH 3/4] btrfs-progs:specify qgroup type when creating qgroup Dongsheng Yang
2015-02-10 10:24 ` [PATCH 3/7] btrfs: qgroup: Apply type to btrfs_qgroup_inherit() Dongsheng Yang
2015-02-10 10:24 ` [PATCH 4/4] btrfs-progs:show qgroup type Dongsheng Yang
2015-02-10 10:24 ` [PATCH 4/7] btrfs: qgroup: Apply qgroup type to qgroup creating Dongsheng Yang
2015-02-10 10:24 ` [PATCH 5/7] btrfs: qgroup: Apply qgroup type to subvol creating Dongsheng Yang
2015-02-10 10:24 ` [PATCH 6/7] btrfs: qgroup: apply type to quota rescan Dongsheng Yang
2015-02-10 10:24 ` [PATCH 7/7] btrfs: qgroup: fix a bug when type of parent is different with child's Dongsheng Yang
2015-03-04  1:49 ` Dongsheng Yang [this message]
2015-03-17 10:08 ` [RFC PATCH 0/7] Btrfs: qgroup: part-4: Add type to btrfs qgroup Dongsheng Yang

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=54F664B9.1090803@cn.fujitsu.com \
    --to=yangds.fnst@cn.fujitsu.com \
    --cc=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 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).