# endif
#endif
-#define log_err(format, ...) fprintf(stderr, \
- "[ERROR] %s:%d:%s:: " format "\n", \
- __FILE__, __LINE__, __func__, __VA_ARGS__)
+#define log_err(format, arg ...) \
+ fprintf(stderr, "[ERROR] %s:%d:%s:: " format "\n", \
+ __FILE__, __LINE__, __func__, ## arg)
#ifdef DEBUG_QUOTA
-# define log_debug(format, ...) fprintf(stderr, \
- "[DEBUG] %s:%d:%s:: " format "\n", \
- __FILE__, __LINE__, __func__, __VA_ARGS__)
+# define log_debug(format, arg ...) \
+ fprintf(stderr, "[DEBUG] %s:%d:%s:: " format "\n", \
+ __FILE__, __LINE__, __func__, ## arg)
#else
# define log_debug(format, ...)
#endif
fs = qctx->fs;
retval = ext2fs_get_mem(sizeof(struct quota_handle), &h);
if (retval) {
- log_err("Unable to allocate quota handle", "");
+ log_err("Unable to allocate quota handle");
goto out;
}
retval = quota_file_create(h, fs, i, fmt);
if (retval < 0) {
- log_err("Cannot initialize io on quotafile", "");
+ log_err("Cannot initialize io on quotafile");
continue;
}
err = ext2fs_get_mem(sizeof(struct quota_ctx), &ctx);
if (err) {
- log_err("Failed to allocate quota context", "");
+ log_err("Failed to allocate quota context");
return err;
}
continue;
err = ext2fs_get_mem(sizeof(dict_t), &dict);
if (err) {
- log_err("Failed to allocate dictionary", "");
+ log_err("Failed to allocate dictionary");
return err;
}
ctx->quota_dict[i] = dict;
dq = dnode_get(n);
else {
if (ext2fs_get_mem(sizeof(struct dquot), &dq)) {
- log_err("Unable to allocate dquot", "");
+ log_err("Unable to allocate dquot");
return NULL;
}
memset(dq, 0, sizeof(struct dquot));
scan_data->usage_is_inconsistent = 1;
fprintf(stderr, "[QUOTA WARNING] Usage inconsistent for ID %d:"
"actual (%llu, %llu) != expected (%llu, %llu)\n",
- dq->dq_id, dq->dq_dqb.dqb_curspace,
- dq->dq_dqb.dqb_curinodes, dquot->dq_dqb.dqb_curspace,
- dquot->dq_dqb.dqb_curinodes);
+ dq->dq_id, (long long)dq->dq_dqb.dqb_curspace,
+ (long long)dq->dq_dqb.dqb_curinodes,
+ (long long)dquot->dq_dqb.dqb_curspace,
+ (long long)dquot->dq_dqb.dqb_curinodes);
}
if (scan_data->update_limits) {
/*
* Write all memory dquots into quota file
*/
+#if 0 /* currently unused, but may be useful in the future? */
static errcode_t quota_write_all_dquots(struct quota_handle *qh,
quota_ctx_t qctx)
{
ext2fs_write_bitmaps(qctx->fs);
return 0;
}
+#endif
/*
* Updates the in-memory quota limits from the given quota inode.
err = ext2fs_get_mem(sizeof(struct quota_handle), &qh);
if (err) {
- log_err("Unable to allocate quota handle", "");
+ log_err("Unable to allocate quota handle");
return err;
}
err = quota_file_open(qh, qctx->fs, qf_ino, type, -1, 0);
if (err) {
- log_err("Open quota file failed", "");
+ log_err("Open quota file failed");
goto out;
}
fs->super->s_grp_quota_inum;
err = quota_file_open(&qh, fs, qf_ino, qtype, -1, 0);
if (err) {
- log_err("Open quota file failed", "");
+ log_err("Open quota file failed");
goto out;
}
scan_data.usage_is_inconsistent = 0;
err = qh.qh_ops->scan_dquots(&qh, scan_dquots_callback, &scan_data);
if (err) {
- log_err("Error scanning dquots", "");
+ log_err("Error scanning dquots");
goto out;
}
*usage_inconsistent = scan_data.usage_is_inconsistent;
if (h->qh_ops->check_file &&
(h->qh_ops->check_file(h, type, fmt) == 0)) {
- log_err("qh_ops->check_file failed", "");
+ log_err("qh_ops->check_file failed");
ext2fs_file_close(e2_file);
return -1;
}
if (h->qh_ops->init_io && (h->qh_ops->init_io(h) < 0)) {
- log_err("qh_ops->init_io failed", "");
+ log_err("qh_ops->init_io failed");
ext2fs_file_close(e2_file);
return -1;
}
err = ext2fs_read_inode(fs, ino, &inode);
if (err) {
- log_err("ex2fs_read_inode failed", "");
+ log_err("ex2fs_read_inode failed");
return err;
}
err = quota_inode_init_new(fs, qf_inum);
if (err) {
- log_err("init_new_quota_inode failed", "");
+ log_err("init_new_quota_inode failed");
goto out_err;
}
h->qh_qf.ino = qf_inum;
h->qh_ops = "afile_ops_2;
if (h->qh_ops->new_io && (h->qh_ops->new_io(h) < 0)) {
- log_err("qh_ops->new_io failed", "");
+ log_err("qh_ops->new_io failed");
goto out_err1;
}
struct dquot *dquot;
if (ext2fs_get_memzero(sizeof(struct dquot), &dquot)) {
- log_err("Failed to allocate dquot", "");
+ log_err("Failed to allocate dquot");
return NULL;
}
{
dqbuf_t buf;
if (ext2fs_get_memzero(QT_BLKSIZE, &buf)) {
- log_err("Failed to allocate dqbuf", "");
+ log_err("Failed to allocate dqbuf");
return NULL;
}
if (write_blk(h, info->dqi_blocks, buf) < 0) {
freedqbuf(buf);
log_err("Cannot allocate new quota block "
- "(out of disk space).", "");
+ "(out of disk space).");
return -ENOSPC;
}
blk = info->dqi_blocks++;
ddquot += info->dqi_entry_size;
if (i == qtree_dqstr_in_blk(info))
- log_err("find_free_dqentry(): Data block full but it "
- "shouldn't.", "");
+ log_err("find_free_dqentry(): Data block full unexpectedly.");
write_blk(h, blk, buf);
dquot->dq_dqb.u.v2_mdqb.dqb_off =
if (ext2fs_le32_to_cpu(dqh.dqh_magic) != file_magics[type]) {
if (ext2fs_be32_to_cpu(dqh.dqh_magic) == file_magics[type])
- log_err("Your quota file is stored in wrong "
- "endianity.", "");
+ log_err("Your quota file is stored in wrong endianity");
return 0;
}
if (V2_VERSION != ext2fs_le32_to_cpu(dqh.dqh_version))
*/
static int v2_report(struct quota_handle *h, int verbose)
{
- log_err("Not Implemented.", "");
+ log_err("Not Implemented.");
return -1;
}