Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108545
b: refs/heads/master
c: 547000d
h: refs/heads/master
i:
  108543: b556ed9
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Aug 13, 2008
1 parent 8db3ead commit 37e9c06
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 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: f769108424a19c7758546d1d7d19f098b1a33759
refs/heads/master: 547000da6412c45456ff2ff44a171d01027bd727
12 changes: 12 additions & 0 deletions trunk/fs/ubifs/budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
int err, idx_growth, data_growth, dd_growth;
struct retries_info ri;

ubifs_assert(req->new_page <= 1);
ubifs_assert(req->dirtied_page <= 1);
ubifs_assert(req->new_dent <= 1);
ubifs_assert(req->mod_dent <= 1);
ubifs_assert(req->new_ino <= 1);
ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA);
ubifs_assert(req->dirtied_ino <= 4);
ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);

Expand Down Expand Up @@ -618,6 +624,12 @@ int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
*/
void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
{
ubifs_assert(req->new_page <= 1);
ubifs_assert(req->dirtied_page <= 1);
ubifs_assert(req->new_dent <= 1);
ubifs_assert(req->mod_dent <= 1);
ubifs_assert(req->new_ino <= 1);
ubifs_assert(req->new_ino_d <= UBIFS_MAX_INO_DATA);
ubifs_assert(req->dirtied_ino <= 4);
ubifs_assert(req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
if (!req->recalculate) {
Expand Down
8 changes: 7 additions & 1 deletion trunk/fs/ubifs/ubifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,17 +812,23 @@ struct ubifs_compressor {
struct ubifs_budget_req {
unsigned int fast:1;
unsigned int recalculate:1;
#ifndef UBIFS_DEBUG
unsigned int new_page:1;
unsigned int dirtied_page:1;
unsigned int new_dent:1;
unsigned int mod_dent:1;
unsigned int new_ino:1;
unsigned int new_ino_d:13;
#ifndef UBIFS_DEBUG
unsigned int dirtied_ino:4;
unsigned int dirtied_ino_d:15;
#else
/* Not bit-fields to check for overflows */
unsigned int new_page;
unsigned int dirtied_page;
unsigned int new_dent;
unsigned int mod_dent;
unsigned int new_ino;
unsigned int new_ino_d;
unsigned int dirtied_ino;
unsigned int dirtied_ino_d;
#endif
Expand Down

0 comments on commit 37e9c06

Please sign in to comment.