* [PATCH] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES
@ 2024-07-21 11:27 Julian Sun
2024-07-23 2:20 ` Darrick J. Wong
0 siblings, 1 reply; 2+ messages in thread
From: Julian Sun @ 2024-07-21 11:27 UTC (permalink / raw)
To: linux-xfs; +Cc: chandan.babu, djwong, Julian Sun
In the macro definition of XFS_DQUOT_LOGRES, a parameter is accepted,
but it is not used. Hence, it should be removed.
This patch has only passed compilation test, but it should be fine.
Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
---
fs/xfs/libxfs/xfs_quota_defs.h | 2 +-
fs/xfs/libxfs/xfs_trans_resv.c | 28 ++++++++++++++--------------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h
index cb035da3f990..fb05f44f6c75 100644
--- a/fs/xfs/libxfs/xfs_quota_defs.h
+++ b/fs/xfs/libxfs/xfs_quota_defs.h
@@ -56,7 +56,7 @@ typedef uint8_t xfs_dqtype_t;
* And, of course, we also need to take into account the dquot log format item
* used to describe each dquot.
*/
-#define XFS_DQUOT_LOGRES(mp) \
+#define XFS_DQUOT_LOGRES \
((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
#define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index 3dc8f785bf29..45aaf169806a 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -338,11 +338,11 @@ xfs_calc_write_reservation(
blksz);
t1 += adj;
t3 += adj;
- return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
+ return XFS_DQUOT_LOGRES + max3(t1, t2, t3);
}
t4 = xfs_calc_refcountbt_reservation(mp, 1);
- return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3));
+ return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3));
}
unsigned int
@@ -410,11 +410,11 @@ xfs_calc_itruncate_reservation(
xfs_refcountbt_block_count(mp, 4),
blksz);
- return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
+ return XFS_DQUOT_LOGRES + max3(t1, t2, t3);
}
t4 = xfs_calc_refcountbt_reservation(mp, 2);
- return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3));
+ return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3));
}
unsigned int
@@ -466,7 +466,7 @@ STATIC uint
xfs_calc_rename_reservation(
struct xfs_mount *mp)
{
- unsigned int overhead = XFS_DQUOT_LOGRES(mp);
+ unsigned int overhead = XFS_DQUOT_LOGRES;
struct xfs_trans_resv *resp = M_RES(mp);
unsigned int t1, t2, t3 = 0;
@@ -577,7 +577,7 @@ STATIC uint
xfs_calc_link_reservation(
struct xfs_mount *mp)
{
- unsigned int overhead = XFS_DQUOT_LOGRES(mp);
+ unsigned int overhead = XFS_DQUOT_LOGRES;
struct xfs_trans_resv *resp = M_RES(mp);
unsigned int t1, t2, t3 = 0;
@@ -641,7 +641,7 @@ STATIC uint
xfs_calc_remove_reservation(
struct xfs_mount *mp)
{
- unsigned int overhead = XFS_DQUOT_LOGRES(mp);
+ unsigned int overhead = XFS_DQUOT_LOGRES;
struct xfs_trans_resv *resp = M_RES(mp);
unsigned int t1, t2, t3 = 0;
@@ -729,7 +729,7 @@ xfs_calc_icreate_reservation(
struct xfs_mount *mp)
{
struct xfs_trans_resv *resp = M_RES(mp);
- unsigned int overhead = XFS_DQUOT_LOGRES(mp);
+ unsigned int overhead = XFS_DQUOT_LOGRES;
unsigned int t1, t2, t3 = 0;
t1 = xfs_calc_icreate_resv_alloc(mp);
@@ -747,7 +747,7 @@ STATIC uint
xfs_calc_create_tmpfile_reservation(
struct xfs_mount *mp)
{
- uint res = XFS_DQUOT_LOGRES(mp);
+ uint res = XFS_DQUOT_LOGRES;
res += xfs_calc_icreate_resv_alloc(mp);
return res + xfs_calc_iunlink_add_reservation(mp);
@@ -829,7 +829,7 @@ STATIC uint
xfs_calc_ifree_reservation(
struct xfs_mount *mp)
{
- return XFS_DQUOT_LOGRES(mp) +
+ return XFS_DQUOT_LOGRES +
xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
xfs_calc_iunlink_remove_reservation(mp) +
@@ -846,7 +846,7 @@ STATIC uint
xfs_calc_ichange_reservation(
struct xfs_mount *mp)
{
- return XFS_DQUOT_LOGRES(mp) +
+ return XFS_DQUOT_LOGRES +
xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
@@ -955,7 +955,7 @@ STATIC uint
xfs_calc_addafork_reservation(
struct xfs_mount *mp)
{
- return XFS_DQUOT_LOGRES(mp) +
+ return XFS_DQUOT_LOGRES +
xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
xfs_calc_buf_res(1, mp->m_dir_geo->blksize) +
@@ -1003,7 +1003,7 @@ STATIC uint
xfs_calc_attrsetm_reservation(
struct xfs_mount *mp)
{
- return XFS_DQUOT_LOGRES(mp) +
+ return XFS_DQUOT_LOGRES +
xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1));
@@ -1043,7 +1043,7 @@ STATIC uint
xfs_calc_attrrm_reservation(
struct xfs_mount *mp)
{
- return XFS_DQUOT_LOGRES(mp) +
+ return XFS_DQUOT_LOGRES +
max((xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH,
XFS_FSB_TO_B(mp, 1)) +
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES
2024-07-21 11:27 [PATCH] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES Julian Sun
@ 2024-07-23 2:20 ` Darrick J. Wong
0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2024-07-23 2:20 UTC (permalink / raw)
To: Julian Sun; +Cc: linux-xfs, chandan.babu
On Sun, Jul 21, 2024 at 07:27:01AM -0400, Julian Sun wrote:
> In the macro definition of XFS_DQUOT_LOGRES, a parameter is accepted,
> but it is not used. Hence, it should be removed.
>
> This patch has only passed compilation test, but it should be fine.
>
> Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
Seems fine to me...
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
--D
> ---
> fs/xfs/libxfs/xfs_quota_defs.h | 2 +-
> fs/xfs/libxfs/xfs_trans_resv.c | 28 ++++++++++++++--------------
> 2 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/fs/xfs/libxfs/xfs_quota_defs.h b/fs/xfs/libxfs/xfs_quota_defs.h
> index cb035da3f990..fb05f44f6c75 100644
> --- a/fs/xfs/libxfs/xfs_quota_defs.h
> +++ b/fs/xfs/libxfs/xfs_quota_defs.h
> @@ -56,7 +56,7 @@ typedef uint8_t xfs_dqtype_t;
> * And, of course, we also need to take into account the dquot log format item
> * used to describe each dquot.
> */
> -#define XFS_DQUOT_LOGRES(mp) \
> +#define XFS_DQUOT_LOGRES \
> ((sizeof(struct xfs_dq_logformat) + sizeof(struct xfs_disk_dquot)) * 6)
>
> #define XFS_IS_QUOTA_ON(mp) ((mp)->m_qflags & XFS_ALL_QUOTA_ACCT)
> diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
> index 3dc8f785bf29..45aaf169806a 100644
> --- a/fs/xfs/libxfs/xfs_trans_resv.c
> +++ b/fs/xfs/libxfs/xfs_trans_resv.c
> @@ -338,11 +338,11 @@ xfs_calc_write_reservation(
> blksz);
> t1 += adj;
> t3 += adj;
> - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
> + return XFS_DQUOT_LOGRES + max3(t1, t2, t3);
> }
>
> t4 = xfs_calc_refcountbt_reservation(mp, 1);
> - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3));
> + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3));
> }
>
> unsigned int
> @@ -410,11 +410,11 @@ xfs_calc_itruncate_reservation(
> xfs_refcountbt_block_count(mp, 4),
> blksz);
>
> - return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
> + return XFS_DQUOT_LOGRES + max3(t1, t2, t3);
> }
>
> t4 = xfs_calc_refcountbt_reservation(mp, 2);
> - return XFS_DQUOT_LOGRES(mp) + max(t4, max3(t1, t2, t3));
> + return XFS_DQUOT_LOGRES + max(t4, max3(t1, t2, t3));
> }
>
> unsigned int
> @@ -466,7 +466,7 @@ STATIC uint
> xfs_calc_rename_reservation(
> struct xfs_mount *mp)
> {
> - unsigned int overhead = XFS_DQUOT_LOGRES(mp);
> + unsigned int overhead = XFS_DQUOT_LOGRES;
> struct xfs_trans_resv *resp = M_RES(mp);
> unsigned int t1, t2, t3 = 0;
>
> @@ -577,7 +577,7 @@ STATIC uint
> xfs_calc_link_reservation(
> struct xfs_mount *mp)
> {
> - unsigned int overhead = XFS_DQUOT_LOGRES(mp);
> + unsigned int overhead = XFS_DQUOT_LOGRES;
> struct xfs_trans_resv *resp = M_RES(mp);
> unsigned int t1, t2, t3 = 0;
>
> @@ -641,7 +641,7 @@ STATIC uint
> xfs_calc_remove_reservation(
> struct xfs_mount *mp)
> {
> - unsigned int overhead = XFS_DQUOT_LOGRES(mp);
> + unsigned int overhead = XFS_DQUOT_LOGRES;
> struct xfs_trans_resv *resp = M_RES(mp);
> unsigned int t1, t2, t3 = 0;
>
> @@ -729,7 +729,7 @@ xfs_calc_icreate_reservation(
> struct xfs_mount *mp)
> {
> struct xfs_trans_resv *resp = M_RES(mp);
> - unsigned int overhead = XFS_DQUOT_LOGRES(mp);
> + unsigned int overhead = XFS_DQUOT_LOGRES;
> unsigned int t1, t2, t3 = 0;
>
> t1 = xfs_calc_icreate_resv_alloc(mp);
> @@ -747,7 +747,7 @@ STATIC uint
> xfs_calc_create_tmpfile_reservation(
> struct xfs_mount *mp)
> {
> - uint res = XFS_DQUOT_LOGRES(mp);
> + uint res = XFS_DQUOT_LOGRES;
>
> res += xfs_calc_icreate_resv_alloc(mp);
> return res + xfs_calc_iunlink_add_reservation(mp);
> @@ -829,7 +829,7 @@ STATIC uint
> xfs_calc_ifree_reservation(
> struct xfs_mount *mp)
> {
> - return XFS_DQUOT_LOGRES(mp) +
> + return XFS_DQUOT_LOGRES +
> xfs_calc_inode_res(mp, 1) +
> xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
> xfs_calc_iunlink_remove_reservation(mp) +
> @@ -846,7 +846,7 @@ STATIC uint
> xfs_calc_ichange_reservation(
> struct xfs_mount *mp)
> {
> - return XFS_DQUOT_LOGRES(mp) +
> + return XFS_DQUOT_LOGRES +
> xfs_calc_inode_res(mp, 1) +
> xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
>
> @@ -955,7 +955,7 @@ STATIC uint
> xfs_calc_addafork_reservation(
> struct xfs_mount *mp)
> {
> - return XFS_DQUOT_LOGRES(mp) +
> + return XFS_DQUOT_LOGRES +
> xfs_calc_inode_res(mp, 1) +
> xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
> xfs_calc_buf_res(1, mp->m_dir_geo->blksize) +
> @@ -1003,7 +1003,7 @@ STATIC uint
> xfs_calc_attrsetm_reservation(
> struct xfs_mount *mp)
> {
> - return XFS_DQUOT_LOGRES(mp) +
> + return XFS_DQUOT_LOGRES +
> xfs_calc_inode_res(mp, 1) +
> xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
> xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1));
> @@ -1043,7 +1043,7 @@ STATIC uint
> xfs_calc_attrrm_reservation(
> struct xfs_mount *mp)
> {
> - return XFS_DQUOT_LOGRES(mp) +
> + return XFS_DQUOT_LOGRES +
> max((xfs_calc_inode_res(mp, 1) +
> xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH,
> XFS_FSB_TO_B(mp, 1)) +
> --
> 2.39.2
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-23 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-21 11:27 [PATCH] xfs: remove unused parameter in macro XFS_DQUOT_LOGRES Julian Sun
2024-07-23 2:20 ` Darrick J. Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox