Lines Matching refs:req
356 * @req: budgeting request
362 const struct ubifs_budget_req *req)
366 znodes = req->new_ino + (req->new_page << UBIFS_BLOCKS_PER_PAGE_SHIFT) +
367 req->new_dent;
375 * @req: budgeting request
378 const struct ubifs_budget_req *req)
382 data_growth = req->new_ino ? c->bi.inode_budget : 0;
383 if (req->new_page)
385 if (req->new_dent)
387 data_growth += req->new_ino_d;
395 * @req: budgeting request
398 const struct ubifs_budget_req *req)
402 dd_growth = req->dirtied_page ? c->bi.page_budget : 0;
404 if (req->dirtied_ino)
405 dd_growth += c->bi.inode_budget * req->dirtied_ino;
406 if (req->mod_dent)
408 dd_growth += req->dirtied_ino_d;
415 * @req: budget request
425 int ubifs_budget_space(struct ubifs_info *c, struct ubifs_budget_req *req)
429 ubifs_assert(c, req->new_page <= 1);
430 ubifs_assert(c, req->dirtied_page <= 1);
431 ubifs_assert(c, req->new_dent <= 1);
432 ubifs_assert(c, req->mod_dent <= 1);
433 ubifs_assert(c, req->new_ino <= 1);
434 ubifs_assert(c, req->new_ino_d <= UBIFS_MAX_INO_DATA);
435 ubifs_assert(c, req->dirtied_ino <= 4);
436 ubifs_assert(c, req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
437 ubifs_assert(c, !(req->new_ino_d & 7));
438 ubifs_assert(c, !(req->dirtied_ino_d & 7));
440 data_growth = calc_data_growth(c, req);
441 dd_growth = calc_dd_growth(c, req);
444 idx_growth = calc_idx_growth(c, req);
464 req->idx_growth = idx_growth;
465 req->data_growth = data_growth;
466 req->dd_growth = dd_growth;
477 if (req->fast) {
506 * @req: budget request
509 * since the index changes (which were budgeted for in @req->idx_growth) will
514 void ubifs_release_budget(struct ubifs_info *c, struct ubifs_budget_req *req)
516 ubifs_assert(c, req->new_page <= 1);
517 ubifs_assert(c, req->dirtied_page <= 1);
518 ubifs_assert(c, req->new_dent <= 1);
519 ubifs_assert(c, req->mod_dent <= 1);
520 ubifs_assert(c, req->new_ino <= 1);
521 ubifs_assert(c, req->new_ino_d <= UBIFS_MAX_INO_DATA);
522 ubifs_assert(c, req->dirtied_ino <= 4);
523 ubifs_assert(c, req->dirtied_ino_d <= UBIFS_MAX_INO_DATA * 4);
524 ubifs_assert(c, !(req->new_ino_d & 7));
525 ubifs_assert(c, !(req->dirtied_ino_d & 7));
526 if (!req->recalculate) {
527 ubifs_assert(c, req->idx_growth >= 0);
528 ubifs_assert(c, req->data_growth >= 0);
529 ubifs_assert(c, req->dd_growth >= 0);
532 if (req->recalculate) {
533 req->data_growth = calc_data_growth(c, req);
534 req->dd_growth = calc_dd_growth(c, req);
535 req->idx_growth = calc_idx_growth(c, req);
538 if (!req->data_growth && !req->dd_growth)
545 c->bi.idx_growth -= req->idx_growth;
546 c->bi.uncommitted_idx += req->idx_growth;
547 c->bi.data_growth -= req->data_growth;
548 c->bi.dd_growth -= req->dd_growth;
596 struct ubifs_budget_req req;
598 memset(&req, 0, sizeof(struct ubifs_budget_req));
600 req.dd_growth = c->bi.inode_budget + ALIGN(ui->data_len, 8);
601 ubifs_release_budget(c, &req);