Commit 1850d76
ext4: make ext4_insert_delayed_block() insert multi-blocks
Rename ext4_insert_delayed_block() to ext4_insert_delayed_blocks(),
pass length parameter to make it insert multiple delalloc blocks at a
time. For non-bigalloc case, just reserve len blocks and insert delalloc
extent. For bigalloc case, we can ensure that the clusters in the middle
of a extent must be unallocated, we only need to check whether the start
and end clusters are delayed/allocated. We should subtract the space for
the start and/or end block(s) if they are allocated.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240517124005.347221-10-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>1 parent 49bf6ab commit 1850d76
1 file changed
Lines changed: 36 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1686 | 1686 | | |
1687 | 1687 | | |
1688 | | - | |
| 1688 | + | |
| 1689 | + | |
1689 | 1690 | | |
1690 | 1691 | | |
1691 | 1692 | | |
1692 | | - | |
| 1693 | + | |
| 1694 | + | |
1693 | 1695 | | |
1694 | 1696 | | |
1695 | 1697 | | |
1696 | | - | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
1697 | 1702 | | |
1698 | 1703 | | |
1699 | | - | |
| 1704 | + | |
1700 | 1705 | | |
1701 | 1706 | | |
1702 | 1707 | | |
| |||
1707 | 1712 | | |
1708 | 1713 | | |
1709 | 1714 | | |
1710 | | - | |
| 1715 | + | |
1711 | 1716 | | |
1712 | 1717 | | |
1713 | 1718 | | |
| 1719 | + | |
| 1720 | + | |
1714 | 1721 | | |
1715 | 1722 | | |
1716 | 1723 | | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
1721 | 1741 | | |
1722 | 1742 | | |
1723 | 1743 | | |
1724 | 1744 | | |
1725 | 1745 | | |
1726 | | - | |
| 1746 | + | |
| 1747 | + | |
1727 | 1748 | | |
1728 | 1749 | | |
1729 | 1750 | | |
| |||
1828 | 1849 | | |
1829 | 1850 | | |
1830 | 1851 | | |
1831 | | - | |
| 1852 | + | |
1832 | 1853 | | |
1833 | 1854 | | |
1834 | 1855 | | |
| |||
0 commit comments