From: Jan Kara <jack@suse.cz>
To: Yangtao Li <frank.li@vivo.com>
Cc: almaz.alexandrovich@paragon-software.com, jack@suse.com,
dushistov@mail.ru, brauner@kernel.org, ntfs3@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] udf: use wrapper i_blocksize() in udf_discard_prealloc()
Date: Mon, 13 Mar 2023 11:17:20 +0100 [thread overview]
Message-ID: <20230313101720.ogqufcqeqfxcdzfz@quack3> (raw)
In-Reply-To: <20230310030821.66090-2-frank.li@vivo.com>
On Fri 10-03-23 11:08:20, Yangtao Li wrote:
> Convert to use i_blocksize() for readability.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
Thanks. I've queued this cleanup into my tree.
Honza
> ---
> fs/udf/truncate.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
> index 871856c69df5..2e7ba234bab8 100644
> --- a/fs/udf/truncate.c
> +++ b/fs/udf/truncate.c
> @@ -127,7 +127,7 @@ void udf_discard_prealloc(struct inode *inode)
> uint64_t lbcount = 0;
> int8_t etype = -1;
> struct udf_inode_info *iinfo = UDF_I(inode);
> - int bsize = 1 << inode->i_blkbits;
> + int bsize = i_blocksize(inode);
>
> if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
> ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize))
> @@ -149,7 +149,7 @@ void udf_discard_prealloc(struct inode *inode)
> lbcount -= elen;
> udf_delete_aext(inode, prev_epos);
> udf_free_blocks(inode->i_sb, inode, &eloc, 0,
> - DIV_ROUND_UP(elen, 1 << inode->i_blkbits));
> + DIV_ROUND_UP(elen, bsize));
> }
> /* This inode entry is in-memory only and thus we don't have to mark
> * the inode dirty */
> --
> 2.25.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-03-13 10:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 3:08 [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range() Yangtao Li
2023-03-10 3:08 ` [PATCH 2/3] udf: use wrapper i_blocksize() in udf_discard_prealloc() Yangtao Li
2023-03-13 10:17 ` Jan Kara [this message]
2023-03-10 3:08 ` [PATCH 3/3] ufs: use wrapper i_blocksize() in ufs_get_locked_page() Yangtao Li
2023-03-10 13:18 ` [PATCH 1/3] fs/ntfs3: use wrapper i_blocksize() in ntfs_zero_range() kernel test robot
2023-03-10 14:30 ` kernel test robot
2023-05-08 12:52 ` Konstantin Komarov
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=20230313101720.ogqufcqeqfxcdzfz@quack3 \
--to=jack@suse.cz \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=brauner@kernel.org \
--cc=dushistov@mail.ru \
--cc=frank.li@vivo.com \
--cc=jack@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
/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