summaryrefslogtreecommitdiff
path: root/fs/ocfs2/reservations.h
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2010-04-08 16:33:02 +0800
committerJoel Becker <joel.becker@oracle.com>2010-04-23 15:01:36 -0700
commit31161bbc409dabe20c6641e637ddb468c02d0f24 (patch)
tree0bfd76fe5fba1a92848324c5b50ce0369a75a21e /fs/ocfs2/reservations.h
parentf60592305fc626955c0a2cdc5285423743e77bb2 (diff)
ocfs2: make ocfs2_adjust_resv_from_alloc simple.
When we allocate some bits from the reservation, we always allocate from the r_start(see ocfs2_resmap_resv_bits). So there should be no reason to check between r_start and start. And I don't think we will change this behaviour later by allocating from some bits after r_start. Why not make ocfs2_adjust_resv_from_alloc simple for now? The only chance we have to adjust the reservation is when we haven't reached the end. With this patch, the function is more readable. Note: btw, this patch also fixes an original bug in the function which I haven't found before. if (end < ocfs2_resv_end(resv)) rhs = end - ocfs2_resv_end(resv); This code is of course buggy. ;) Signed-off-by: Tao Ma <tao.ma@oracle.com> Acked-by: Mark Fasheh <mfasheh@suse.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/reservations.h')
-rw-r--r--fs/ocfs2/reservations.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ocfs2/reservations.h b/fs/ocfs2/reservations.h
index 25b0c0e31e91..1e49cc29d06c 100644
--- a/fs/ocfs2/reservations.h
+++ b/fs/ocfs2/reservations.h
@@ -149,7 +149,8 @@ int ocfs2_resmap_resv_bits(struct ocfs2_reservation_map *resmap,
* reservation. But we must always call this function when bits are claimed.
* Internally, the reservations code will use this information to mark the
* reservations bitmap. If resv is passed, it's next allocation window will be
- * calculated.
+ * calculated. It also expects that 'cstart' is the same as we passed back
+ * from ocfs2_resmap_resv_bits().
*/
void ocfs2_resmap_claimed_bits(struct ocfs2_reservation_map *resmap,
struct ocfs2_alloc_reservation *resv,