public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
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>
Subject: [PATCH 05/11] fs/ntfs3: Undo endian changes
Date: Wed, 15 Feb 2023 17:36:46 +0400	[thread overview]
Message-ID: <eb87d3e8-a3fa-2359-24dc-012ee10543d8@paragon-software.com> (raw)
In-Reply-To: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com>

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(-)

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) {
              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;
-- 
2.34.1


  parent reply	other threads:[~2023-02-15 13:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 13:33 [PATCH 00/11] fs/ntfs3: Bugfix and refactoring Konstantin Komarov
2023-02-15 13:34 ` [PATCH 01/11] fs/ntfs3: Use bh_read to simplify code Konstantin Komarov
2023-02-15 13:34 ` [PATCH 02/11] fs/ntfs3: Remove noacsrules Konstantin Komarov
2023-02-15 13:35 ` [PATCH 03/11] fs/ntfs3: Fix ntfs_create_inode() Konstantin Komarov
2023-02-15 13:36 ` [PATCH 04/11] fs/ntfs3: Optimization in ntfs_set_state() Konstantin Komarov
2023-02-15 13:36 ` Konstantin Komarov [this message]
2023-02-15 13:37 ` [PATCH 06/11] fs/ntfs3: Undo critial modificatins to keep directory consistency Konstantin Komarov
2023-02-15 13:38 ` [PATCH 07/11] fs/ntfs3: Remove field sbi->used.bitmap.set_tail Konstantin Komarov
2023-02-15 13:38 ` [PATCH 08/11] fs/ntfs3: Changed ntfs_get_acl() to use dentry Konstantin Komarov
2023-02-15 13:39 ` [PATCH 09/11] fs/ntfs3: Code formatting and refactoring Konstantin Komarov
2023-02-15 13:39 ` [PATCH 10/11] fs/ntfs3: Add missed "nocase" in ntfs_show_options Konstantin Komarov
2023-02-15 13:40 ` [PATCH 11/11] fs/ntfs3: Print details about mount fails Konstantin Komarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb87d3e8-a3fa-2359-24dc-012ee10543d8@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntfs3@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox