Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195727
b: refs/heads/master
c: a57c8fd
h: refs/heads/master
i:
  195725: 57de15b
  195723: b69b577
  195719: eb4cea4
  195711: ddded08
v: v3
  • Loading branch information
Mark Fasheh authored and Joel Becker committed May 6, 2010
1 parent f258911 commit 019ff9f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 57 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33d5d380d667ad264675cfdb297dfc3c5b6542cc
refs/heads/master: a57c8fd2ad238258cc983049008aea5f985804b2
51 changes: 0 additions & 51 deletions trunk/fs/ocfs2/localalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,46 +479,6 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
return status;
}

/* Check to see if the local alloc window is within ac->ac_max_block */
static int ocfs2_local_alloc_in_range(struct inode *inode,
struct ocfs2_alloc_context *ac,
u32 bits_wanted)
{
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_dinode *alloc;
struct ocfs2_local_alloc *la;
int start;
u64 block_off;

if (!ac->ac_max_block)
return 1;

alloc = (struct ocfs2_dinode *) osb->local_alloc_bh->b_data;
la = OCFS2_LOCAL_ALLOC(alloc);

start = ocfs2_local_alloc_find_clear_bits(osb, alloc, &bits_wanted, NULL);
if (start == -1) {
mlog_errno(-ENOSPC);
return 0;
}

/*
* Converting (bm_off + start + bits_wanted) to blocks gives us
* the blkno just past our actual allocation. This is perfect
* to compare with ac_max_block.
*/
block_off = ocfs2_clusters_to_blocks(inode->i_sb,
le32_to_cpu(la->la_bm_off) +
start + bits_wanted);
mlog(0, "Checking %llu against %llu\n",
(unsigned long long)block_off,
(unsigned long long)ac->ac_max_block);
if (block_off > ac->ac_max_block)
return 0;

return 1;
}

/*
* make sure we've got at least bits_wanted contiguous bits in the
* local alloc. You lose them when you drop i_mutex.
Expand Down Expand Up @@ -611,17 +571,6 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb,
mlog(0, "Calling in_range for max block %llu\n",
(unsigned long long)ac->ac_max_block);

if (!ocfs2_local_alloc_in_range(local_alloc_inode, ac,
bits_wanted)) {
/*
* The window is outside ac->ac_max_block.
* This errno tells the caller to keep localalloc enabled
* but to get the allocation from the main bitmap.
*/
status = -EFBIG;
goto bail;
}

ac->ac_inode = local_alloc_inode;
/* We should never use localalloc from another slot */
ac->ac_alloc_slot = osb->slot_num;
Expand Down
6 changes: 1 addition & 5 deletions trunk/fs/ocfs2/suballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,11 +941,7 @@ static int ocfs2_reserve_clusters_with_limit(struct ocfs2_super *osb,
status = ocfs2_reserve_local_alloc_bits(osb,
bits_wanted,
*ac);
if (status == -EFBIG) {
/* The local alloc window is outside ac_max_block.
* use the main bitmap. */
status = -ENOSPC;
} else if ((status < 0) && (status != -ENOSPC)) {
if ((status < 0) && (status != -ENOSPC)) {
mlog_errno(status);
goto bail;
}
Expand Down

0 comments on commit 019ff9f

Please sign in to comment.