diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-01-12 05:43:39 -0500 |
---|---|---|
committer | Steven Whitehouse <steve@dolmen.chygwyn.com> | 2009-03-24 07:21:14 -0400 |
commit | f057f6cdf64175db1151b1f5d110e29904f119a1 (patch) | |
tree | 582dbf358e351f64977620c29ebf772d693b1948 /fs/gfs2/quota.c | |
parent | 22077f57dec8fcbeb1112b35313961c0902ff038 (diff) |
GFS2: Merge lock_dlm module into GFS2
This is the big patch that I've been working on for some time
now. There are many reasons for wanting to make this change
such as:
o Reducing overhead by eliminating duplicated fields between structures
o Simplifcation of the code (reduces the code size by a fair bit)
o The locking interface is now the DLM interface itself as proposed
some time ago.
o Fewer lookups of glocks when processing replies from the DLM
o Fewer memory allocations/deallocations for each glock
o Scope to do further optimisations in the future (but this patch is
more than big enough for now!)
Please note that (a) this patch relates to the lock_dlm module and
not the DLM itself, that is still a separate module; and (b) that
we retain the ability to build GFS2 as a standalone single node
filesystem with out requiring the DLM.
This patch needs a lot of testing, hence my keeping it I restarted
my -git tree after the last merge window. That way, this has the maximum
exposure before its merged. This is (modulo a few minor bug fixes) the
same patch that I've been posting on and off the the last three months
and its passed a number of different tests so far.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r-- | fs/gfs2/quota.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index e8ef0f80fb11..8d53f66b5bcc 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include <linux/fs.h> | 45 | #include <linux/fs.h> |
46 | #include <linux/bio.h> | 46 | #include <linux/bio.h> |
47 | #include <linux/gfs2_ondisk.h> | 47 | #include <linux/gfs2_ondisk.h> |
48 | #include <linux/lm_interface.h> | ||
49 | #include <linux/kthread.h> | 48 | #include <linux/kthread.h> |
50 | #include <linux/freezer.h> | 49 | #include <linux/freezer.h> |
51 | 50 | ||
@@ -108,7 +107,7 @@ int gfs2_shrink_qd_memory(int nr, gfp_t gfp_mask) | |||
108 | gfs2_assert_warn(sdp, !qd->qd_slot_count); | 107 | gfs2_assert_warn(sdp, !qd->qd_slot_count); |
109 | gfs2_assert_warn(sdp, !qd->qd_bh_count); | 108 | gfs2_assert_warn(sdp, !qd->qd_bh_count); |
110 | 109 | ||
111 | gfs2_lvb_unhold(qd->qd_gl); | 110 | gfs2_glock_put(qd->qd_gl); |
112 | atomic_dec(&sdp->sd_quota_count); | 111 | atomic_dec(&sdp->sd_quota_count); |
113 | 112 | ||
114 | /* Delete it from the common reclaim list */ | 113 | /* Delete it from the common reclaim list */ |
@@ -157,11 +156,6 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, u32 id, | |||
157 | if (error) | 156 | if (error) |
158 | goto fail; | 157 | goto fail; |
159 | 158 | ||
160 | error = gfs2_lvb_hold(qd->qd_gl); | ||
161 | gfs2_glock_put(qd->qd_gl); | ||
162 | if (error) | ||
163 | goto fail; | ||
164 | |||
165 | *qdp = qd; | 159 | *qdp = qd; |
166 | 160 | ||
167 | return 0; | 161 | return 0; |
@@ -211,7 +205,7 @@ static int qd_get(struct gfs2_sbd *sdp, int user, u32 id, int create, | |||
211 | 205 | ||
212 | if (qd || !create) { | 206 | if (qd || !create) { |
213 | if (new_qd) { | 207 | if (new_qd) { |
214 | gfs2_lvb_unhold(new_qd->qd_gl); | 208 | gfs2_glock_put(new_qd->qd_gl); |
215 | kmem_cache_free(gfs2_quotad_cachep, new_qd); | 209 | kmem_cache_free(gfs2_quotad_cachep, new_qd); |
216 | } | 210 | } |
217 | *qdp = qd; | 211 | *qdp = qd; |
@@ -1280,7 +1274,7 @@ void gfs2_quota_cleanup(struct gfs2_sbd *sdp) | |||
1280 | gfs2_assert_warn(sdp, qd->qd_slot_count == 1); | 1274 | gfs2_assert_warn(sdp, qd->qd_slot_count == 1); |
1281 | gfs2_assert_warn(sdp, !qd->qd_bh_count); | 1275 | gfs2_assert_warn(sdp, !qd->qd_bh_count); |
1282 | 1276 | ||
1283 | gfs2_lvb_unhold(qd->qd_gl); | 1277 | gfs2_glock_put(qd->qd_gl); |
1284 | kmem_cache_free(gfs2_quotad_cachep, qd); | 1278 | kmem_cache_free(gfs2_quotad_cachep, qd); |
1285 | 1279 | ||
1286 | spin_lock(&qd_lru_lock); | 1280 | spin_lock(&qd_lru_lock); |