fs: mark the iomap argument to __block_write_begin_int const
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Aug 2021 01:33:05 +0000 (18:33 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 17 Aug 2021 04:26:33 +0000 (21:26 -0700)
__block_write_begin_int never modifies the passed in iomap, so mark it
const.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/buffer.c
fs/internal.h

index 6290c3a..bd6a9e9 100644 (file)
@@ -1912,7 +1912,7 @@ EXPORT_SYMBOL(page_zero_new_buffers);
 
 static void
 iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
-               struct iomap *iomap)
+               const struct iomap *iomap)
 {
        loff_t offset = block << inode->i_blkbits;
 
@@ -1966,7 +1966,7 @@ iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
 }
 
 int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
-               get_block_t *get_block, struct iomap *iomap)
+               get_block_t *get_block, const struct iomap *iomap)
 {
        unsigned from = pos & (PAGE_SIZE - 1);
        unsigned to = from + len;
index 82e8eb3..54c2928 100644 (file)
@@ -48,8 +48,8 @@ static inline int emergency_thaw_bdev(struct super_block *sb)
 /*
  * buffer.c
  */
-extern int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
-               get_block_t *get_block, struct iomap *iomap);
+int __block_write_begin_int(struct page *page, loff_t pos, unsigned len,
+               get_block_t *get_block, const struct iomap *iomap);
 
 /*
  * char_dev.c