* [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink
@ 2020-04-18 5:30 xiakaixu1987
2020-04-20 16:22 ` Brian Foster
2020-04-27 17:57 ` Darrick J. Wong
0 siblings, 2 replies; 3+ messages in thread
From: xiakaixu1987 @ 2020-04-18 5:30 UTC (permalink / raw)
To: linux-xfs; +Cc: darrick.wong, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
Since the "no-allocation" reservations has been removed, the resblks
value should be larger than zero, so remove the unnecessary check.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
fs/xfs/xfs_symlink.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 13fb4b919648..973441992b08 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -243,8 +243,7 @@ xfs_symlink(
*/
xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
- if (resblks)
- resblks -= XFS_IALLOC_SPACE_RES(mp);
+ resblks -= XFS_IALLOC_SPACE_RES(mp);
/*
* If the symlink will fit into the inode, write it inline.
*/
@@ -265,8 +264,7 @@ xfs_symlink(
if (error)
goto out_trans_cancel;
- if (resblks)
- resblks -= fs_blocks;
+ resblks -= fs_blocks;
ip->i_d.di_size = pathlen;
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink
2020-04-18 5:30 [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink xiakaixu1987
@ 2020-04-20 16:22 ` Brian Foster
2020-04-27 17:57 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2020-04-20 16:22 UTC (permalink / raw)
To: xiakaixu1987; +Cc: linux-xfs, darrick.wong, Kaixu Xia
On Sat, Apr 18, 2020 at 01:30:51PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Since the "no-allocation" reservations has been removed, the resblks
> value should be larger than zero, so remove the unnecessary check.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_symlink.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index 13fb4b919648..973441992b08 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -243,8 +243,7 @@ xfs_symlink(
> */
> xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
>
> - if (resblks)
> - resblks -= XFS_IALLOC_SPACE_RES(mp);
> + resblks -= XFS_IALLOC_SPACE_RES(mp);
> /*
> * If the symlink will fit into the inode, write it inline.
> */
> @@ -265,8 +264,7 @@ xfs_symlink(
> if (error)
> goto out_trans_cancel;
>
> - if (resblks)
> - resblks -= fs_blocks;
> + resblks -= fs_blocks;
> ip->i_d.di_size = pathlen;
> xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
>
> --
> 2.20.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink
2020-04-18 5:30 [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink xiakaixu1987
2020-04-20 16:22 ` Brian Foster
@ 2020-04-27 17:57 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2020-04-27 17:57 UTC (permalink / raw)
To: xiakaixu1987; +Cc: linux-xfs, Kaixu Xia
On Sat, Apr 18, 2020 at 01:30:51PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Since the "no-allocation" reservations has been removed, the resblks
> value should be larger than zero, so remove the unnecessary check.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Seems fine to me...
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_symlink.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
> index 13fb4b919648..973441992b08 100644
> --- a/fs/xfs/xfs_symlink.c
> +++ b/fs/xfs/xfs_symlink.c
> @@ -243,8 +243,7 @@ xfs_symlink(
> */
> xfs_qm_vop_create_dqattach(tp, ip, udqp, gdqp, pdqp);
>
> - if (resblks)
> - resblks -= XFS_IALLOC_SPACE_RES(mp);
> + resblks -= XFS_IALLOC_SPACE_RES(mp);
> /*
> * If the symlink will fit into the inode, write it inline.
> */
> @@ -265,8 +264,7 @@ xfs_symlink(
> if (error)
> goto out_trans_cancel;
>
> - if (resblks)
> - resblks -= fs_blocks;
> + resblks -= fs_blocks;
> ip->i_d.di_size = pathlen;
> xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
>
> --
> 2.20.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-27 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-18 5:30 [PATCH] xfs: remove unnecessary check of the variable resblks in xfs_symlink xiakaixu1987
2020-04-20 16:22 ` Brian Foster
2020-04-27 17:57 ` 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;
as well as URLs for NNTP newsgroup(s).