Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4348217ybz; Tue, 28 Apr 2020 09:46:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLICdcm2iHhqe2ww3FXwoAjE3Fa5OsGsgH+bNdLHWnVH8o5tGirL9Hg5ni4SNmKAvW85RlD X-Received: by 2002:a05:6402:1506:: with SMTP id f6mr23508520edw.217.1588092383749; Tue, 28 Apr 2020 09:46:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588092383; cv=none; d=google.com; s=arc-20160816; b=IkuruOPlaLvaCunFglHqM1tfYSOCWBp//OuBWAChr4B/ntZONSqs14xaP0vWbyy0pk XuDdl9CvvF7hU17wavvi9GzuLL0vYXAGDBrt2oiRq0efZzxMLkfSRR8c3yXvGjwNvxCZ TjP+rXUwGYPGST54dzDkkrghNmklnosWk3Vc2Kv3ni+uybpZfKG8QE3UDMnykQsNuRb5 AfU6nQkvn5JmM/XNvS4ClV5Y+HGcBnI6MRJ0JOeu8t75ZfNA74HBzMRsMvtjTlFwYPMo AYZGDZc89yX8vLmoDNf/HmxshNG7XKOxKN4R33YDKp/6BM69lINEwCKH3JMzpKjUhibH nPtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bTLx0/vdhdK+c66wGKagoZDOiV34AeR0PAXK1hmRwto=; b=g453qIwn0jC1ENREwUz5Jk30hIX8cxpN9ux6GILv8kxWQkOMuuVmEPOCWTotdyUR99 9De4GO1y6c2T6AGF67nUTBPrEaQFq3IENTYyd3ao/wE+rMUsjub6ds09SKNO7IXwkORm 5wK3dkRirYejq0UspBC3J/9V22UoeUi853CPX5q9CaO/l49Vtm2XTW1vIFPl9SIIopGR A88UK5zuWAwnDZIHw3Y4Dd2UpFz6pnYvfrRHVgGGN55yiro1t3mxX33YRyJLjx1RHzmS 4az4bkByEts0cEUXHWp6S/pf9qErrndANAalyWft8V1ArWK3ZwpTxj1N6FGk2uHzbdln FtAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lu+dtWF6; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si1832048edx.311.2020.04.28.09.45.57; Tue, 28 Apr 2020 09:46:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Lu+dtWF6; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728329AbgD1Qpw (ORCPT + 99 others); Tue, 28 Apr 2020 12:45:52 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:26900 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728290AbgD1Qpw (ORCPT ); Tue, 28 Apr 2020 12:45:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588092350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bTLx0/vdhdK+c66wGKagoZDOiV34AeR0PAXK1hmRwto=; b=Lu+dtWF6eNTy+ZtzesXvekoAsd+Syiy5sCNJCtmkwbFDWBpjmI+cukZ0R1gI9E9kN6JDxz llJJG7q+jPZU+mEIurHLrNFqKfoniby6py3xv+h7cF0RQaHpXptos9CWh2gxNA8nnCNTCI 68M+c4S5UYcLUylW0Wu5YRUvu5W6434= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-fKZWidymNzejWz7XrJ7pYQ-1; Tue, 28 Apr 2020 12:45:48 -0400 X-MC-Unique: fKZWidymNzejWz7XrJ7pYQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FF9B107ACCA; Tue, 28 Apr 2020 16:45:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 848931010403; Tue, 28 Apr 2020 16:45:46 +0000 (UTC) From: Lukas Czerner To: linux-ext4@vger.kernel.org Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk Subject: [PATCH v2 02/17] ext4: Add fs parameter specifications for mount options Date: Tue, 28 Apr 2020 18:45:21 +0200 Message-Id: <20200428164536.462-3-lczerner@redhat.com> In-Reply-To: <20200428164536.462-1-lczerner@redhat.com> References: <20200428164536.462-1-lczerner@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Signed-off-by: Lukas Czerner --- fs/ext4/super.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bf5fcb477f66..fed2e4cafb38 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -47,6 +47,9 @@ #include #include =20 +#include +#include + #include "ext4.h" #include "ext4_extents.h" /* Needed for trace points definition */ #include "ext4_jbd2.h" @@ -1521,6 +1524,135 @@ enum { Opt_dioread_nolock, Opt_dioread_lock, Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable, Opt_max_dir_size_kb, Opt_nojournal_checksum, Opt_nombcache, + Opt_errors, Opt_data, Opt_data_err, Opt_jqfmt, +}; + +static const struct constant_table ext4_param_errors[] =3D { + {"continue", Opt_err_cont}, + {"panic", Opt_err_panic}, + {"remount-ro", Opt_err_ro}, + {} +}; + +static const struct constant_table ext4_param_data[] =3D { + {"journal", Opt_data_journal}, + {"ordered", Opt_data_ordered}, + {"writeback", Opt_data_writeback}, + {} +}; + +static const struct constant_table ext4_param_data_err[] =3D { + {"abort", Opt_data_err_abort}, + {"ignore", Opt_data_err_ignore}, + {} +}; + +static const struct constant_table ext4_param_jqfmt[] =3D { + {"vfsold", Opt_jqfmt_vfsold}, + {"vfsv0", Opt_jqfmt_vfsv0}, + {"vfsv1", Opt_jqfmt_vfsv1}, + {} +}; + +/* String parameter that allows empty argument */ +#define fsparam_string_empty(NAME, OPT) \ + __fsparam(fs_param_is_string, NAME, OPT, fs_param_can_be_empty, NULL) + +/* + * Mount option specification + * We don't use fsparam_flag_no because of the way we set the + * options and the way we show them in _ext4_show_options(). To + * keep the changes to a minimum, let's keep the negative options + * separate for now. + */ +static const struct fs_parameter_spec ext4_param_specs[] =3D { + fsparam_flag ("bsddf", Opt_bsd_df), + fsparam_flag ("minixdf", Opt_minix_df), + fsparam_flag ("grpid", Opt_grpid), + fsparam_flag ("bsdgroups", Opt_grpid), + fsparam_flag ("nogrpid", Opt_nogrpid), + fsparam_flag ("sysvgroups", Opt_nogrpid), + fsparam_u32 ("resgid", Opt_resgid), + fsparam_u32 ("resuid", Opt_resuid), + fsparam_u32 ("sb", Opt_sb), + fsparam_enum ("errors", Opt_errors, ext4_param_errors), + fsparam_flag ("nouid32", Opt_nouid32), + fsparam_flag ("debug", Opt_debug), + fsparam_flag ("oldalloc", Opt_removed), + fsparam_flag ("orlov", Opt_removed), + fsparam_flag ("user_xattr", Opt_user_xattr), + fsparam_flag ("nouser_xattr", Opt_nouser_xattr), + fsparam_flag ("acl", Opt_acl), + fsparam_flag ("noacl", Opt_noacl), + fsparam_flag ("norecovery", Opt_noload), + fsparam_flag ("noload", Opt_noload), + fsparam_flag ("bh", Opt_removed), + fsparam_flag ("nobh", Opt_removed), + fsparam_u32 ("commit", Opt_commit), + fsparam_u32 ("min_batch_time", Opt_min_batch_time), + fsparam_u32 ("max_batch_time", Opt_max_batch_time), + fsparam_u32 ("journal_dev", Opt_journal_dev), + fsparam_bdev ("journal_path", Opt_journal_path), + fsparam_flag ("journal_checksum", Opt_journal_checksum), + fsparam_flag ("nojournal_checksum", Opt_nojournal_checksum), + fsparam_flag ("journal_async_commit",Opt_journal_async_commit), + fsparam_flag ("abort", Opt_abort), + fsparam_enum ("data", Opt_data, ext4_param_data), + fsparam_enum ("data_err", Opt_data_err, + ext4_param_data_err), + fsparam_string_empty + ("usrjquota", Opt_usrjquota), + fsparam_string_empty + ("grpjquota", Opt_grpjquota), + fsparam_enum ("jqfmt", Opt_jqfmt, ext4_param_jqfmt), + fsparam_flag ("grpquota", Opt_grpquota), + fsparam_flag ("quota", Opt_quota), + fsparam_flag ("noquota", Opt_noquota), + fsparam_flag ("usrquota", Opt_usrquota), + fsparam_flag ("prjquota", Opt_prjquota), + fsparam_flag ("barrier", Opt_barrier), + fsparam_u32 ("barrier", Opt_barrier), + fsparam_flag ("nobarrier", Opt_nobarrier), + fsparam_flag ("i_version", Opt_i_version), + fsparam_flag ("dax", Opt_dax), + fsparam_u32 ("stripe", Opt_stripe), + fsparam_flag ("delalloc", Opt_delalloc), + fsparam_flag ("nodelalloc", Opt_nodelalloc), + fsparam_flag ("warn_on_error", Opt_warn_on_error), + fsparam_flag ("nowarn_on_error", Opt_nowarn_on_error), + fsparam_flag ("lazytime", Opt_lazytime), + fsparam_flag ("nolazytime", Opt_nolazytime), + fsparam_u32 ("debug_want_extra_isize", + Opt_debug_want_extra_isize), + fsparam_flag ("mblk_io_submit", Opt_removed), + fsparam_flag ("nomblk_io_submit", Opt_removed), + fsparam_flag ("block_validity", Opt_block_validity), + fsparam_flag ("noblock_validity", Opt_noblock_validity), + fsparam_u32 ("inode_readahead_blks", + Opt_inode_readahead_blks), + fsparam_u32 ("journal_ioprio", Opt_journal_ioprio), + fsparam_u32 ("auto_da_alloc", Opt_auto_da_alloc), + fsparam_flag ("auto_da_alloc", Opt_auto_da_alloc), + fsparam_flag ("noauto_da_alloc", Opt_noauto_da_alloc), + fsparam_flag ("dioread_nolock", Opt_dioread_nolock), + fsparam_flag ("nodioread_nolock", Opt_dioread_lock), + fsparam_flag ("dioread_lock", Opt_dioread_lock), + fsparam_flag ("discard", Opt_discard), + fsparam_flag ("nodiscard", Opt_nodiscard), + fsparam_u32 ("init_itable", Opt_init_itable), + fsparam_flag ("init_itable", Opt_init_itable), + fsparam_flag ("noinit_itable", Opt_noinit_itable), + fsparam_u32 ("max_dir_size_kb", Opt_max_dir_size_kb), + fsparam_flag ("test_dummy_encryption", + Opt_test_dummy_encryption), + fsparam_flag ("nombcache", Opt_nombcache), + fsparam_flag ("no_mbcache", Opt_nombcache), /* for backward compatibil= ity */ + fsparam_string ("check", Opt_removed), /* mount option from ext2/3 */ + fsparam_flag ("nocheck", Opt_removed), /* mount option from ext2/3 */ + fsparam_flag ("reservation", Opt_removed), /* mount option from ext2/3= */ + fsparam_flag ("noreservation", Opt_removed), /* mount option from ext2/= 3 */ + fsparam_u32 ("journal", Opt_removed), /* mount option from ext2/3 */ + {} }; =20 static const match_table_t tokens =3D { --=20 2.21.1