if (current_qctx)
return 0;
- retval = quota_init_context(¤t_qctx, current_fs, QUOTA_ALL_BIT);
+ retval = quota_init_context(¤t_qctx, current_fs, 0);
if (retval) {
com_err(current_fs->device_name, retval,
"while trying to load quota information");
int old_bitmaps;
__u32 features[3];
char *cp;
- unsigned int qtype_bits = 0;
enum quota_type qtype;
clear_problem_context(&pctx);
if (ext2fs_has_feature_quota(sb)) {
/* Quotas were enabled. Do quota accounting during fsck. */
- for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
- if (*quota_sb_inump(sb, qtype) != 0)
- qtype_bits |= 1 << qtype;
- }
-
clear_problem_context(&pctx);
- pctx.errcode = quota_init_context(&ctx->qctx, ctx->fs,
- qtype_bits);
+ pctx.errcode = quota_init_context(&ctx->qctx, ctx->fs, 0);
if (pctx.errcode) {
fix_problem(ctx, PR_0_QUOTA_INIT_CTX, &pctx);
fatal_error(ctx, 0);
int needs_writeout;
for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
- if (((1 << qtype) & qtype_bits) == 0)
+ if (*quota_sb_inump(sb, qtype) == 0)
continue;
needs_writeout = 0;
pctx.num = qtype;
memset(ctx, 0, sizeof(struct quota_ctx));
for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
ctx->quota_file[qtype] = NULL;
- if (((1 << qtype) & qtype_bits) == 0)
- continue;
+ if (qtype_bits) {
+ if (((1 << qtype) & qtype_bits) == 0)
+ continue;
+ } else {
+ if (*quota_sb_inump(fs->super, qtype) == 0)
+ continue;
+ }
err = ext2fs_get_mem(sizeof(dict_t), &dict);
if (err) {
log_debug("Failed to allocate dictionary");
quota_ctx_t qctx;
errcode_t retval;
- retval = quota_init_context(&qctx, fs, QUOTA_ALL_BIT);
+ retval = quota_init_context(&qctx, fs, quotatype_bits);
if (retval) {
com_err(program_name, retval,
_("while initializing quota context"));
/* Nothing to do. */
return;
- retval = quota_init_context(&qctx, fs, QUOTA_ALL_BIT);
+ retval = quota_init_context(&qctx, fs, 0);
if (retval) {
com_err(program_name, retval,
_("while initializing quota context in support library"));