From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 505DF241C8C for ; Fri, 3 Jul 2026 04:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783054495; cv=none; b=RUhGNj40yxC0YMFPIiteZCjV8sbj5VhhgF3ZqoCy5CrqXICOKacO7o9S0VW66cR41IBD12XoCv0+QloIkILV6WF0rHpOnSfYoqt8ANZFfWchELH+sQz7oBY6LX/+efSQJL7ha97nCjqyypZKuoOTiM7qfAJ9x88EcroMzoFRIKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783054495; c=relaxed/simple; bh=HDzAhATYxRzS5JprzltqSD7mNW7p2WeIZkiPo4++51Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dfX7voiCR4qtbAOHsq/ynBgyIS/ZAwErG3uJFPxpWqPW8spTnzm3GE8rB66U4NUsIwXHFrofUxJjeqohCxC9LYC7Z+XmrsrtfpLHXddJTjc49V0aUHVKV9mE5M1L0F9A3N+l4IXdLP/7HugdeO2Alg10B+vE4vUKe9ghTDGzUc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ouMUC7os; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ouMUC7os" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2c82538b6b0so1019165ad.1 for ; Thu, 02 Jul 2026 21:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783054483; x=1783659283; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D5ikfH7B/13WQxyOlzL4BmCTKB0fEMAdj0mk6w9hYYE=; b=ouMUC7osSfvsueO9wzApQdql1lbQOuf8A5/i2NjBwTjHVbF9WnI3cSajNerXwhcnlQ MSB8C+cMt2rDVCd0KahkG+unDuZM0gVrZK/ey3DmphS5yvFD2b8c051NdM4Zjuo3ltFy T5pyQ3Qpw2J/J9oXfp/PDerKjitdAkzd8q2EKvTXwrjUYW1gs5eznB+fXswQOsBRy4g3 +fNkcWQDJya8/v/MFvagnM3IoBHouvVyhKK3dQAwyOMSn1/XsdSDsyln1ayh2zKU5ost NYLpMCiluJiYEk9iXddEMZk9vkha8JsGPS2loT0nXWEmWomfAsLvcx38r5Stb2qEg0iR Fn9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783054483; x=1783659283; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D5ikfH7B/13WQxyOlzL4BmCTKB0fEMAdj0mk6w9hYYE=; b=JbvbkRl5mX7l+RlyRZpqYzzozxA0VHjE5YxYWfWhLV4R44PH+UVSHycJh7WfrOJcTw Bb4Y1MDNPvVrsgjQnMrsVHU2/baMcn37U2sFC9RcaV6adxloVKyGLB6RwhYnYTVC6vnZ +8lJbm76wRDqDvEDzQesYKrsaMwLPm8ksLgzIi9GVlvBuDZ5Yclf/tyblnzW6tTMXBRr 5u+6DKcOw+SPJCvwLWIAbANTfp/zhdPY7JpPGZghc+6Z5k6iwgEaFVZsEcDSWOtLZd0s 1azUCA1w9NDv66I6L2RbZXjqPy/YKkYxa4J7j8g3YEk2z86jc8Jp97cL1fKA21dhk9bm fW4A== X-Forwarded-Encrypted: i=1; AHgh+RqCWb2TuQgyD44aADsJKHiko9jZFMcbTRc1pC/kjhJBt7j2JOsmQXwfh6XbVSzrf4iBW+sZS7dGV7AOp+w=@vger.kernel.org X-Gm-Message-State: AOJu0YzmklQC2FNmGXTX3d7ZCS+Vt96jsaCDweMT57pjNeVLIdXMwQR8 M1/s8HeSeUIX971jryVseTqb4Ajj78CGnn4rQ6XveuOt9E052eVzyjOX X-Gm-Gg: AfdE7cnl6ZYIEe3NlKm2K+FsT6PzjF+dxDj9atbG3MLBiHV5NVHEl1JjdZPDIq8HG5Z uh2jdXjuuvK0NIEKGq3xkFa7YBhmLd+qSgqEt/f8iNmme48cqHXHWxRM6zJHcXVDsBSW5qaNfKj ZLL7vB5pdKyJv1fEf2xpjcPjE3ypaK/4Lb4YceL9c6BoWKIbNTzImeq2rF0MuqmjgkJ804HsvXd mXRc6LiXc4L4Qx8AM+nmnWAMUv+rp60q0foygFueHybBUeec1M/a3kphM4URGr1I5xQE23aYvEb SEFREmZnbbCz2YofNCAnjuInHXyTBZBRJiBMByf/uGsM81bLdFGVz8IuEShTyrJcBQzwqXl+bcm 2NQOnmTOM72kNSYPhhzDD4ivO6ju0LhreX398DmmmEtPAyU6OUFRBo8/Kg9THsjZMQLd0BusMtb htu/S1iEb2wfaqS3wJBMUWs6q224gbZrAK3tXhLuhDRM5jpZCknopM221q7XU/5LoxWWfE2EkJL B6XoPkLmK6GpIfScw935ReciTqFxiGQ050o6/0XmlhpKPft5UAXF/j3pPx8pemu3h6HqGeE4bO3 K6YjSJMExV0O7ozRU1OCAGs= X-Received: by 2002:a17:902:e5c1:b0:2ca:c68:c554 with SMTP id d9443c01a7336-2ca7e90cea8mr96189345ad.38.1783054482619; Thu, 02 Jul 2026 21:54:42 -0700 (PDT) Received: from cs-1047136853211-default.asia-southeast1-a.c.d33bddc1d573818c7-tp.internal (213.28.87.34.bc.googleusercontent.com. [34.87.28.213]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b3c7fa65asm15615643c88.6.2026.07.02.21.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 21:54:42 -0700 (PDT) From: Aditya Srivastava To: Theodore Ts'o Cc: Andreas Dilger , Jan Kara , Baokun Li , Ojaswin Mujoo , Ritesh Harjani , Zhang Yi , Tao Ma , syzbot+0c89d865531d053abb2d@syzkaller.appspotmail.com, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Aditya Prakash Srivastava Subject: [PATCH v4 2/2] ext4: cleanup unused CONVERT_INLINE_DATA flag Date: Fri, 3 Jul 2026 04:54:13 +0000 Message-ID: <20260703045414.1768-2-aditya.ansh182@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260703045414.1768-1-aditya.ansh182@gmail.com> References: <20260703045414.1768-1-aditya.ansh182@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Aditya Prakash Srivastava After implementing bitwise flags for tracking the inline data write state in the address space fsdata parameter, the CONVERT_INLINE_DATA state flag is left unused and can be removed. Perform this clean-up by: 1) Deleting the CONVERT_INLINE_DATA definition from ext4.h. 2) Removing the void **fsdata argument from both the forward declaration and the definition of the internal helper ext4_da_convert_inline_data_to_extent(). 3) Removing the void **fsdata argument from the declaration and definition of ext4_generic_write_inline_data() and updating the caller ext4_try_to_write_inline_data() and the internal re-alloc retry logic accordingly. 4) Updating ext4_da_write_begin() to call ext4_generic_write_inline_data() without the fsdata parameter. Suggested-by: Jan Kara Signed-off-by: Aditya Prakash Srivastava --- Changes in v4: - Resent as Patch 2/2 of the v4 series, as suggested by Jan Kara. Changes in v3: - Initial version of the cleanup patch. fs/ext4/ext4.h | 5 ++--- fs/ext4/inline.c | 13 +++++-------- fs/ext4/inode.c | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 9e6f6467bdeb..c2e4262406a7 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -3137,8 +3137,7 @@ int do_journal_get_write_access(handle_t *handle, struct inode *inode, struct buffer_head *bh); void ext4_set_inode_mapping_order(struct inode *inode); #define FALL_BACK_TO_NONDELALLOC 1 -#define CONVERT_INLINE_DATA 2 -#define EXT4_WRITE_DATA_INLINE 4 +#define EXT4_WRITE_DATA_INLINE 2 typedef enum { EXT4_IGET_NORMAL = 0, @@ -3749,7 +3748,7 @@ extern int ext4_generic_write_inline_data(struct address_space *mapping, struct inode *inode, loff_t pos, unsigned len, struct folio **foliop, - void **fsdata, bool da); + bool da); extern int ext4_try_add_inline_entry(handle_t *handle, struct ext4_filename *fname, struct inode *dir, struct inode *inode); diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index cfd591dc1d9c..0cb2dc195d23 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -22,8 +22,7 @@ static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping, - struct inode *inode, - void **fsdata); + struct inode *inode); static int ext4_get_inline_size(struct inode *inode) { @@ -697,7 +696,7 @@ int ext4_generic_write_inline_data(struct address_space *mapping, struct inode *inode, loff_t pos, unsigned len, struct folio **foliop, - void **fsdata, bool da) + bool da) { int ret; handle_t *handle; @@ -728,7 +727,7 @@ int ext4_generic_write_inline_data(struct address_space *mapping, return ext4_convert_inline_data_to_extent(mapping, inode); } - ret = ext4_da_convert_inline_data_to_extent(mapping, inode, fsdata); + ret = ext4_da_convert_inline_data_to_extent(mapping, inode); if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) goto retry_journal; @@ -788,7 +787,7 @@ int ext4_try_to_write_inline_data(struct address_space *mapping, if (pos + len > ext4_get_max_inline_size(inode)) return ext4_convert_inline_data_to_extent(mapping, inode); return ext4_generic_write_inline_data(mapping, inode, pos, len, - foliop, NULL, false); + foliop, false); } int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, @@ -895,8 +894,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, * need to start the journal since the file's metadata isn't changed now. */ static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping, - struct inode *inode, - void **fsdata) + struct inode *inode) { int ret = 0, inline_size; struct folio *folio; @@ -934,7 +932,6 @@ static int ext4_da_convert_inline_data_to_extent(struct address_space *mapping, folio_mark_dirty(folio); folio_mark_uptodate(folio); ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); - *fsdata = (void *)CONVERT_INLINE_DATA; out: up_read(&EXT4_I(inode)->xattr_sem); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 4e1bf54e511d..9a0fbaf73ce2 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3160,7 +3160,7 @@ static int ext4_da_write_begin(const struct kiocb *iocb, if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) { ret = ext4_generic_write_inline_data(mapping, inode, pos, len, - foliop, fsdata, true); + foliop, true); if (ret < 0) return ret; if (ret == 1) { -- 2.47.3