fsdax: mark the iomap argument to dax_iomap_sector as const
Subsystems (2)
PATCH 1/1 fsdax: mark the iomap argument to dax_iomap_sector as const
From: Christoph Hellwig <[email protected]>
[ Upstream commit 7e4f4b2d689d959b03cb07dfbdb97b9696cb1076 ]
Signed-off-by Christoph Hellwig <[email protected]>
Reviewed-by Darrick J. Wong <[email protected]>
Signed-off-by Darrick J. Wong <[email protected]>
---
Fixes:
fs/dax.c: In function 'dax_iomap_iter':fs/dax.c:1147:44: error: passing argument 1 of 'dax_iomap_sector' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
const sector_t sector = dax_iomap_sector(iomap, pos);
^~~~~
fs/dax.c:1009:17: note: expected 'struct iomap *' but argument is of type 'const struct iomap *'
static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
^~~~~~~~~~~~~~~~The issue was introduced by the cherry-pick of commit 8df4919cb921 ("fsdax: switch dax_iomap_rw to use iomap_iter")
The upstream change made callers pass a const struct iomap *:
const struct iomap *iomap = &iomi->iomap;
but dax_iomap_sector() still expected a mutable pointer:
static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
fs/dax.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/dax.c +1 -1
@@ -1006,7 +1006,7 @@ int dax_writeback_mapping_range(struct address_space *mapping, }EXPORT_SYMBOL_GPL (dax_writeback_mapping_range); -static sector_t dax_iomap_sector (struct iomap *iomap,loff_t pos) +static sector_t dax_iomap_sector (const struct iomap *iomap,loff_t pos) {return (iomap->addr + (pos &PAGE_MASK ) - iomap->offset) >>9 ; }
Signature · 1 line
2.47.3