From nobody Thu Apr 2 17:16:38 2026 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) (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 A01BE32C31B for ; Wed, 11 Feb 2026 07:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.24 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770793544; cv=none; b=fKnYmPJy6o6eflqq7Syrm4i7uoaj9FCDy1UPp+DTdvf44pXEd7Y3CdsUGUXuHtaFnw1n/kTlVlwfLO1GHrH2yWmAKxEpO0Icx0R+z/+vN3Xj0O9LoexAoVgS4sXePurYqifFnzsXfuWngommaKOvThz60bcsVi9E2ofPbGZrufQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770793544; c=relaxed/simple; bh=djZiiRv4Atfe0TSz4MTf3POZZCovBo80N3X43c5UC2o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=ODd5RiQ7wf7huJxnuvFapr+qX119H5jpFF3W4H/Gw3s3levmf1+MA3n4jnIWpEQu5DynWQZZRuRCX61Re4WUZqsbW84oiZ5CkV3kponMFHPEXOtm51x5uD8krp7gu0F2zXpq91HAbzZp2dTiZJDzMIzgeQbRUu3QXY0etIfjRsI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=Rqm4prS3; arc=none smtp.client-ip=203.254.224.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Rqm4prS3" Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20260211070539epoutp01360139865d270e18ec36dffd0d31abc5~TH1ea3c9a2088420884epoutp01h for ; Wed, 11 Feb 2026 07:05:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20260211070539epoutp01360139865d270e18ec36dffd0d31abc5~TH1ea3c9a2088420884epoutp01h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1770793539; bh=BF/a5V2IAl0CQ6EVXzXFAOoP6G59N24GE3IM1SlFR8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rqm4prS3JvFvBnhAHAlZW+81XvflSxaRZtvoTeqYOtyvBNmkKIOcc9+DanCwx1QJv ujey0xlDsQWfVMS6hrz3kLfj/7UU7v5G+aFSQb7BMvXQDrGdzjZxdNEDBpI1shlsD8 dtQNU3H3uQR0YN8/NAku305i1yMutgyEg3m/2Cw0= Received: from epsnrtp02.localdomain (unknown [182.195.42.154]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPS id 20260211070538epcas5p1be00489644f05334d8d9ef50a4e4f4c5~TH1dpqVRp2433424334epcas5p1J; Wed, 11 Feb 2026 07:05:38 +0000 (GMT) Received: from epcas5p2.samsung.com (unknown [182.195.38.94]) by epsnrtp02.localdomain (Postfix) with ESMTP id 4f9qFs5bzlz2SSKh; Wed, 11 Feb 2026 07:05:37 +0000 (GMT) Received: from epsmtip2.samsung.com (unknown [182.195.34.31]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20260211070537epcas5p11bcbdc3d5ab68e1b9b7ec68feda22487~TH1cO4IxW2671026710epcas5p1J; Wed, 11 Feb 2026 07:05:37 +0000 (GMT) Received: from localhost.localdomain (unknown [107.99.41.245]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20260211070534epsmtip2c653cdb90b99f4e1ceaad6e2f182b918~TH1ZWrf7i0195901959epsmtip2W; Wed, 11 Feb 2026 07:05:33 +0000 (GMT) From: Kundan Kumar To: jaegeuk@kernel.org, chao@kernel.org, agruenba@redhat.com, trondmy@kernel.org, anna@kernel.org, hch@lst.de, brauner@kernel.org, jack@suse.cz, viro@zeniv.linux.org.uk, djwong@kernel.org, pankaj.raghav@linux.dev Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, gfs2@lists.linux.dev, linux-nfs@vger.kernel.org, gost.dev@samsung.com, anuj20.g@samsung.com, vishak.g@samsung.com, joshi.k@samsung.com, mcgrof@kernel.org, Kundan Kumar Subject: [PATCH 1/4] writeback: prep helpers for dirty-limit and writeback accounting Date: Wed, 11 Feb 2026 12:30:54 +0530 Message-Id: <20260211070057.22001-2-kundan.kumar@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260211070057.22001-1-kundan.kumar@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20260211070537epcas5p11bcbdc3d5ab68e1b9b7ec68feda22487 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P cpgsPolicy: CPGSC10-542,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20260211070537epcas5p11bcbdc3d5ab68e1b9b7ec68feda22487 References: <20260211070057.22001-1-kundan.kumar@samsung.com> Add helper APIs needed by filesystems to avoid poking into writeback internals. Suggested-by: Christoph Hellwig Signed-off-by: Kundan Kumar Signed-off-by: Anuj Gupta Reviewed-by: Jan Kara --- include/linux/backing-dev.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0c8342747cab..4165ad3ddf00 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h @@ -78,6 +78,17 @@ static inline s64 wb_stat_sum(struct bdi_writeback *wb, = enum wb_stat_item item) =20 extern void wb_writeout_inc(struct bdi_writeback *wb); =20 +static inline int bdi_wb_dirty_exceeded(struct backing_dev_info *bdi) +{ + return bdi->wb.dirty_exceeded; +} + +static inline void bdi_wb_stat_mod(struct backing_dev_info *bdi, + enum wb_stat_item item, s64 amount) +{ + wb_stat_mod(&bdi->wb, item, amount); +} + /* * maximal error of a stat counter. */ --=20 2.25.1