[PATCH] ext4: initialize ext4_allocation_request with {}

From: Vivek BalachandharTN

Date: Fri Mar 27 2026 - 08:41:10 EST


Replace explicit memset() with struct initialization using = {} for
ext4_allocation_request. This simplifies the code and makes the
initialization clearer while preserving behavior.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@xxxxxxxxx>
---
fs/ext4/balloc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 8040c731b3e4..21ea53346c55 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -737,10 +737,9 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
ext4_fsblk_t goal, unsigned int flags,
unsigned long *count, int *errp)
{
- struct ext4_allocation_request ar;
+ struct ext4_allocation_request ar = {};
ext4_fsblk_t ret;

- memset(&ar, 0, sizeof(ar));
/* Fill with neighbour allocated blocks */
ar.inode = inode;
ar.goal = goal;
--
2.34.1