From patchwork Mon Jan 6 09:50:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13927111 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 821D31A00EC for ; Mon, 6 Jan 2025 09:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157053; cv=none; b=pagClN5IRmLiKzh8nhOmXjmaI1sJsZFw4uA0mwY5f71daV3eXMRwdrjSu/XvoWvGFVLe72DyqoKtlWgk6Xv/7aE0h3/3KwbNuh8PnJZAo9+gT2rpwEr2vJ3mymJbtKyRu/SbTn9bgy2OkytzK+QfLKH93D7o9KiI5ppG++n8jfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157053; c=relaxed/simple; bh=aBpfz5tV3N52tXg6Vhw+DuJ/wRGNFIIkYmxuaQ5W4fA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uZw3zBMRStGUdBw+7/WtTUv35YfBRFP+h/9ugZ/HY1LDtTcQdnUmoGckNp4XvHvYAP7Fbw5xm3ZDH4Pv1t2H8hUo3Yok6OuDCcJWYTA8t4haJ792zy1Fy5GtqSNONA6mePuK+QRUfxeMv6U7VFFW0SyY7mWLOBT998ulTHZQvWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=hWKf34ml; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="hWKf34ml" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=RW2GeaWZotApSjEj1SkVkZMT8tne6ryNBLRxXzOpDGc=; b=hWKf34mlCvbq94yxK9lTXWC5JB 7KuHVNgSnIfGBJWEHCeaoHpJqds9IsGK9O8yRVbM+poHk9YszM7UYOmYHGV4voX0rzcZs+CH47/xb NjBGA69gohKAfA23jpNhbGfzNJ09W/qUzIgBqEMKt3PNuu+jVDCbRfh5aNkSPQMxtwAykYMkq87FJ ru1RrLocB69HHJTqdfg1P2x8oSlwb/hPOLMBno/g+xN2I4hxGTSH9ybVycyhsTuxwDZFvxzsTJRvJ pogD0kZ5yKjs1fgMym8zls7d8wmWVSU1X5oClYgWiodJjakCBeQpVtYlYO1QhDyiU5v0phMKN94P8 AZ6cKU8g==; Received: from 2a02-8389-2341-5b80-db6b-99e8-3feb-3b4e.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:db6b:99e8:3feb:3b4e] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tUjl4-00000000kCZ-1z8l; Mon, 06 Jan 2025 09:50:51 +0000 From: Christoph Hellwig To: Carlos Maiolino Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH 1/3] xfs: mark xfs_dir_isempty static Date: Mon, 6 Jan 2025 10:50:29 +0100 Message-ID: <20250106095044.847334-2-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250106095044.847334-1-hch@lst.de> References: <20250106095044.847334-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html And return bool instead of a boolean condition as int. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" --- fs/xfs/libxfs/xfs_dir2.c | 6 +++--- fs/xfs/libxfs/xfs_dir2.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/xfs/libxfs/xfs_dir2.c b/fs/xfs/libxfs/xfs_dir2.c index 202468223bf9..81aaef2f495e 100644 --- a/fs/xfs/libxfs/xfs_dir2.c +++ b/fs/xfs/libxfs/xfs_dir2.c @@ -197,7 +197,7 @@ xfs_da_unmount( /* * Return 1 if directory contains only "." and "..". */ -int +static bool xfs_dir_isempty( xfs_inode_t *dp) { @@ -205,9 +205,9 @@ xfs_dir_isempty( ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); if (dp->i_disk_size == 0) /* might happen during shutdown. */ - return 1; + return true; if (dp->i_disk_size > xfs_inode_data_fork_size(dp)) - return 0; + return false; sfp = dp->i_df.if_data; return !sfp->count; } diff --git a/fs/xfs/libxfs/xfs_dir2.h b/fs/xfs/libxfs/xfs_dir2.h index 576068ed81fa..a6594a5a941d 100644 --- a/fs/xfs/libxfs/xfs_dir2.h +++ b/fs/xfs/libxfs/xfs_dir2.h @@ -58,7 +58,6 @@ extern void xfs_dir_startup(void); extern int xfs_da_mount(struct xfs_mount *mp); extern void xfs_da_unmount(struct xfs_mount *mp); -extern int xfs_dir_isempty(struct xfs_inode *dp); extern int xfs_dir_init(struct xfs_trans *tp, struct xfs_inode *dp, struct xfs_inode *pdp); extern int xfs_dir_createname(struct xfs_trans *tp, struct xfs_inode *dp, From patchwork Mon Jan 6 09:50:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13927112 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 769C61A00EC for ; Mon, 6 Jan 2025 09:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157057; cv=none; b=pQ8mlRS+YpL3CcQ8fKXgLGWt7f9lNEfLNwH7DxRiolt35hqDhcf2cugVOKDuJwKyTksBeSmhjb7Y0oc5Q8SwzSRCEVCYy69S12F8T6SIY7PXJmlUMWhbzPRyok/SwR0TlVR79wQ0L2DclLaxBGi/ryBGl6C+Xv12C9u14SHn9BU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157057; c=relaxed/simple; bh=lucWGSp0mD10wEufTjggfGWFrxYarU8oRW+07rCzfjA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WuwK+hWxXOAnnHo+4DfYXuK7wGom6wVoswNAa14NlEW33nWE5AOAzrchlE/Ki1IfMhDpfreBG/csn1S62O4F21U0NUSdL8mQjEyT3sV8wsbPZ6khOr1qAMUVPYleT8eYGdFv5FNPhdps8jQVZ33hC8IjIO2vrsHMQK/BxpztFco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=2o2yTXv1; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="2o2yTXv1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=YFKnyzQfVcY0PNPH6AJ2RAyj7JLUqWXHgpOofdpYQkY=; b=2o2yTXv1QxBfOgqK2rjfGCH5Mx p/4Mq/EfhyEqlg1VDxG9M60GhAgxpnyeeyTKTkXR4SzE3KGp6uYn2UFfd55K9STVjkZt4AEKyqlmb zkpdDMIi8/zP8F+OFKJTUlyEjsM24aQMBayj4+ZjLHWkB/USW0tpvzgzqAcdc4Ajl5jvwW2LnSidG AIaVLp6g0fzaA1ZW/v0YuhgfwvvFCC/Fle9Ubd3lYE7pcML54rECfpFKW/PSOF1da1b72KpBygoT8 n+lO79o0xQhWvVlk0Nhf4NTkals8LWEa/y9rFyRfptQkP9re+XFaNqIsbnTdh66yXqrVrOa6p8DYc qyW+xZHw==; Received: from 2a02-8389-2341-5b80-db6b-99e8-3feb-3b4e.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:db6b:99e8:3feb:3b4e] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tUjl8-00000000kCn-1xiD; Mon, 06 Jan 2025 09:50:55 +0000 From: Christoph Hellwig To: Carlos Maiolino Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH 2/3] xfs: remove XFS_ILOG_NONCORE Date: Mon, 6 Jan 2025 10:50:30 +0100 Message-ID: <20250106095044.847334-3-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250106095044.847334-1-hch@lst.de> References: <20250106095044.847334-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html XFS_ILOG_NONCORE is not used in the kernel code or xfsprogs, remove it. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" --- fs/xfs/libxfs/xfs_log_format.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/xfs/libxfs/xfs_log_format.h b/fs/xfs/libxfs/xfs_log_format.h index 15dec19b6c32..41e974d17ce2 100644 --- a/fs/xfs/libxfs/xfs_log_format.h +++ b/fs/xfs/libxfs/xfs_log_format.h @@ -351,12 +351,6 @@ struct xfs_inode_log_format_32 { */ #define XFS_ILOG_IVERSION 0x8000 -#define XFS_ILOG_NONCORE (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \ - XFS_ILOG_DBROOT | XFS_ILOG_DEV | \ - XFS_ILOG_ADATA | XFS_ILOG_AEXT | \ - XFS_ILOG_ABROOT | XFS_ILOG_DOWNER | \ - XFS_ILOG_AOWNER) - #define XFS_ILOG_DFORK (XFS_ILOG_DDATA | XFS_ILOG_DEXT | \ XFS_ILOG_DBROOT) From patchwork Mon Jan 6 09:50:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13927113 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8583D1A00EC for ; Mon, 6 Jan 2025 09:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157060; cv=none; b=B+8LUV2T4UAt3IMKw1eDGVZ5VUoEhX6jhsfDeyrhO59x2Qf9A7ah8dAfxWZxhYaq0z828oGMPNzY5zL77jARO7hvoBO2Ik7DVX0aVey5QX+0qjRfThwJ24aiJETTkSQl0CjtmtsTto6fIWi+n++Ao33vvZb48/+9eI74ddls798= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736157060; c=relaxed/simple; bh=FSsBfgpxxJ8RmDdjdOmaC5G4h3bFB2fWmFzVEsXsXJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m5ZqmjLuLWwcgeuy4nyR/zK4f8PziWNrTSLrbtqeHSFlpdCGqFVDEozMnUselpo0tiouESzGrXs1odMQ1oV0spuuQMWBqHYetlO6cGoyXH9Ir9wiHU6ypZEOJ75dmgT6kufGZDalD0oGCBqRSqRmWNV4g9x71zraPeQRNihSKYI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=FUpRWMQC; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FUpRWMQC" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=uQimQhHmZqQzi/rAxZnrrvBfbS3kH/cawwK23gkD32M=; b=FUpRWMQCGtlTwd6paW/az1Ff0c ovUlQ+ZKZoEnM0at6oTHhK8iNVCBpjxxOC/xQ7CWygnTyT+cRS5hFwwmd2e1UpDjA0ANimtCfE1HR 2WXJOiZp4V+7FdGCmxe3UbOLh8Ka2Hdy5KnEImX6X3BtJwwY5aKiI8z9A/LDJCJ4sg+/DOsOFtKBX hA8HfonOB5bM+IMVeh3Vk4k9mxYH86udxFuOufmdRrubzaSwk/doTQIFgFoQapJ5lSmGsXHW/QgaJ nNsSWl6AjOjgqjowfp4SP6jRyxqPfP6KMyyvQaantUcyzcbXD79krMVavX/dVPZCFcDZQRa97FTlJ bOot8/WA==; Received: from 2a02-8389-2341-5b80-db6b-99e8-3feb-3b4e.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:db6b:99e8:3feb:3b4e] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tUjlC-00000000kDg-2MZg; Mon, 06 Jan 2025 09:50:59 +0000 From: Christoph Hellwig To: Carlos Maiolino Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH 3/3] xfs: remove the t_magic field in struct xfs_trans Date: Mon, 6 Jan 2025 10:50:31 +0100 Message-ID: <20250106095044.847334-4-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250106095044.847334-1-hch@lst.de> References: <20250106095044.847334-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html The t_magic field is only ever assigned to, but never read. Remove it. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" --- fs/xfs/xfs_trans.c | 2 -- fs/xfs/xfs_trans.h | 1 - 2 files changed, 3 deletions(-) diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 4cd25717c9d1..786fb659ee3f 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -100,7 +100,6 @@ xfs_trans_dup( /* * Initialize the new transaction structure. */ - ntp->t_magic = XFS_TRANS_HEADER_MAGIC; ntp->t_mountp = tp->t_mountp; INIT_LIST_HEAD(&ntp->t_items); INIT_LIST_HEAD(&ntp->t_busy); @@ -275,7 +274,6 @@ xfs_trans_alloc( ASSERT(!(flags & XFS_TRANS_RES_FDBLKS) || xfs_has_lazysbcount(mp)); - tp->t_magic = XFS_TRANS_HEADER_MAGIC; tp->t_flags = flags; tp->t_mountp = mp; INIT_LIST_HEAD(&tp->t_items); diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 71c2e82e4dad..2b366851e9a4 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -122,7 +122,6 @@ void xfs_log_item_init(struct xfs_mount *mp, struct xfs_log_item *item, * This is the structure maintained for every active transaction. */ typedef struct xfs_trans { - unsigned int t_magic; /* magic number */ unsigned int t_log_res; /* amt of log space resvd */ unsigned int t_log_count; /* count for perm log res */ unsigned int t_blk_res; /* # of blocks resvd */