diff options
Diffstat (limited to 'fs/xfs/xfs_dquot.c')
-rw-r--r-- | fs/xfs/xfs_dquot.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 2896ac953ed6..4be16a0cbe5a 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c | |||
@@ -59,6 +59,9 @@ int xfs_dqreq_num; | |||
59 | int xfs_dqerror_mod = 33; | 59 | int xfs_dqerror_mod = 33; |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | struct kmem_zone *xfs_qm_dqtrxzone; | ||
63 | static struct kmem_zone *xfs_qm_dqzone; | ||
64 | |||
62 | static struct lock_class_key xfs_dquot_other_class; | 65 | static struct lock_class_key xfs_dquot_other_class; |
63 | 66 | ||
64 | /* | 67 | /* |
@@ -71,7 +74,7 @@ xfs_qm_dqdestroy( | |||
71 | ASSERT(list_empty(&dqp->q_lru)); | 74 | ASSERT(list_empty(&dqp->q_lru)); |
72 | 75 | ||
73 | mutex_destroy(&dqp->q_qlock); | 76 | mutex_destroy(&dqp->q_qlock); |
74 | kmem_zone_free(xfs_Gqm->qm_dqzone, dqp); | 77 | kmem_zone_free(xfs_qm_dqzone, dqp); |
75 | 78 | ||
76 | XFS_STATS_DEC(xs_qm_dquot); | 79 | XFS_STATS_DEC(xs_qm_dquot); |
77 | } | 80 | } |
@@ -491,7 +494,7 @@ xfs_qm_dqread( | |||
491 | int cancelflags = 0; | 494 | int cancelflags = 0; |
492 | 495 | ||
493 | 496 | ||
494 | dqp = kmem_zone_zalloc(xfs_Gqm->qm_dqzone, KM_SLEEP); | 497 | dqp = kmem_zone_zalloc(xfs_qm_dqzone, KM_SLEEP); |
495 | 498 | ||
496 | dqp->dq_flags = type; | 499 | dqp->dq_flags = type; |
497 | dqp->q_core.d_id = cpu_to_be32(id); | 500 | dqp->q_core.d_id = cpu_to_be32(id); |
@@ -1040,3 +1043,31 @@ xfs_dqflock_pushbuf_wait( | |||
1040 | out_lock: | 1043 | out_lock: |
1041 | xfs_dqflock(dqp); | 1044 | xfs_dqflock(dqp); |
1042 | } | 1045 | } |
1046 | |||
1047 | int __init | ||
1048 | xfs_qm_init(void) | ||
1049 | { | ||
1050 | xfs_qm_dqzone = | ||
1051 | kmem_zone_init(sizeof(struct xfs_dquot), "xfs_dquot"); | ||
1052 | if (!xfs_qm_dqzone) | ||
1053 | goto out; | ||
1054 | |||
1055 | xfs_qm_dqtrxzone = | ||
1056 | kmem_zone_init(sizeof(struct xfs_dquot_acct), "xfs_dqtrx"); | ||
1057 | if (!xfs_qm_dqtrxzone) | ||
1058 | goto out_free_dqzone; | ||
1059 | |||
1060 | return 0; | ||
1061 | |||
1062 | out_free_dqzone: | ||
1063 | kmem_zone_destroy(xfs_qm_dqzone); | ||
1064 | out: | ||
1065 | return -ENOMEM; | ||
1066 | } | ||
1067 | |||
1068 | void __exit | ||
1069 | xfs_qm_exit(void) | ||
1070 | { | ||
1071 | kmem_zone_destroy(xfs_qm_dqtrxzone); | ||
1072 | kmem_zone_destroy(xfs_qm_dqzone); | ||
1073 | } | ||