aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmdomain.c
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2008-03-10 18:16:20 -0400
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:08 -0400
commit724bdca9b8449d9ee5f779dc27ee3d906a04508c (patch)
treec12d1028d862a58ce7a01024ba9b1f04ab157e3b /fs/ocfs2/dlm/dlmdomain.c
parent12eb0035d6f0466038ef2c6e5f6f9296b9b74d91 (diff)
ocfs2/dlm: Create slabcaches for lock and lockres
This patch makes the o2dlm allocate memory for lockres, lockname and lock structures from slabcaches rather than kmalloc. This allows us to not only make these allocs more efficient but also allows us to track the memory being consumed by these structures. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmdomain.c')
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 2ce620742f9e..b092364d0d52 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -1818,21 +1818,41 @@ static int __init dlm_init(void)
1818 status = dlm_init_mle_cache(); 1818 status = dlm_init_mle_cache();
1819 if (status) { 1819 if (status) {
1820 mlog(ML_ERROR, "Could not create o2dlm_mle slabcache\n"); 1820 mlog(ML_ERROR, "Could not create o2dlm_mle slabcache\n");
1821 return -1; 1821 goto error;
1822 }
1823
1824 status = dlm_init_master_caches();
1825 if (status) {
1826 mlog(ML_ERROR, "Could not create o2dlm_lockres and "
1827 "o2dlm_lockname slabcaches\n");
1828 goto error;
1829 }
1830
1831 status = dlm_init_lock_cache();
1832 if (status) {
1833 mlog(ML_ERROR, "Count not create o2dlm_lock slabcache\n");
1834 goto error;
1822 } 1835 }
1823 1836
1824 status = dlm_register_net_handlers(); 1837 status = dlm_register_net_handlers();
1825 if (status) { 1838 if (status) {
1826 dlm_destroy_mle_cache(); 1839 mlog(ML_ERROR, "Unable to register network handlers\n");
1827 return -1; 1840 goto error;
1828 } 1841 }
1829 1842
1830 return 0; 1843 return 0;
1844error:
1845 dlm_destroy_lock_cache();
1846 dlm_destroy_master_caches();
1847 dlm_destroy_mle_cache();
1848 return -1;
1831} 1849}
1832 1850
1833static void __exit dlm_exit (void) 1851static void __exit dlm_exit (void)
1834{ 1852{
1835 dlm_unregister_net_handlers(); 1853 dlm_unregister_net_handlers();
1854 dlm_destroy_lock_cache();
1855 dlm_destroy_master_caches();
1836 dlm_destroy_mle_cache(); 1856 dlm_destroy_mle_cache();
1837} 1857}
1838 1858