summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/unlinked.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-05-18 14:10:52 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-05-18 14:10:52 -0400
commit1b50259bc33f2adfcb4c5fba4b740bf80789df22 (patch)
treef8d20f032c9cb85883cdee846423667543947dde /fs/gfs2/unlinked.c
parent02f211f4d0e67794020ba1babbdaf7c45d56db45 (diff)
[GFS2] Drop log lock on I/O error & tidy up
This patch drops the log spinlock when an I/O error occurs to avoid any possible problems in case of blocking or recursion in the I/O error routine. It also has a few cosmetic changes to tidy up various other files. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/unlinked.c')
-rw-r--r--fs/gfs2/unlinked.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/gfs2/unlinked.c b/fs/gfs2/unlinked.c
index 0d2314a5252..2824b1665f9 100644
--- a/fs/gfs2/unlinked.c
+++ b/fs/gfs2/unlinked.c
@@ -130,11 +130,12 @@ static void enforce_limit(struct gfs2_sbd *sdp)
unsigned int tries = 0, min = 0;
int error;
- if (atomic_read(&sdp->sd_unlinked_count) >=
- gfs2_tune_get(sdp, gt_ilimit)) {
- tries = gfs2_tune_get(sdp, gt_ilimit_tries);
- min = gfs2_tune_get(sdp, gt_ilimit_min);
- }
+ if (atomic_read(&sdp->sd_unlinked_count) <
+ gfs2_tune_get(sdp, gt_ilimit))
+ return;
+
+ tries = gfs2_tune_get(sdp, gt_ilimit_tries);
+ min = gfs2_tune_get(sdp, gt_ilimit_min);
while (tries--) {
struct gfs2_unlinked *ul = ul_fish(sdp);
@@ -187,7 +188,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
goto fail;
- found:
+found:
for (b = 0; b < 8; b++)
if (!(byte & (1 << b)))
break;
@@ -202,7 +203,7 @@ int gfs2_unlinked_get(struct gfs2_sbd *sdp, struct gfs2_unlinked **ul)
return 0;
- fail:
+fail:
spin_unlock(&sdp->sd_unlinked_spin);
kfree(*ul);
return -ENOSPC;
@@ -410,7 +411,7 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
return 0;
- fail:
+fail:
gfs2_unlinked_cleanup(sdp);
return error;
}