From patchwork Fri Feb 15 13:05:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth Kumar X-Patchwork-Id: 2147131 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5BD323FCF6 for ; Fri, 15 Feb 2013 13:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161788Ab3BONGe (ORCPT ); Fri, 15 Feb 2013 08:06:34 -0500 Received: from mail-da0-f41.google.com ([209.85.210.41]:47985 "EHLO mail-da0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161356Ab3BONGd (ORCPT ); Fri, 15 Feb 2013 08:06:33 -0500 Received: by mail-da0-f41.google.com with SMTP id e20so1494134dak.28 for ; Fri, 15 Feb 2013 05:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=G21Yj9PQzhyZgXd9W65jLd1t4uiTKAGMq6aUudKWfIw=; b=WdTbhOVc3R1EO1ARt0fOvM8k2naRr6fY+eE5GiFbBHk1thXuzxzsB7iHXLptvjFT89 ivgAWGE0dVMRf4ROzvmfhK4kNpz8ZCbIFYt+xEqAyqbv6lZlRMeDJowiGZTqaSwcE3WO 03xYipR21ZFwEK9NdQY0ODvW1kPbTPVp/Feuq7az1JLg/UuT3r9FspJxmt7zQIVwR8SZ rhaJLPySK1CJC5AWCnJtESbFdA9xAd737C8tuUVvMcDFQ7JgbEy+twDUHW274nOQWhV/ sFk9c3TlN+VHpv79uZqs+xS4qskhl3e5aePOd1T4ZRcOaI2a7fbdfOaeFToG61KKSkL+ Hz4w== X-Received: by 10.68.15.135 with SMTP id x7mr5957416pbc.19.1360933592625; Fri, 15 Feb 2013 05:06:32 -0800 (PST) Received: from localhost.localdomain ([117.192.105.141]) by mx.google.com with ESMTPS id x2sm93602245paw.8.2013.02.15.05.06.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 15 Feb 2013 05:06:32 -0800 (PST) From: Hemanth Kumar To: linux-btrfs@vger.kernel.org, xfs@oss.sgi.com Cc: skjmca51@gmail.com, ganeshkumar14@gmail.com, kirantpatil@gmail.com, praneethu.u@gmail.com, chethan.casey@gmail.com, sensille@gmx.net, bo.li.liu@oracle.com, hugo@carfax.org.uk, sandeen@redhat.com, Hemanth Kumar Subject: [btrfs-progs] testing btrfs hierarchical quotas Date: Fri, 15 Feb 2013 18:35:41 +0530 Message-Id: <1360933541-2894-1-git-send-email-hemanthkumar51@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Hemanth Kumar --- hq.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 hq.sh diff --git a/hq.sh b/hq.sh new file mode 100644 index 0000000..6a0a820 --- /dev/null +++ b/hq.sh @@ -0,0 +1,33 @@ +#! /bin/bash +# Btrfs quotas test case +# Hi all, +# This is shell script to test the hierarchical quotas feature of Btrfs +# I created Btrfs filesystem on a new +# partition, then activated quota management ('btrfs quota enable'), and +# created a few subvolumes of multiple levels. + + +cleanup() +{ + btrfs subvolume delete $TEST_DIR/vol1/vol2/vol3 + btrfs subvolume delete $TEST_DIR/vol1/vol2 + btrfs subvolume delete $TEST_DIR/vol1 + btrfs subvolume disable $TEST_DIR +} + +#trap "_cleanup ; exit \$status" 0 1 2 3 15 + +btrfs quota enable $TEST_DIR +echo "quota enabled on $TEST_DEV" +btrfs subvolume create $TEST_DIR/vol1 +btrfs subvolume create $TEST_DIR/vol1/vol2 +btrfs subvolume create $TEST_DIR/vol1/vol2/vol3 +btrfs qgroup limit 5m $TEST_DIR/vol1 +btrfs qgroup limit 3m $TEST_DIR/vol1/vol2 +btrfs qgroup limit 2m $TEST_DIR/vol1/vol2/vol3 +dd if=$TEST_DEV of=$TEST_DIR/vol1/vol2/vol3/file1 bs=3M count=1 +dd if=$TEST_DEV of=$TEST_DIR/vol1/vol2/file1 bs=2M count=1 +dd if=$TEST_DEV of=$TEST_DIR/vol1/file1 bs=5M count=1 + +cleanup +exit