From patchwork Tue Sep 15 09:02:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Dongsheng X-Patchwork-Id: 7182381 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24C7DBEEC1 for ; Tue, 15 Sep 2015 09:33:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3CE2D205F1 for ; Tue, 15 Sep 2015 09:32:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4791B205E9 for ; Tue, 15 Sep 2015 09:32:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755381AbbIOJcq (ORCPT ); Tue, 15 Sep 2015 05:32:46 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:19552 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754306AbbIOJJi (ORCPT ); Tue, 15 Sep 2015 05:09:38 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100730414" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 15 Sep 2015 17:12:29 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t8F99MEk008125; Tue, 15 Sep 2015 17:09:22 +0800 Received: from yds-PC.g08.fujitsu.local (10.167.226.66) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Tue, 15 Sep 2015 17:09:36 +0800 From: Dongsheng Yang To: , , , CC: , , Dongsheng Yang Subject: [PATCH v3 39/39] ubifs: introduce quota related mount options Date: Tue, 15 Sep 2015 17:02:34 +0800 Message-ID: <1442307754-13233-40-git-send-email-yangds.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1442307754-13233-1-git-send-email-yangds.fnst@cn.fujitsu.com> References: <1442307754-13233-1-git-send-email-yangds.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.66] Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This commit introduce mount options of quota, noquota, usrquota and grpquota. These options are used to make ubifs support quota. Signed-off-by: Dongsheng Yang --- fs/ubifs/super.c | 30 ++++++++++++++++++++++++++++++ fs/ubifs/ubifs.h | 4 ++++ 2 files changed, 34 insertions(+) diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index da16c65..e7e68ee 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include "ubifs.h" @@ -443,6 +444,12 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root) else if (c->mount_opts.chk_data_crc == 1) seq_puts(s, ",no_chk_data_crc"); + if (c->usrquota) + seq_puts(s, ",usrquota"); + + if (c->grpquota) + seq_puts(s, ",grpquota"); + if (c->mount_opts.override_compr) { seq_printf(s, ",compr=%s", ubifs_compr_name(c->mount_opts.compr_type)); @@ -1112,6 +1119,10 @@ enum { Opt_chk_data_crc, Opt_no_chk_data_crc, Opt_override_compr, + Opt_ignore, + Opt_quota, + Opt_usrquota, + Opt_grpquota, Opt_err, }; @@ -1123,6 +1134,10 @@ static const match_table_t tokens = { {Opt_chk_data_crc, "chk_data_crc"}, {Opt_no_chk_data_crc, "no_chk_data_crc"}, {Opt_override_compr, "compr=%s"}, + {Opt_ignore, "noquota"}, + {Opt_quota, "quota"}, + {Opt_usrquota, "usrquota"}, + {Opt_grpquota, "grpquota"}, {Opt_err, NULL}, }; @@ -1223,6 +1238,21 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options, c->default_compr = c->mount_opts.compr_type; break; } +#ifdef CONFIG_QUOTA + case Opt_quota: + case Opt_usrquota: + c->usrquota = 1; + break; + case Opt_grpquota: + c->grpquota = 1; + break; +#else + case Opt_quota: + case Opt_usrquota: + case Opt_grpquota: + ubifs_err(c, "quota operations not supported"); + break; +#endif default: { unsigned long flag; diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 21b5dc0..ef06af7 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h @@ -1044,6 +1044,8 @@ struct ubifs_debug_info; * @bulk_read: enable bulk-reads * @default_compr: default compression algorithm (%UBIFS_COMPR_LZO, etc) * @rw_incompat: the media is not R/W compatible + * @usrquota: enable usrquota + * @grpquota: enable grpquota * * @tnc_mutex: protects the Tree Node Cache (TNC), @zroot, @cnext, @enext, and * @calc_idx_sz @@ -1285,6 +1287,8 @@ struct ubifs_info { unsigned int bulk_read:1; unsigned int default_compr:2; unsigned int rw_incompat:1; + unsigned int usrquota:1; + unsigned int grpquota:1; struct mutex tnc_mutex; struct ubifs_zbranch zroot;