mbox series

[0/2] Block size helper cleanups

Message ID cover.1705511340.git.dsterba@suse.com (mailing list archive)
Headers show
Series Block size helper cleanups | expand

Message

David Sterba Jan. 17, 2024, 5:10 p.m. UTC
Unify using fs_info::sectorsize for inode or superblock.

David Sterba (2):
  btrfs: replace sb::s_blocksize by fs_info::sectorsize
  btrfs: replace i_blocksize by fs_info::sectorsize

 fs/btrfs/disk-io.c   | 2 ++
 fs/btrfs/extent_io.c | 4 ++--
 fs/btrfs/file.c      | 4 ++--
 fs/btrfs/inode.c     | 2 +-
 fs/btrfs/ioctl.c     | 2 +-
 fs/btrfs/reflink.c   | 6 +++---
 fs/btrfs/send.c      | 2 +-
 fs/btrfs/super.c     | 2 +-
 8 files changed, 13 insertions(+), 11 deletions(-)

Comments

Josef Bacik Jan. 17, 2024, 6:53 p.m. UTC | #1
On Wed, Jan 17, 2024 at 06:10:13PM +0100, David Sterba wrote:
> Unify using fs_info::sectorsize for inode or superblock.
> 
> David Sterba (2):
>   btrfs: replace sb::s_blocksize by fs_info::sectorsize
>   btrfs: replace i_blocksize by fs_info::sectorsize

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
Anand Jain Jan. 18, 2024, 6:16 a.m. UTC | #2
Sorry for the late comments. Looks good

  Reviewed-by: Anand Jain <anand.jain@oracle.com>



just one nit:
You may also bring the following repetitive code into a new
helper function as it is used once in init_mount_fs_info()
and again  in open_ctree():

         sb->s_blocksize = sectorsize;
         sb->s_blocksize_bits = blksize_bits(sectorsize);

For example:
   static inline void btrfs_set_blocksize(struct super_block *sb,
                                          int sectorsize)
   {
       sb->s_blocksize = sectorsize;
       sb->s_blocksize_bits = blksize_bits(sectorsize);
   }

   btrfs_set_blocksize(sb, sectorsize);




On 1/18/24 01:10, David Sterba wrote:
> Unify using fs_info::sectorsize for inode or superblock.
> 
> David Sterba (2):
>    btrfs: replace sb::s_blocksize by fs_info::sectorsize
>    btrfs: replace i_blocksize by fs_info::sectorsize
> 
>   fs/btrfs/disk-io.c   | 2 ++
>   fs/btrfs/extent_io.c | 4 ++--
>   fs/btrfs/file.c      | 4 ++--
>   fs/btrfs/inode.c     | 2 +-
>   fs/btrfs/ioctl.c     | 2 +-
>   fs/btrfs/reflink.c   | 6 +++---
>   fs/btrfs/send.c      | 2 +-
>   fs/btrfs/super.c     | 2 +-
>   8 files changed, 13 insertions(+), 11 deletions(-)
David Sterba Jan. 18, 2024, 10:29 p.m. UTC | #3
On Thu, Jan 18, 2024 at 02:16:11PM +0800, Anand Jain wrote:
> 
> 
> 
> Sorry for the late comments. Looks good
> 
>   Reviewed-by: Anand Jain <anand.jain@oracle.com>
> 
> 
> 
> just one nit:
> You may also bring the following repetitive code into a new
> helper function as it is used once in init_mount_fs_info()
> and again  in open_ctree():

I don't think we need the helper here, it's for the one-time
initializations, unlikely to be needed anywhere else that would justify
it.