From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 2/2] btrfs: replace i_blocksize by fs_info::sectorsize
Date: Wed, 17 Jan 2024 18:10:19 +0100 [thread overview]
Message-ID: <f1aa45af286b1a85edc76ecf5b884b53accb1bb5.1705511340.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1705511340.git.dsterba@suse.com>
The block size calculated by i_blocksize from inode is the same as what
we have in fs_info, initalized in inode_init_always(). Unify that to use
the fs_info value everywhere.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index f8e1a7ce3d39..bd8d13740f41 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3004,7 +3004,7 @@ static int btrfs_zero_range(struct inode *inode,
}
ret = btrfs_prealloc_file_range(inode, mode, alloc_start,
alloc_end - alloc_start,
- i_blocksize(inode),
+ fs_info->sectorsize,
offset + len, &alloc_hint);
unlock_extent(&BTRFS_I(inode)->io_tree, lockstart, lockend,
&cached_state);
@@ -3176,7 +3176,7 @@ static long btrfs_fallocate(struct file *file, int mode,
if (!ret) {
ret = btrfs_prealloc_file_range(inode, mode,
range->start,
- range->len, i_blocksize(inode),
+ range->len, blocksize,
offset + len, &alloc_hint);
/*
* btrfs_prealloc_file_range() releases space even
--
2.42.1
next prev parent reply other threads:[~2024-01-17 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 17:10 [PATCH 0/2] Block size helper cleanups David Sterba
2024-01-17 17:10 ` [PATCH 1/2] btrfs: replace sb::s_blocksize by fs_info::sectorsize David Sterba
2024-01-17 17:10 ` David Sterba [this message]
2024-01-17 18:53 ` [PATCH 0/2] Block size helper cleanups Josef Bacik
2024-01-18 6:16 ` Anand Jain
2024-01-18 22:29 ` David Sterba
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=f1aa45af286b1a85edc76ecf5b884b53accb1bb5.1705511340.git.dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/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