From patchwork Fri Oct 28 17:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 12494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp945223wru; Fri, 28 Oct 2022 10:10:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7eDdFdI0zIyVuWsVUU2B3gJ2JboH+gck/QLeoOW7v2WKyiVyJH9BIvwC6mYOwehIi0uIvk X-Received: by 2002:a17:906:9c83:b0:779:c14c:55e4 with SMTP id fj3-20020a1709069c8300b00779c14c55e4mr279082ejc.619.1666977057943; Fri, 28 Oct 2022 10:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666977057; cv=none; d=google.com; s=arc-20160816; b=D5ijDXoLM7s4U1BbjdZTDhbmdwp11RUUPVoMSJ0Or7mD1vkKDLDfQWdHkFRSXZPJ9w novrf0evq18RFAEOy4UFuqJEVWbfdyQlNi2AyMpnvRywsaM6mFoMLdvI6ymS3AfOuGiI iLGnpe3caLkwvfkIErMmtQgU55pPOlPksBH3xY7eaYzHms1IxZP4m8LxTdLGYQBzsBe7 AEjd8nI45ENTjJtibSMpC5QT5/DYJ6GkDt6Sv4By1Smv5ZJ/mH/v4q7mCiXjxVC3xPT/ sGcB4dv8ruf0Ns1dkWXPlTDtkrfGmbmHnLbUgX+YvPP9CxSVq7/EaWMTly8uW7rtoqSV M+9Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v13-20020a056402348d00b0045be16903d0si467440edc.310.2022.10.28.10.10.33; Fri, 28 Oct 2022 10:10:57 -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: 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747952135603695732?= X-GMAIL-MSGID: =?utf-8?q?1747952135603695732?= 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 {