]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fs/ntfs3: Remove unused ntfs_sb_read
authorDr. David Alan Gilbert <linux@treblig.org>
Wed, 19 Feb 2025 01:45:55 +0000 (01:45 +0000)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 6 Mar 2025 16:53:27 +0000 (19:53 +0300)
ntfs_sb_read() was added in 2021 by
commit 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
but hasn't been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/fsntfs.c
fs/ntfs3/ntfs_fs.h

index 938d351ebac721646cd0f0c69979964491679c70..df81f1f7330cf97df7ce2788e79733c2a62aedbd 100644 (file)
@@ -1035,34 +1035,6 @@ struct buffer_head *ntfs_bread(struct super_block *sb, sector_t block)
        return NULL;
 }
 
-int ntfs_sb_read(struct super_block *sb, u64 lbo, size_t bytes, void *buffer)
-{
-       struct block_device *bdev = sb->s_bdev;
-       u32 blocksize = sb->s_blocksize;
-       u64 block = lbo >> sb->s_blocksize_bits;
-       u32 off = lbo & (blocksize - 1);
-       u32 op = blocksize - off;
-
-       for (; bytes; block += 1, off = 0, op = blocksize) {
-               struct buffer_head *bh = __bread(bdev, block, blocksize);
-
-               if (!bh)
-                       return -EIO;
-
-               if (op > bytes)
-                       op = bytes;
-
-               memcpy(buffer, bh->b_data + off, op);
-
-               put_bh(bh);
-
-               bytes -= op;
-               buffer = Add2Ptr(buffer, op);
-       }
-
-       return 0;
-}
-
 int ntfs_sb_write(struct super_block *sb, u64 lbo, size_t bytes,
                  const void *buf, int wait)
 {
index 2034dca90a5e52e531c87af7366102fddce34a9a..0e34c944b6220ac1cc725bd784b4b6db98cac6a9 100644 (file)
@@ -616,7 +616,6 @@ enum NTFS_DIRTY_FLAGS {
        NTFS_DIRTY_ERROR = 2,
 };
 int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty);
-int ntfs_sb_read(struct super_block *sb, u64 lbo, size_t bytes, void *buffer);
 int ntfs_sb_write(struct super_block *sb, u64 lbo, size_t bytes,
                  const void *buffer, int wait);
 int ntfs_sb_write_run(struct ntfs_sb_info *sbi, const struct runs_tree *run,