Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210974
b: refs/heads/master
c: 4a452de
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Joel Becker committed Sep 23, 2010
1 parent 1b198ce commit 19e0e91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 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: 47dea423799d98c53793237ab386a94976f305d5
refs/heads/master: 4a452de4fdfe4dbb27e491904d8bfaf1262bdff4
22 changes: 10 additions & 12 deletions trunk/fs/ocfs2/reservations.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,25 +732,23 @@ int ocfs2_resmap_resv_bits(struct ocfs2_reservation_map *resmap,
struct ocfs2_alloc_reservation *resv,
int *cstart, int *clen)
{
unsigned int wanted = *clen;

if (resv == NULL || ocfs2_resmap_disabled(resmap))
return -ENOSPC;

spin_lock(&resv_lock);

/*
* We don't want to over-allocate for temporary
* windows. Otherwise, we run the risk of fragmenting the
* allocation space.
*/
wanted = ocfs2_resv_window_bits(resmap, resv);
if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)
wanted = *clen;

if (ocfs2_resv_empty(resv)) {
mlog(0, "empty reservation, find new window\n");
/*
* We don't want to over-allocate for temporary
* windows. Otherwise, we run the risk of fragmenting the
* allocation space.
*/
unsigned int wanted = ocfs2_resv_window_bits(resmap, resv);

if ((resv->r_flags & OCFS2_RESV_FLAG_TMP) || wanted < *clen)
wanted = *clen;

mlog(0, "empty reservation, find new window\n");
/*
* Try to get a window here. If it works, we must fall
* through and test the bitmap . This avoids some
Expand Down

0 comments on commit 19e0e91

Please sign in to comment.