From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E88B37996C for ; Tue, 21 Jul 2026 11:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784634420; cv=none; b=UA7GAbXuqwUxTxqk33ouLbL5PpN5M4XgHNYJtbGEqJRy2GWImQ9cJrqTuDCummpuoMa8pBvChWwzt3Zc4kgmrEvdtufMkr+XwFOni21Sce8CKRmMjjPOYfbL1jyfJ9ZJXTCwtkDZksRg89tZJmWDGAkRXUkKaDEFIMJHhPwfRzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784634420; c=relaxed/simple; bh=d7rtRVMO3eahvGJJ02ztOhpLEfm+jCOgG1ulgZDT19s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DQiJhL9BkzB247u+so4gQUHfExPk+Ws5DsxRQsXDHqYK4eNzLjKGNv/WqVlA6LDFGlZKvKNl1Gwea0NKbjiCgJBp+LkFqe+d052uXjOvrVoCniE9Et7FrIvDtbtbpKwhXvWuW0RJSvsAJm1PMEmzk2cmLOpD6PbNn/cCB+1VfTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cuG59OPO; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cuG59OPO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D5841F00A3E; Tue, 21 Jul 2026 11:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784634418; bh=o0hJiuubONaDcJ6GG/Yzq0LSxEfvAWXICx8+sbwvNjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cuG59OPOC5WUuUTHSpuu7NzetCyyYIdO9+TTecnB3dbFk4p3S312gVxw11nhqeR2C aNmcTXjMkeDkKqT2GyevjnOrMSGIriNX0zOgzSusUXHPCo6FwMnAfAKv1rhQ1WcyS5 z8Tq4ixmMOS2lu/Fiudeir0UDyYwLJkdT+Dt2NVxen3XZ1yLvPE1vMiV5S5kw8Qqfv jxalfyv1NWw7CAydzzR+0FsfDUrfiEsFyl9n070M9MpAQNvyCLlvsnO/GGBxd4pMM9 82L7aMKYf5gf8B1NnRHPwVGNdXZ8YjpEsNESn8izAmP1vkkbsJ/1Ks8BDEQHjLR2In GDyU69WzhXZrQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Namjae Jeon , Christoph Hellwig , "Darrick J. Wong" , Sasha Levin Subject: [PATCH 7.1.y 2/5] exfat: add balloc parameter to exfat_map_cluster() for iomap support Date: Tue, 21 Jul 2026 07:46:53 -0400 Message-ID: <20260721114656.3687966-2-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260721114656.3687966-1-sashal@kernel.org> References: <2026071548-sinister-joystick-e062@gregkh> <20260721114656.3687966-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Namjae Jeon [ Upstream commit 3474416bb9abafca2e79b7ff700a100b7e8bc766 ] In preparation for supporting the iomap infrastructure, we need to know whether a new cluster was allocated or not in exfat_map_cluster(). Add an optional 'bool *balloc' output parameter. When a new cluster is allocated, *balloc is set to true. Pass NULL from exfat_get_block() to preserve the existing behavior. Acked-by: Christoph Hellwig Acked-by: "Darrick J. Wong" Signed-off-by: Namjae Jeon Stable-dep-of: 044472d5ee7d ("iomap: consolidate bio submission") Signed-off-by: Sasha Levin --- fs/exfat/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 249a35e2b4b237..a10d4f3c66a178 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -124,7 +124,8 @@ void exfat_sync_inode(struct inode *inode) * *clu = (~0), if it's unable to allocate a new cluster */ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset, - unsigned int *clu, unsigned int *count, int create) + unsigned int *clu, unsigned int *count, int create, + bool *balloc) { int ret; unsigned int last_clu; @@ -229,6 +230,8 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset, if (exfat_cluster_walk(sb, clu, num_to_be_allocated - 1, ei->flags)) return -EIO; *count = 1; + if (balloc) + *balloc = true; } /* hint information */ @@ -262,7 +265,7 @@ static int exfat_get_block(struct inode *inode, sector_t iblock, /* Is this block already allocated? */ count = exfat_bytes_to_cluster_round_up(sbi, bh_result->b_size); err = exfat_map_cluster(inode, iblock >> sbi->sect_per_clus_bits, - &cluster, &count, create); + &cluster, &count, create, NULL); if (err) { if (err != -ENOSPC) exfat_fs_error_ratelimit(sb, -- 2.53.0