Skip to content

Commit 642e0dc

Browse files
riteshharjanitytso
authored andcommitted
ext4: Enable support for ext4 multi-fsblock atomic write using bigalloc
Last couple of patches added the needed support for multi-fsblock atomic writes using bigalloc. This patch ensures that filesystem advertizes the needed atomic write unit min and max values for enabling multi-fsblock atomic write support with bigalloc. Acked-by: Darrick J. Wong <djwong@kernel.org> Co-developed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Link: https://patch.msgid.link/5e45d7ed24499024b9079436ba6698dae5298e29.1747337952.git.ritesh.list@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent b86629c commit 642e0dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/ext4/super.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4436,13 +4436,16 @@ static int ext4_handle_clustersize(struct super_block *sb)
44364436

44374437
/*
44384438
* ext4_atomic_write_init: Initializes filesystem min & max atomic write units.
4439+
* With non-bigalloc filesystem awu will be based upon filesystem blocksize
4440+
* & bdev awu units.
4441+
* With bigalloc it will be based upon bigalloc cluster size & bdev awu units.
44394442
* @sb: super block
4440-
* TODO: Later add support for bigalloc
44414443
*/
44424444
static void ext4_atomic_write_init(struct super_block *sb)
44434445
{
44444446
struct ext4_sb_info *sbi = EXT4_SB(sb);
44454447
struct block_device *bdev = sb->s_bdev;
4448+
unsigned int clustersize = EXT4_CLUSTER_SIZE(sb);
44464449

44474450
if (!bdev_can_atomic_write(bdev))
44484451
return;
@@ -4452,7 +4455,7 @@ static void ext4_atomic_write_init(struct super_block *sb)
44524455

44534456
sbi->s_awu_min = max(sb->s_blocksize,
44544457
bdev_atomic_write_unit_min_bytes(bdev));
4455-
sbi->s_awu_max = min(sb->s_blocksize,
4458+
sbi->s_awu_max = min(clustersize,
44564459
bdev_atomic_write_unit_max_bytes(bdev));
44574460
if (sbi->s_awu_min && sbi->s_awu_max &&
44584461
sbi->s_awu_min <= sbi->s_awu_max) {

0 commit comments

Comments
 (0)