[DLM] compat patch
[deliverable/linux.git] / fs / gfs2 / unlinked.c
index 24b91c23bc2dc673ddc6979ef0ed1a64523a3cf6..b92d730020553a8cd6b86cd64065a14e0200bd12 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc.  All rights reserved.
+ * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
  *
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
@@ -14,7 +14,6 @@
 #include <linux/buffer_head.h>
 #include <linux/kthread.h>
 #include <linux/gfs2_ondisk.h>
-#include <asm/semaphore.h>
 
 #include "gfs2.h"
 #include "lm_interface.h"
@@ -35,11 +34,12 @@ static int munge_ondisk(struct gfs2_sbd *sdp, unsigned int slot,
        int new = 0;
        struct buffer_head *bh;
        int error;
+       int boundary;
 
        block = slot / sdp->sd_ut_per_block;
        offset = slot % sdp->sd_ut_per_block;
 
-       error = gfs2_block_map(ip, block, &new, &dblock, NULL);
+       error = gfs2_block_map(ip->i_vnode, block, &new, &dblock, &boundary);
        if (error)
                return error;
        error = gfs2_meta_read(ip->i_gl, dblock, DIO_START | DIO_WAIT, &bh);
@@ -129,11 +129,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);
@@ -186,7 +187,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;
@@ -201,7 +202,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;
@@ -354,7 +355,7 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
 
                if (!extlen) {
                        int new = 0;
-                       error = gfs2_block_map(ip, x, &new, &dblock, &extlen);
+                       error = gfs2_extent_map(ip->i_vnode, x, &new, &dblock, &extlen);
                        if (error)
                                goto fail;
                }
@@ -409,7 +410,7 @@ int gfs2_unlinked_init(struct gfs2_sbd *sdp)
 
        return 0;
 
- fail:
+fail:
        gfs2_unlinked_cleanup(sdp);
        return error;
 }
This page took 0.036487 seconds and 5 git commands to generate.