Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2734404rwi; Fri, 28 Oct 2022 10:31:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Japi9DjMh79hZ7fvRkyuActc2HlKuFrSsI2TajJrMte5ZdtOd2XpXjELDmg4hBQbq1eAL X-Received: by 2002:a63:c3:0:b0:439:72d7:7e1f with SMTP id 186-20020a6300c3000000b0043972d77e1fmr523588pga.524.1666978300389; Fri, 28 Oct 2022 10:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666978300; cv=none; d=google.com; s=arc-20160816; b=K6yBoafuKMw9IRF0cLOR0pfICTsfrgZe+ABMudJU348NSdjHfR2nHQcgThSi2DIgDX zpOQOeKxGcxXNc4vmTNdfEdvNJ7v5bcguuCyitTlmZ0P3DFpvqBtaom7JLajS3KZeZM5 JnWpUsr1M/Mg258jqN722Wcz3mzMtlM8ti3+TR7wzIQLqFX3jZ4oGYvaXC6nc9lkP6UF EE7p138v9c/zPH0jI69mQcFqWQkvje1TDYAe12cgIZMBYN2Zmk2QDHC8n7eXGgCGTVsJ 5scmprIxh4Ai5qVR0weStpAqFKL4C2e+qwApNJJotejSGgWNYicEOP4Wk4wHYBGM77HD idZQ== 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=vZQidD9CJW5D93E6fSX67v6fhJf0xZSsvUiQiK86ffE=; b=HccKQKV3xc1Xdze0VFGyQY4N8noSryqXLkXa/3FE0nGs5mU5M9kZR0mKyAi1DmJ1HM qNpTQ73YdENZPE+lah3GZ9+u1vBhbLczmvO3XCYIPRQ0/LooTZ+cJL5sx3vjqNeLYAfV G5Qt8JUgmH97d9m0YDlQ+Msa31C9Nfa5LyAS8hxZD7guGTrkSDjb0TF/enDYOU1RaDOx aRQrrUp/lNk2ma2LA7b/5F3gKcTgZlGejYb4Ar9McMQVYIgYqjvbheihy4xovRvIlWIg FnfhmbiTHwGI2vF/dkQcMOgpJDu6VvmuvzLI8MWNAStPFOQJl95I56Mi3Ws1oxKq+oKZ zsiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=NyNL3VpJ; 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 jd5-20020a170903260500b00178b5e035fcsi5215567plb.496.2022.10.28.10.31.28; Fri, 28 Oct 2022 10:31:40 -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=NyNL3VpJ; 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 S230490AbiJ1RJt (ORCPT + 99 others); Fri, 28 Oct 2022 13:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiJ1RJX (ORCPT ); Fri, 28 Oct 2022 13:09:23 -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 2A18E241B21; Fri, 28 Oct 2022 10:06:47 -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 0BFCD218D; Fri, 28 Oct 2022 17:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1666976647; bh=vZQidD9CJW5D93E6fSX67v6fhJf0xZSsvUiQiK86ffE=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=NyNL3VpJEnie2japjXib21D1rz7EgtMMl+SJmVZwshFGqkdpFtAgcfd8tMb8LQZUQ 4qcv6UNy8SWyEe82+pWEh7MXoRQNh2aA/M04rlZAFkreYsidr7JDt+2E+CM7jLYiJb 8KyuqlN9w0Yaol8e+PniR11N2QOvm7V+VL2Otj6Y= Received: from [172.30.8.65] (172.30.8.65) 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; Fri, 28 Oct 2022 20:06:45 +0300 Message-ID: Date: Fri, 28 Oct 2022 20:06:45 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH 11/14] fs/ntfs3: Use ALIGN kernel macro Content-Language: en-US From: Konstantin Komarov To: CC: , References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.30.8.65] 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 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 This way code will be more readable. Signed-off-by: Konstantin Komarov --- fs/ntfs3/fsntfs.c | 2 +- fs/ntfs3/ntfs.h | 1 - fs/ntfs3/ntfs_fs.h | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index e5a1f4df0397..1e01a3e8e01e 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -479,7 +479,7 @@ static int ntfs_extend_mft(struct ntfs_sb_info *sbi) struct ATTRIB *attr; struct wnd_bitmap *wnd = &sbi->mft.bitmap; - new_mft_total = (wnd->nbits + MFT_INCREASE_CHUNK + 127) & (CLST)~127; + new_mft_total = ALIGN(wnd->nbits + NTFS_MFT_INCREASE_STEP, 128); new_mft_bytes = (u64)new_mft_total << sbi->record_bits; /* Step 1: Resize $MFT::DATA. */ diff --git a/fs/ntfs3/ntfs.h b/fs/ntfs3/ntfs.h index 9cc396b117bf..9f764bf4ed0a 100644 --- a/fs/ntfs3/ntfs.h +++ b/fs/ntfs3/ntfs.h @@ -84,7 +84,6 @@ typedef u32 CLST; #define COMPRESSION_UNIT 4 #define COMPRESS_MAX_CLUSTER 0x1000 -#define MFT_INCREASE_CHUNK 1024 enum RECORD_NUM { MFT_REC_MFT = 0, diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h index c9b8a6f1ba0b..bc02cfb344f9 100644 --- a/fs/ntfs3/ntfs_fs.h +++ b/fs/ntfs3/ntfs_fs.h @@ -198,6 +198,8 @@ struct ntfs_index { /* Minimum MFT zone. */ #define NTFS_MIN_MFT_ZONE 100 +/* Step to increase the MFT. */ +#define NTFS_MFT_INCREASE_STEP 1024 /* Ntfs file system in-core superblock data. */ struct ntfs_sb_info { -- 2.37.0