Message ID | eb87d3e8-a3fa-2359-24dc-012ee10543d8@paragon-software.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp201757wrn; Wed, 15 Feb 2023 05:53:16 -0800 (PST) X-Google-Smtp-Source: AK7set9cwebQ8JGIHRSQV6srFD1GnNf9mdOdthtH+ApbgN44KwEXsj6T6f6waJbHe7ocaPoJltuj X-Received: by 2002:a17:906:fca9:b0:8af:370a:c1f8 with SMTP id qw9-20020a170906fca900b008af370ac1f8mr2401115ejb.23.1676469196253; Wed, 15 Feb 2023 05:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676469196; cv=none; d=google.com; s=arc-20160816; b=NeKdGb7gXQSQ51CYxJCn5/JXsGfT5XusZLYV6aP+/VCz2mbEhI4HDt67ItB6WSMmkM yrzzriyfnbIMXZ9EIvmFaX6kAmVVm09H1PcnR3No08+vN5/zGaq61aACFPcg6qa4EsCt MAAYCXRiKgKkTRm1ZlGK9C2AOHEWXrEh/xTwWyCkQnEY3H78ssgAwxwwSZRPrxpCu5uM 1Y62coJAXfK+s00Fs0CsUWzijiOR+RsbW3dcJ4rGoBru6SnoJAXLiIrtdtQkXXIykHAb AZzp/dRpm7rG4bmKYrbZCv6pMwhtOmcmbXCw5eWFvIZo1Fols3aDqgEN2BJ2WpWmnUML iB3g== 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:dkim-signature; bh=b+LLWuFDWYTNULIicKcI1S4EHJN/4plvEY5VcSHrLWg=; b=rd4MqbooDpWBx0RBnQDhYX3qoCkFAjYg69sdFTuZj1WU1OT7xVppBeqUtQwdohin9c idHPaCh0gonLTvSFTYPMuY4zIDzxWqpZazb3NSLZ7MST6ylYNrO6sWpCF7aIqyHOISDW dR5KmUoZJp/9kBxSEHKArV2sFf4rxI8WmCiGKID5i2brKeL2vZzzHQmg51VxPVqLvNMt sMD4NolXj+lAQMv4FL1n9/1IonWFg2wd9AC4MFDb9j4Qlcbw/qdg3QwhayHoJOW+ZXaE Tj+O+y+OZ3cWldURgvSEvtouxt4RPT9Nhy8af6K+1b4dWiiO0r2C8gfJIfBN5Aln+E0P 7x/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b="Q/Yhfksb"; dkim=pass header.i=@paragon-software.com header.s=mail header.b=ptH5fSA1; 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 ui3-20020a170907c90300b007ae10525573si19553886ejc.671.2023.02.15.05.52.47; Wed, 15 Feb 2023 05:53:16 -0800 (PST) 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="Q/Yhfksb"; dkim=pass header.i=@paragon-software.com header.s=mail header.b=ptH5fSA1; 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 S230410AbjBONgv (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 15 Feb 2023 08:36:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjBONgu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Feb 2023 08:36:50 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAC2C358D; Wed, 15 Feb 2023 05:36:48 -0800 (PST) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id AE4042147; Wed, 15 Feb 2023 13:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676467956; bh=b+LLWuFDWYTNULIicKcI1S4EHJN/4plvEY5VcSHrLWg=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=Q/Yhfksb+qlZJt/4SxooKi0BdMWTt4rWIloAIs3pdR8jX3wuZjC6uyvFVJEygSGxA qUfQAD8VSljf5GabnWJAwMIbqa+GC5tWrNBKOuc4ArDXojXIv2GIg4qgHfGkjqsvbM RUE7iQtJBUzaiDMmsz+ntj3SX8NU96W+/1yPV/qA= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 0E8EC1E70; Wed, 15 Feb 2023 13:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676468207; bh=b+LLWuFDWYTNULIicKcI1S4EHJN/4plvEY5VcSHrLWg=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=ptH5fSA1Cz8XKI6v5HdTiOH2aOVUYljEDjk4I6gFH627yI0aZPymi8pOrP5gUwlMs tW7L8ujIRq2JCs26nIJCdQ8r1U1/LsHBdzKlLxGh2FZ9x4mJ3qpflYanYe/wwE7Gdf 0EnfrqssmhRvJu5CANZTFB19MIUDtuWifUzDlQwk= Received: from [192.168.211.36] (192.168.211.36) 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; Wed, 15 Feb 2023 16:36:46 +0300 Message-ID: <eb87d3e8-a3fa-2359-24dc-012ee10543d8@paragon-software.com> Date: Wed, 15 Feb 2023 17:36:46 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 05/11] fs/ntfs3: Undo endian changes Content-Language: en-US From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> To: <ntfs3@lists.linux.dev> CC: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org> References: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com> In-Reply-To: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.211.36] 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757905363883547740?= X-GMAIL-MSGID: =?utf-8?q?1757905363883547740?= |
Series |
fs/ntfs3: Bugfix and refactoring
|
|
Commit Message
Konstantin Komarov
Feb. 15, 2023, 1:36 p.m. UTC
sbi->mft.reserved_bitmap is in-memory (not on-disk!) bitmap.
Assumed cpu endian is faster than fixed endian.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/fsntfs.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
sbi->mft.next_reserved = MFT_REC_FREE;
@@ -720,7 +720,7 @@ int ntfs_look_free_mft(struct ntfs_sb_info *sbi,
CLST *rno, bool mft,
if (*rno >= MFT_REC_FREE)
wnd_set_used(wnd, *rno, 1);
else if (*rno >= MFT_REC_RESERVED && sbi->mft.reserved_bitmap_inited)
- __set_bit_le(*rno - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap);
+ __set_bit(*rno - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap);
out:
if (!mft)
@@ -748,7 +748,7 @@ void ntfs_mark_rec_free(struct ntfs_sb_info *sbi,
CLST rno, bool is_mft)
else
wnd_set_free(wnd, rno, 1);
} else if (rno >= MFT_REC_RESERVED &&
sbi->mft.reserved_bitmap_inited) {
- __clear_bit_le(rno - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap);
+ __clear_bit(rno - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap);
}
if (rno < wnd_zone_bit(wnd))
@@ -846,9 +846,8 @@ void ntfs_update_mftmirr(struct ntfs_sb_info *sbi,
int wait)
{
int err;
struct super_block *sb = sbi->sb;
- u32 blocksize;
+ u32 blocksize, bytes;
sector_t block1, block2;
- u32 bytes;
if (!sb)
return;
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index d888ba14237f..9ed9dd0d8edf 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -646,13 +646,13 @@ int ntfs_look_free_mft(struct ntfs_sb_info *sbi, CLST *rno, bool mft, NULL, 0, NULL, NULL)) goto next; - __clear_bit_le(ir - MFT_REC_RESERVED, + __clear_bit(ir - MFT_REC_RESERVED, &sbi->mft.reserved_bitmap); } } /* Scan 5 bits for zero. Bit 0 == MFT_REC_RESERVED */ - zbit = find_next_zero_bit_le(&sbi->mft.reserved_bitmap, + zbit = find_next_zero_bit(&sbi->mft.reserved_bitmap, MFT_REC_FREE, MFT_REC_RESERVED); if (zbit >= MFT_REC_FREE) {