* [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc
@ 2023-06-27 10:03 Lu Hongfei
2023-06-27 15:52 ` Christoph Hellwig
2023-06-27 22:50 ` Chaitanya Kulkarni
0 siblings, 2 replies; 3+ messages in thread
From: Lu Hongfei @ 2023-06-27 10:03 UTC (permalink / raw)
To: Christoph Hellwig, Darrick J. Wong, linux-xfs, linux-fsdevel,
linux-kernel
Cc: opensource.kernel, luhongfei
The return value type of i_blocksize() is 'unsigned int', so the
type of blocksize has been modified from 'int' to 'unsigned int'
to ensure data type consistency.
Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
---
fs/iomap/buffered-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index a4fa81af60d9..90ea9e09c1ae 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1076,7 +1076,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
{
loff_t start_byte;
loff_t end_byte;
- int blocksize = i_blocksize(inode);
+ unsigned int blocksize = i_blocksize(inode);
if (iomap->type != IOMAP_DELALLOC)
return 0;
--
2.39.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc
2023-06-27 10:03 [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc Lu Hongfei
@ 2023-06-27 15:52 ` Christoph Hellwig
2023-06-27 22:50 ` Chaitanya Kulkarni
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-06-27 15:52 UTC (permalink / raw)
To: Lu Hongfei
Cc: Christoph Hellwig, Darrick J. Wong, linux-xfs, linux-fsdevel,
linux-kernel, opensource.kernel
On Tue, Jun 27, 2023 at 06:03:25PM +0800, Lu Hongfei wrote:
> loff_t start_byte;
> loff_t end_byte;
> - int blocksize = i_blocksize(inode);
> + unsigned int blocksize = i_blocksize(inode);
Please keep the existing alignment of the variable names.
With that the patch looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc
2023-06-27 10:03 [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc Lu Hongfei
2023-06-27 15:52 ` Christoph Hellwig
@ 2023-06-27 22:50 ` Chaitanya Kulkarni
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2023-06-27 22:50 UTC (permalink / raw)
To: Lu Hongfei
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-xfs@vger.kernel.org, Darrick J. Wong,
opensource.kernel@vivo.com, Christoph Hellwig
On 6/27/23 03:03, Lu Hongfei wrote:
> The return value type of i_blocksize() is 'unsigned int', so the
> type of blocksize has been modified from 'int' to 'unsigned int'
> to ensure data type consistency.
>
> Signed-off-by: Lu Hongfei <luhongfei@vivo.com>
> ---
> fs/iomap/buffered-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index a4fa81af60d9..90ea9e09c1ae 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -1076,7 +1076,7 @@ int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
> {
> loff_t start_byte;
> loff_t end_byte;
> - int blocksize = i_blocksize(inode);
> + unsigned int blocksize = i_blocksize(inode);
>
> if (iomap->type != IOMAP_DELALLOC)
> return 0;
Indeed as per include/linux/fs.h:
719 static inline unsigned int i_blocksize(const struct inode *node)
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
-ck
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-27 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 10:03 [PATCH] fs: iomap: Change the type of blocksize from 'int' to 'unsigned int' in iomap_file_buffered_write_punch_delalloc Lu Hongfei
2023-06-27 15:52 ` Christoph Hellwig
2023-06-27 22:50 ` Chaitanya Kulkarni
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).