Skip to content

Commit 4a2d7d5

Browse files
Christoph Hellwigdjbw
authored andcommitted
fsdax: simplify the offset check in dax_iomap_zero
The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent f1ba5fa commit 4a2d7d5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/dax.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,16 +1123,14 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf,
11231123

11241124
s64 dax_iomap_zero(loff_t pos, u64 length, struct iomap *iomap)
11251125
{
1126-
sector_t sector = iomap_sector(iomap, pos & PAGE_MASK);
11271126
pgoff_t pgoff = dax_iomap_pgoff(iomap, pos);
11281127
long rc, id;
11291128
void *kaddr;
11301129
bool page_aligned = false;
11311130
unsigned offset = offset_in_page(pos);
11321131
unsigned size = min_t(u64, PAGE_SIZE - offset, length);
11331132

1134-
if (IS_ALIGNED(sector << SECTOR_SHIFT, PAGE_SIZE) &&
1135-
(size == PAGE_SIZE))
1133+
if (IS_ALIGNED(pos, PAGE_SIZE) && size == PAGE_SIZE)
11361134
page_aligned = true;
11371135

11381136
id = dax_read_lock();

0 commit comments

Comments
 (0)