From: Chandan Babu R <chandanrlinux@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/6] xfs: remove xfs_ifree_local_data
Date: Mon, 11 May 2020 22:02:45 +0530 [thread overview]
Message-ID: <4581909.4UAE70Nold@garuda> (raw)
In-Reply-To: <20200510072404.986627-4-hch@lst.de>
On Sunday 10 May 2020 12:54:01 PM IST Christoph Hellwig wrote:
> xfs_ifree only need to free inline data in the data fork, as we've
> already taken care of the attr fork before (and in fact freed the
> fork structure). Just open code the freeing of the inline data.
>
xfs_inactive() => xfs_attr_inactive() would have freed the attr fork. Hence
the changes made in this patch are correct.
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/xfs/xfs_inode.c | 30 ++++++++++--------------------
> 1 file changed, 10 insertions(+), 20 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 549ff468b7b60..7d3144dc99b72 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -2711,24 +2711,6 @@ xfs_ifree_cluster(
> return 0;
> }
>
> -/*
> - * Free any local-format buffers sitting around before we reset to
> - * extents format.
> - */
> -static inline void
> -xfs_ifree_local_data(
> - struct xfs_inode *ip,
> - int whichfork)
> -{
> - struct xfs_ifork *ifp;
> -
> - if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL)
> - return;
> -
> - ifp = XFS_IFORK_PTR(ip, whichfork);
> - xfs_idata_realloc(ip, -ifp->if_bytes, whichfork);
> -}
> -
> /*
> * This is called to return an inode to the inode free list.
> * The inode should already be truncated to 0 length and have
> @@ -2765,8 +2747,16 @@ xfs_ifree(
> if (error)
> return error;
>
> - xfs_ifree_local_data(ip, XFS_DATA_FORK);
> - xfs_ifree_local_data(ip, XFS_ATTR_FORK);
> + /*
> + * Free any local-format data sitting around before we reset the
> + * data fork to extents format. Note that the attr fork data has
> + * already been freed by xfs_attr_inactive.
> + */
> + if (ip->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
> + kmem_free(ip->i_df.if_u1.if_data);
> + ip->i_df.if_u1.if_data = NULL;
> + ip->i_df.if_bytes = 0;
> + }
>
> VFS_I(ip)->i_mode = 0; /* mark incore inode as free */
> ip->i_d.di_flags = 0;
>
--
chandan
next prev parent reply other threads:[~2020-05-11 16:32 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-10 7:23 move the extent count and format into struct xfs_ifork Christoph Hellwig
2020-05-10 7:23 ` [PATCH 1/6] xfs: use XFS_IFORK_BOFF xchk_bmap_check_rmaps Christoph Hellwig
2020-05-11 11:40 ` Chandan Babu R
2020-05-12 15:31 ` Brian Foster
2020-05-12 15:38 ` Darrick J. Wong
2020-05-12 16:14 ` Brian Foster
2020-05-12 19:16 ` Darrick J. Wong
2020-05-13 13:19 ` Brian Foster
2020-05-13 13:21 ` Christoph Hellwig
2020-05-16 18:42 ` [PATCH] xfs: clean up xchk_bmap_check_rmaps usage of XFS_IFORK_Q Darrick J. Wong
2020-05-16 20:01 ` Christoph Hellwig
2020-05-17 8:05 ` Christoph Hellwig
2020-05-10 7:24 ` [PATCH 2/6] xfs: remove the XFS_DFORK_Q macro Christoph Hellwig
2020-05-11 12:39 ` Chandan Babu R
2020-05-12 15:31 ` Brian Foster
2020-05-16 18:02 ` Darrick J. Wong
2020-05-10 7:24 ` [PATCH 3/6] xfs: remove xfs_ifree_local_data Christoph Hellwig
2020-05-11 16:32 ` Chandan Babu R [this message]
2020-05-12 15:31 ` Brian Foster
2020-05-16 18:07 ` Darrick J. Wong
2022-07-24 12:14 ` Alex Lyakas
2020-05-10 7:24 ` [PATCH 4/6] xfs: move the per-fork nextents fields into struct xfs_ifork Christoph Hellwig
2020-05-12 5:26 ` Chandan Babu R
2020-05-12 16:10 ` Brian Foster
2020-05-16 18:09 ` Darrick J. Wong
2020-05-17 8:12 ` Christoph Hellwig
2020-05-10 7:24 ` [PATCH 5/6] xfs: move the fork format " Christoph Hellwig
2020-05-12 9:37 ` Chandan Babu R
2020-05-12 18:53 ` Brian Foster
2020-05-14 21:25 ` Darrick J. Wong
2020-05-16 13:58 ` Christoph Hellwig
2020-05-16 17:01 ` Darrick J. Wong
2020-05-16 18:01 ` Darrick J. Wong
2020-05-16 18:16 ` Christoph Hellwig
2020-05-16 18:29 ` Darrick J. Wong
2020-05-10 7:24 ` [PATCH 6/6] xfs: cleanup xfs_idestroy_fork Christoph Hellwig
2020-05-12 9:48 ` Chandan Babu R
2020-05-12 18:54 ` Brian Foster
2020-05-16 18:10 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2020-05-18 7:33 move the extent count and format into struct xfs_ifork v2 Christoph Hellwig
2020-05-18 7:33 ` [PATCH 3/6] xfs: remove xfs_ifree_local_data Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4581909.4UAE70Nold@garuda \
--to=chandanrlinux@gmail.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).