/*
* 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
#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"
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);
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);
goto fail;
- found:
+found:
for (b = 0; b < 8; b++)
if (!(byte & (1 << b)))
break;
return 0;
- fail:
+fail:
spin_unlock(&sdp->sd_unlinked_spin);
kfree(*ul);
return -ENOSPC;
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;
}
return 0;
- fail:
+fail:
gfs2_unlinked_cleanup(sdp);
return error;
}