* [PATCH] xfs: remove unnecessary judgment from xfs_create
@ 2020-03-27 5:45 xiakaixu1987
2020-03-27 9:04 ` Christoph Hellwig
2020-03-27 15:45 ` Darrick J. Wong
0 siblings, 2 replies; 3+ messages in thread
From: xiakaixu1987 @ 2020-03-27 5:45 UTC (permalink / raw)
To: linux-xfs; +Cc: darrick.wong, Kaixu Xia
From: Kaixu Xia <kaixuxia@tencent.com>
Since the "no-allocation" reservations for file creations has
been removed, the resblks value should be larger than zero, so
remove unnecessary judgment.
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
fs/xfs/xfs_inode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c5077e6..e41bddf 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1219,8 +1219,7 @@
unlock_dp_on_error = false;
error = xfs_dir_createname(tp, dp, name, ip->i_ino,
- resblks ?
- resblks - XFS_IALLOC_SPACE_RES(mp) : 0);
+ resblks - XFS_IALLOC_SPACE_RES(mp));
if (error) {
ASSERT(error != -ENOSPC);
goto out_trans_cancel;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove unnecessary judgment from xfs_create
2020-03-27 5:45 [PATCH] xfs: remove unnecessary judgment from xfs_create xiakaixu1987
@ 2020-03-27 9:04 ` Christoph Hellwig
2020-03-27 15:45 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2020-03-27 9:04 UTC (permalink / raw)
To: xiakaixu1987; +Cc: linux-xfs, darrick.wong, Kaixu Xia
On Fri, Mar 27, 2020 at 01:45:56PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Since the "no-allocation" reservations for file creations has
> been removed, the resblks value should be larger than zero, so
> remove unnecessary judgment.
The patch looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
Although I would replace "judgement" with "condition" in the commit
log.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: remove unnecessary judgment from xfs_create
2020-03-27 5:45 [PATCH] xfs: remove unnecessary judgment from xfs_create xiakaixu1987
2020-03-27 9:04 ` Christoph Hellwig
@ 2020-03-27 15:45 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2020-03-27 15:45 UTC (permalink / raw)
To: xiakaixu1987; +Cc: linux-xfs, Kaixu Xia
On Fri, Mar 27, 2020 at 01:45:56PM +0800, xiakaixu1987@gmail.com wrote:
> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Since the "no-allocation" reservations for file creations has
> been removed, the resblks value should be larger than zero, so
> remove unnecessary judgment.
>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Seems reasonable, will test all this...
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index c5077e6..e41bddf 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -1219,8 +1219,7 @@
> unlock_dp_on_error = false;
>
> error = xfs_dir_createname(tp, dp, name, ip->i_ino,
> - resblks ?
> - resblks - XFS_IALLOC_SPACE_RES(mp) : 0);
> + resblks - XFS_IALLOC_SPACE_RES(mp));
> if (error) {
> ASSERT(error != -ENOSPC);
> goto out_trans_cancel;
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-27 15:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-27 5:45 [PATCH] xfs: remove unnecessary judgment from xfs_create xiakaixu1987
2020-03-27 9:04 ` Christoph Hellwig
2020-03-27 15:45 ` 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