@@ -1797,32 +1797,39 @@ MODULE_ALIAS_FS("xfs");
1797
1797
STATIC int __init
1798
1798
xfs_init_zones (void )
1799
1799
{
1800
- xfs_log_ticket_zone = kmem_zone_init (sizeof (xlog_ticket_t ),
1801
- "xfs_log_ticket" );
1800
+ xfs_log_ticket_zone = kmem_cache_create ("xfs_log_ticket" ,
1801
+ sizeof (struct xlog_ticket ),
1802
+ 0 , 0 , NULL );
1802
1803
if (!xfs_log_ticket_zone )
1803
1804
goto out ;
1804
1805
1805
- xfs_bmap_free_item_zone = kmem_zone_init (
1806
- sizeof (struct xfs_extent_free_item ),
1807
- "xfs_bmap_free_item" );
1806
+ xfs_bmap_free_item_zone = kmem_cache_create ( "xfs_bmap_free_item" ,
1807
+ sizeof (struct xfs_extent_free_item ),
1808
+ 0 , 0 , NULL );
1808
1809
if (!xfs_bmap_free_item_zone )
1809
1810
goto out_destroy_log_ticket_zone ;
1810
1811
1811
- xfs_btree_cur_zone = kmem_zone_init (sizeof (xfs_btree_cur_t ),
1812
- "xfs_btree_cur" );
1812
+ xfs_btree_cur_zone = kmem_cache_create ("xfs_btree_cur" ,
1813
+ sizeof (struct xfs_btree_cur ),
1814
+ 0 , 0 , NULL );
1813
1815
if (!xfs_btree_cur_zone )
1814
1816
goto out_destroy_bmap_free_item_zone ;
1815
1817
1816
- xfs_da_state_zone = kmem_zone_init (sizeof (xfs_da_state_t ),
1817
- "xfs_da_state" );
1818
+ xfs_da_state_zone = kmem_cache_create ("xfs_da_state" ,
1819
+ sizeof (struct xfs_da_state ),
1820
+ 0 , 0 , NULL );
1818
1821
if (!xfs_da_state_zone )
1819
1822
goto out_destroy_btree_cur_zone ;
1820
1823
1821
- xfs_ifork_zone = kmem_zone_init (sizeof (struct xfs_ifork ), "xfs_ifork" );
1824
+ xfs_ifork_zone = kmem_cache_create ("xfs_ifork" ,
1825
+ sizeof (struct xfs_ifork ),
1826
+ 0 , 0 , NULL );
1822
1827
if (!xfs_ifork_zone )
1823
1828
goto out_destroy_da_state_zone ;
1824
1829
1825
- xfs_trans_zone = kmem_zone_init (sizeof (xfs_trans_t ), "xfs_trans" );
1830
+ xfs_trans_zone = kmem_cache_create ("xf_trans" ,
1831
+ sizeof (struct xfs_trans ),
1832
+ 0 , 0 , NULL );
1826
1833
if (!xfs_trans_zone )
1827
1834
goto out_destroy_ifork_zone ;
1828
1835
@@ -1832,70 +1839,82 @@ xfs_init_zones(void)
1832
1839
* size possible under XFS. This wastes a little bit of memory,
1833
1840
* but it is much faster.
1834
1841
*/
1835
- xfs_buf_item_zone = kmem_zone_init (sizeof (struct xfs_buf_log_item ),
1836
- "xfs_buf_item" );
1842
+ xfs_buf_item_zone = kmem_cache_create ("xfs_buf_item" ,
1843
+ sizeof (struct xfs_buf_log_item ),
1844
+ 0 , 0 , NULL );
1837
1845
if (!xfs_buf_item_zone )
1838
1846
goto out_destroy_trans_zone ;
1839
1847
1840
- xfs_efd_zone = kmem_zone_init ((sizeof (xfs_efd_log_item_t ) +
1841
- ((XFS_EFD_MAX_FAST_EXTENTS - 1 ) *
1842
- sizeof (xfs_extent_t ))), "xfs_efd_item" );
1848
+ xfs_efd_zone = kmem_cache_create ("xfs_efd_item" ,
1849
+ (sizeof (struct xfs_efd_log_item ) +
1850
+ (XFS_EFD_MAX_FAST_EXTENTS - 1 ) *
1851
+ sizeof (struct xfs_extent )),
1852
+ 0 , 0 , NULL );
1843
1853
if (!xfs_efd_zone )
1844
1854
goto out_destroy_buf_item_zone ;
1845
1855
1846
- xfs_efi_zone = kmem_zone_init ((sizeof (xfs_efi_log_item_t ) +
1847
- ((XFS_EFI_MAX_FAST_EXTENTS - 1 ) *
1848
- sizeof (xfs_extent_t ))), "xfs_efi_item" );
1856
+ xfs_efi_zone = kmem_cache_create ("xfs_efi_item" ,
1857
+ (sizeof (struct xfs_efi_log_item ) +
1858
+ (XFS_EFI_MAX_FAST_EXTENTS - 1 ) *
1859
+ sizeof (struct xfs_extent )),
1860
+ 0 , 0 , NULL );
1849
1861
if (!xfs_efi_zone )
1850
1862
goto out_destroy_efd_zone ;
1851
1863
1852
- xfs_inode_zone =
1853
- kmem_zone_init_flags (sizeof (xfs_inode_t ), "xfs_inode" ,
1854
- KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD |
1855
- KM_ZONE_ACCOUNT , xfs_fs_inode_init_once );
1864
+ xfs_inode_zone = kmem_cache_create ("xfs_inode" ,
1865
+ sizeof (struct xfs_inode ), 0 ,
1866
+ (SLAB_HWCACHE_ALIGN |
1867
+ SLAB_RECLAIM_ACCOUNT |
1868
+ SLAB_MEM_SPREAD | SLAB_ACCOUNT ),
1869
+ xfs_fs_inode_init_once );
1856
1870
if (!xfs_inode_zone )
1857
1871
goto out_destroy_efi_zone ;
1858
1872
1859
- xfs_ili_zone =
1860
- kmem_zone_init_flags ( sizeof (xfs_inode_log_item_t ), "xfs_ili" ,
1861
- KM_ZONE_SPREAD , NULL );
1873
+ xfs_ili_zone = kmem_cache_create ( "xfs_ili" ,
1874
+ sizeof (struct xfs_inode_log_item ), 0 ,
1875
+ SLAB_MEM_SPREAD , NULL );
1862
1876
if (!xfs_ili_zone )
1863
1877
goto out_destroy_inode_zone ;
1864
- xfs_icreate_zone = kmem_zone_init (sizeof (struct xfs_icreate_item ),
1865
- "xfs_icr" );
1878
+
1879
+ xfs_icreate_zone = kmem_cache_create ("xfs_icr" ,
1880
+ sizeof (struct xfs_icreate_item ),
1881
+ 0 , 0 , NULL );
1866
1882
if (!xfs_icreate_zone )
1867
1883
goto out_destroy_ili_zone ;
1868
1884
1869
- xfs_rud_zone = kmem_zone_init (sizeof (struct xfs_rud_log_item ),
1870
- "xfs_rud_item" );
1885
+ xfs_rud_zone = kmem_cache_create ("xfs_rud_item" ,
1886
+ sizeof (struct xfs_rud_log_item ),
1887
+ 0 , 0 , NULL );
1871
1888
if (!xfs_rud_zone )
1872
1889
goto out_destroy_icreate_zone ;
1873
1890
1874
- xfs_rui_zone = kmem_zone_init (
1891
+ xfs_rui_zone = kmem_cache_create ( "xfs_rui_item" ,
1875
1892
xfs_rui_log_item_sizeof (XFS_RUI_MAX_FAST_EXTENTS ),
1876
- "xfs_rui_item" );
1893
+ 0 , 0 , NULL );
1877
1894
if (!xfs_rui_zone )
1878
1895
goto out_destroy_rud_zone ;
1879
1896
1880
- xfs_cud_zone = kmem_zone_init (sizeof (struct xfs_cud_log_item ),
1881
- "xfs_cud_item" );
1897
+ xfs_cud_zone = kmem_cache_create ("xfs_cud_item" ,
1898
+ sizeof (struct xfs_cud_log_item ),
1899
+ 0 , 0 , NULL );
1882
1900
if (!xfs_cud_zone )
1883
1901
goto out_destroy_rui_zone ;
1884
1902
1885
- xfs_cui_zone = kmem_zone_init (
1903
+ xfs_cui_zone = kmem_cache_create ( "xfs_cui_item" ,
1886
1904
xfs_cui_log_item_sizeof (XFS_CUI_MAX_FAST_EXTENTS ),
1887
- "xfs_cui_item" );
1905
+ 0 , 0 , NULL );
1888
1906
if (!xfs_cui_zone )
1889
1907
goto out_destroy_cud_zone ;
1890
1908
1891
- xfs_bud_zone = kmem_zone_init (sizeof (struct xfs_bud_log_item ),
1892
- "xfs_bud_item" );
1909
+ xfs_bud_zone = kmem_cache_create ("xfs_bud_item" ,
1910
+ sizeof (struct xfs_bud_log_item ),
1911
+ 0 , 0 , NULL );
1893
1912
if (!xfs_bud_zone )
1894
1913
goto out_destroy_cui_zone ;
1895
1914
1896
- xfs_bui_zone = kmem_zone_init (
1915
+ xfs_bui_zone = kmem_cache_create ( "xfs_bui_item" ,
1897
1916
xfs_bui_log_item_sizeof (XFS_BUI_MAX_FAST_EXTENTS ),
1898
- "xfs_bui_item" );
1917
+ 0 , 0 , NULL );
1899
1918
if (!xfs_bui_zone )
1900
1919
goto out_destroy_bud_zone ;
1901
1920
0 commit comments