Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nilfs2: convert nilfs_segctor_complete_write to use folios

Use the new folio APIs, saving five calls to compound_head(). This
includes the last callers of nilfs_end_page_io(), so remove that too.

Link: https://lkml.kernel.org/r/20231114084436.2755-4-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Matthew Wilcox (Oracle) and committed by
Andrew Morton
3cd36212 50196f00

+21 -28
+21 -28
fs/nilfs2/segment.c
··· 1778 1778 folio_end_writeback(folio); 1779 1779 } 1780 1780 1781 - static void nilfs_end_page_io(struct page *page, int err) 1782 - { 1783 - if (!page) 1784 - return; 1785 - nilfs_end_folio_io(page_folio(page), err); 1786 - } 1787 - 1788 1781 static void nilfs_abort_logs(struct list_head *logs, int err) 1789 1782 { 1790 1783 struct nilfs_segment_buffer *segbuf; ··· 1860 1867 static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci) 1861 1868 { 1862 1869 struct nilfs_segment_buffer *segbuf; 1863 - struct page *bd_page = NULL, *fs_page = NULL; 1870 + struct folio *bd_folio = NULL, *fs_folio = NULL; 1864 1871 struct the_nilfs *nilfs = sci->sc_super->s_fs_info; 1865 1872 int update_sr = false; 1866 1873 ··· 1871 1878 b_assoc_buffers) { 1872 1879 set_buffer_uptodate(bh); 1873 1880 clear_buffer_dirty(bh); 1874 - if (bh->b_page != bd_page) { 1875 - if (bd_page) 1876 - end_page_writeback(bd_page); 1877 - bd_page = bh->b_page; 1881 + if (bh->b_folio != bd_folio) { 1882 + if (bd_folio) 1883 + folio_end_writeback(bd_folio); 1884 + bd_folio = bh->b_folio; 1878 1885 } 1879 1886 } 1880 1887 /* 1881 - * We assume that the buffers which belong to the same page 1888 + * We assume that the buffers which belong to the same folio 1882 1889 * continue over the buffer list. 1883 - * Under this assumption, the last BHs of pages is 1884 - * identifiable by the discontinuity of bh->b_page 1885 - * (page != fs_page). 1890 + * Under this assumption, the last BHs of folios is 1891 + * identifiable by the discontinuity of bh->b_folio 1892 + * (folio != fs_folio). 1886 1893 * 1887 1894 * For B-tree node blocks, however, this assumption is not 1888 - * guaranteed. The cleanup code of B-tree node pages needs 1895 + * guaranteed. The cleanup code of B-tree node folios needs 1889 1896 * special care. 1890 1897 */ 1891 1898 list_for_each_entry(bh, &segbuf->sb_payload_buffers, ··· 1898 1905 1899 1906 set_mask_bits(&bh->b_state, clear_bits, set_bits); 1900 1907 if (bh == segbuf->sb_super_root) { 1901 - if (bh->b_page != bd_page) { 1902 - end_page_writeback(bd_page); 1903 - bd_page = bh->b_page; 1908 + if (bh->b_folio != bd_folio) { 1909 + folio_end_writeback(bd_folio); 1910 + bd_folio = bh->b_folio; 1904 1911 } 1905 1912 update_sr = true; 1906 1913 break; 1907 1914 } 1908 - if (bh->b_page != fs_page) { 1909 - nilfs_end_page_io(fs_page, 0); 1910 - fs_page = bh->b_page; 1915 + if (bh->b_folio != fs_folio) { 1916 + nilfs_end_folio_io(fs_folio, 0); 1917 + fs_folio = bh->b_folio; 1911 1918 } 1912 1919 } 1913 1920 ··· 1921 1928 } 1922 1929 } 1923 1930 /* 1924 - * Since pages may continue over multiple segment buffers, 1925 - * end of the last page must be checked outside of the loop. 1931 + * Since folios may continue over multiple segment buffers, 1932 + * end of the last folio must be checked outside of the loop. 1926 1933 */ 1927 - if (bd_page) 1928 - end_page_writeback(bd_page); 1934 + if (bd_folio) 1935 + folio_end_writeback(bd_folio); 1929 1936 1930 - nilfs_end_page_io(fs_page, 0); 1937 + nilfs_end_folio_io(fs_folio, 0); 1931 1938 1932 1939 nilfs_drop_collected_inodes(&sci->sc_dirty_files); 1933 1940