Re: [PATCH 1/2] xfs: Fix xfs_flush_unmap_range() range for RT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/05/2024 00:40, Dave Chinner wrote:
- rounding = max_t(xfs_off_t, mp->m_sb.sb_blocksize, PAGE_SIZE);
-	start = round_down(offset, rounding);
-	end = round_up(offset + len, rounding) - 1;
+	/*
+	 * Make sure we extend the flush out to extent alignment
+	 * boundaries so any extent range overlapping the start/end
+	 * of the modification we are about to do is clean and idle.
+	 */
+	rounding = max_t(xfs_off_t, xfs_inode_alloc_unitsize(ip), PAGE_SIZE);
+	start = rounddown(offset, rounding);
+	end = roundup(offset + len, rounding) - 1;

I have to admit that I am not the biggest fan of this rounding API.

So round_{down, up}() happens to handle 64b, but round{down, up} doesn't :(

And that is not to mention the vague naming.

These are 64 bit values, so roundup_64() and rounddown_64().

yeah, thanks.

I can't help but think such a thing should be part of core kernel API.

Thanks,
John









[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux