From 19e0e91b4e32a3e281e21724383977affd327a31 Mon Sep 17 00:00:00 2001 From: Tao Ma Date: Sun, 19 Sep 2010 13:42:28 +0800 Subject: [PATCH] --- yaml --- r: 210974 b: refs/heads/master c: 4a452de4fdfe4dbb27e491904d8bfaf1262bdff4 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/reservations.c | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index dfaf02c33849..aa0dad22ae4a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 47dea423799d98c53793237ab386a94976f305d5 +refs/heads/master: 4a452de4fdfe4dbb27e491904d8bfaf1262bdff4 diff --git a/trunk/fs/ocfs2/reservations.c b/trunk/fs/ocfs2/reservations.c index d8b6e4259b80..3e78db361bc7 100644 --- a/trunk/fs/ocfs2/reservations.c +++ b/trunk/fs/ocfs2/reservations.c @@ -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