Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25786147rwd; Mon, 3 Jul 2023 00:37:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5v8M+b0LXvB4KqUKyxs/1iyOYumWpOOzIjMg5pO6/uYC6rn9hzOBEcMersTXhEJPNb2qqD X-Received: by 2002:a9d:61d3:0:b0:6b1:5f4a:f52d with SMTP id h19-20020a9d61d3000000b006b15f4af52dmr10404600otk.22.1688369839291; Mon, 03 Jul 2023 00:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688369839; cv=none; d=google.com; s=arc-20160816; b=ApD5uoIUQUgu00fVRcBXgD9qxUzxgUG0y/X+Dz5PwD8SEqQqcJQkAG80/C5+Ikej+b 8NZS2Yb7T10vPYevkKOtck4yDr5my+L/c6AkopVFmE8WsuD/1K4HbjjEdFbX7M/cQT1b fQ25/oMl2YFT7odyL4oN0TBRf+v51N8SiJOcg8c+yALA/OH6cUzTGfuNzY0SpukyiqJ+ WdoydGYKr6K+kekEKY3o9nq7c7HBP0AVOh5BfFNnWmqUcBWMQ0F4d48T/UHZHdwyanyo F+EnEq7hk7SMDUUM0PA2PQFFxk3rdLg7F5vulhetQGRunKuxgp2vl5BDzZF2QmjgI76C rvLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=idQe/8I4/xtf47MoCwShCKiDMRqvp0LjVacaYr6AkWU=; fh=+YFVdCJq57+piIgB3kUO3LUIuYykw/jnC0zhAUs0Z14=; b=pIwTTI+woRuEOsdIabf2dTBUADPuhVY9kMVSnvHrPJH2+aeb/K/OgyOVcV3cADPfRy AvjlERhe6WDzVgGLYPOcn3QqH6Rf2pi/wRoVj8pgYbz/nA4Y0RcMltHQQ/yS2BwHBbuQ 36mRNdCAj3BXU7sgZx424rQZi63SmKfNx7kSDYvaYWNPUCwK7zxK2NH+/lzOBeINayOu 18Zb22hg1Cqi3yZ4DcfprFj5MDrqEDbaE2ijVn1OLU2cOy2C1wRPyVy4CwYq7zWmByh8 l9jHBjcLDbICDaEbHJFgBkezsI8UyJYsoWLsUHd6gFyBSLvhescg2rU8xWE4KSYh+2UG HDCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=jqwwrq8B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020a634d07000000b00553854417d8si18135747pgb.617.2023.07.03.00.37.04; Mon, 03 Jul 2023 00:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=jqwwrq8B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230322AbjGCHZ4 (ORCPT + 99 others); Mon, 3 Jul 2023 03:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjGCHZs (ORCPT ); Mon, 3 Jul 2023 03:25:48 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5FEAE6C; Mon, 3 Jul 2023 00:25:34 -0700 (PDT) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 1F2C31D74; Mon, 3 Jul 2023 07:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1688368821; bh=idQe/8I4/xtf47MoCwShCKiDMRqvp0LjVacaYr6AkWU=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=jqwwrq8B8R664q9ffRJjmOoR2X8CkRNU4rlXglrlwAsRvgRunVJuYY9Nzd/Serb3x wZNXxN6TabamoZsxq4gvnA44ipNC5KLs/YzKRjXVD6bnZ+qF++zZ+TN646VFIW2Hp8 g+7ng2XewnogU8vU+K6qNydqFDKkhcl9brgaeiik= Received: from [192.168.211.138] (192.168.211.138) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Mon, 3 Jul 2023 10:25:32 +0300 Message-ID: Date: Mon, 3 Jul 2023 11:25:31 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: [PATCH 3/8] fs/ntfs3: Minor code refactoring and formatting Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.211.138] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trim spaces and clang-format. Add comment for mi_enum_attr. Signed-off-by: Konstantin Komarov ---  fs/ntfs3/namei.c  | 2 +-  fs/ntfs3/ntfs.h   | 2 +-  fs/ntfs3/record.c | 6 ++++++  fs/ntfs3/super.c  | 3 +--  fs/ntfs3/xattr.c  | 3 ++-  5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 70f8c859e0ad..dd38dbf30add 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -376,7 +376,7 @@ static int ntfs_atomic_open(struct inode *dir, struct dentry *dentry,  #ifdef CONFIG_NTFS3_FS_POSIX_ACL      if (IS_POSIXACL(dir)) { -        /* +        /*           * Load in cache current acl to avoid ni_lock(dir):           * ntfs_create_inode -> ntfs_init_acl -> posix_acl_create ->           * ntfs_get_acl -> ntfs_get_acl_ex -> ni_lock diff --git a/fs/ntfs3/ntfs.h b/fs/ntfs3/ntfs.h index 98b76d1b09e7..86aecbb01a92 100644 --- a/fs/ntfs3/ntfs.h +++ b/fs/ntfs3/ntfs.h @@ -847,7 +847,7 @@ struct OBJECT_ID {      // Birth Volume Id is the Object Id of the Volume on.      // which the Object Id was allocated. It never changes.      struct GUID BirthVolumeId; //0x10: - +      // Birth Object Id is the first Object Id that was      // ever assigned to this MFT Record. I.e. If the Object Id      // is changed for some reason, this field will reflect the diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index c12ebffc94da..cae939cb42cf 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -189,6 +189,12 @@ int mi_read(struct mft_inode *mi, bool is_mft)      return err;  } +/* + * mi_enum_attr - start/continue attributes enumeration in record. + * + * NOTE: mi->mrec - memory of size sbi->record_size + * here we sure that mi->mrec->total == sbi->record_size (see mi_read) + */  struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)  {      const struct MFT_REC *rec = mi->mrec; diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c index 1a02072b6b0e..d24f2da36bb2 100644 --- a/fs/ntfs3/super.c +++ b/fs/ntfs3/super.c @@ -488,7 +488,6 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,  {      int err;      struct super_block *sb = pde_data(file_inode(file)); -    struct ntfs_sb_info *sbi = sb->s_fs_info;      ssize_t ret = count;      u8 *label = kmalloc(count, GFP_NOFS); @@ -502,7 +501,7 @@ static ssize_t ntfs3_label_write(struct file *file, const char __user *buffer,      while (ret > 0 && label[ret - 1] == '\n')          ret -= 1; -    err = ntfs_set_label(sbi, label, ret); +    err = ntfs_set_label(sb->s_fs_info, label, ret);      if (err < 0) {          ntfs_err(sb, "failed (%d) to write label", err); diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 1a518550c317..c59d6f5a725a 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -211,7 +211,8 @@ static ssize_t ntfs_list_ea(struct ntfs_inode *ni, char *buffer,      size = le32_to_cpu(info->size);      /* Enumerate all xattrs. */ -    for (ret = 0, off = 0; off + sizeof(struct EA_FULL) < size; off += ea_size) { +    ret = 0; +    for (off = 0; off + sizeof(struct EA_FULL) < size; off += ea_size) {          ea = Add2Ptr(ea_all, off);          ea_size = unpacked_ea_size(ea); -- 2.34.1