}
/* Read given block */
-static void read_blk(struct quota_handle *h, uint blk, dqbuf_t buf)
+static void read_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf)
{
int err;
}
/* Write block */
-static int write_blk(struct quota_handle *h, uint blk, dqbuf_t buf)
+static int write_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf)
{
int err;
}
/* Put given block to free list */
-static void put_free_dqblk(struct quota_handle *h, dqbuf_t buf, uint blk)
+static void put_free_dqblk(struct quota_handle *h, dqbuf_t buf,
+ unsigned int blk)
{
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
}
/* Remove given block from the list of blocks with free entries */
-static void remove_free_dqentry(struct quota_handle *h, dqbuf_t buf, uint blk)
+static void remove_free_dqentry(struct quota_handle *h, dqbuf_t buf,
+ unsigned int blk)
{
dqbuf_t tmpbuf = getdqbuf();
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
- uint nextblk = ext2fs_le32_to_cpu(dh->dqdh_next_free), prevblk =
+ unsigned int nextblk = ext2fs_le32_to_cpu(dh->dqdh_next_free), prevblk =
ext2fs_le32_to_cpu(dh->dqdh_prev_free);
}
/* Insert given block to the beginning of list with free entries */
-static void insert_free_dqentry(struct quota_handle *h, dqbuf_t buf, uint blk)
+static void insert_free_dqentry(struct quota_handle *h, dqbuf_t buf,
+ unsigned int blk)
{
dqbuf_t tmpbuf = getdqbuf();
struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
}
/* Find space for dquot */
-static uint find_free_dqentry(struct quota_handle *h, struct dquot *dquot,
- int *err)
+static unsigned int find_free_dqentry(struct quota_handle *h,
+ struct dquot *dquot, int *err)
{
int blk, i;
struct qt_disk_dqdbheader *dh;
/* Insert reference to structure into the trie */
static int do_insert_tree(struct quota_handle *h, struct dquot *dquot,
- uint * treeblk, int depth)
+ unsigned int * treeblk, int depth)
{
dqbuf_t buf;
int newson = 0, newact = 0;
- u_int32_t *ref;
- uint newblk;
+ __u32 *ref;
+ unsigned int newblk;
int ret = 0;
log_debug("inserting in tree: treeblk=%u, depth=%d", *treeblk, depth);
read_blk(h, *treeblk, buf);
}
- ref = (u_int32_t *) buf;
+ ref = (__u32 *) buf;
newblk = ext2fs_le32_to_cpu(ref[get_index(dquot->dq_id, depth)]);
if (!newblk)
newson = 1;
/* Wrapper for inserting quota structure into tree */
static void dq_insert_tree(struct quota_handle *h, struct dquot *dquot)
{
- uint tmp = QT_TREEOFF;
+ unsigned int tmp = QT_TREEOFF;
if (do_insert_tree(h, dquot, &tmp, 0) < 0)
log_err("Cannot write quota (id %u): %s",
- (uint) dquot->dq_id, strerror(errno));
+ (unsigned int) dquot->dq_id, strerror(errno));
}
/* Write dquot to file */
if (ret) {
errno = ENOMEM;
log_err("Quota write failed (id %u): %s",
- (uint)dquot->dq_id, strerror(errno));
+ (unsigned int)dquot->dq_id, strerror(errno));
return;
}
if (ret > 0)
errno = ENOSPC;
log_err("Quota write failed (id %u): %s",
- (uint)dquot->dq_id, strerror(errno));
+ (unsigned int)dquot->dq_id, strerror(errno));
}
ext2fs_free_mem(&ddquot);
}
/* Free dquot entry in data block */
-static void free_dqentry(struct quota_handle *h, struct dquot *dquot, uint blk)
+static void free_dqentry(struct quota_handle *h, struct dquot *dquot,
+ unsigned int blk)
{
struct qt_disk_dqdbheader *dh;
struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
if (dquot->dq_dqb.u.v2_mdqb.dqb_off >> QT_BLKSIZE_BITS != blk)
log_err("Quota structure has offset to other block (%u) "
"than it should (%u).", blk,
- (uint) (dquot->dq_dqb.u.v2_mdqb.dqb_off >>
+ (unsigned int) (dquot->dq_dqb.u.v2_mdqb.dqb_off >>
QT_BLKSIZE_BITS));
read_blk(h, blk, buf);
/* Remove reference to dquot from tree */
static void remove_tree(struct quota_handle *h, struct dquot *dquot,
- uint * blk, int depth)
+ unsigned int * blk, int depth)
{
dqbuf_t buf = getdqbuf();
- uint newblk;
- u_int32_t *ref = (u_int32_t *) buf;
+ unsigned int newblk;
+ __u32 *ref = (__u32 *) buf;
if (!buf)
return;
/* Delete dquot from tree */
void qtree_delete_dquot(struct dquot *dquot)
{
- uint tmp = QT_TREEOFF;
+ unsigned int tmp = QT_TREEOFF;
if (!dquot->dq_dqb.u.v2_mdqb.dqb_off) /* Even not allocated? */
return;
/* Find entry in block */
static ext2_loff_t find_block_dqentry(struct quota_handle *h,
- struct dquot *dquot, uint blk)
+ struct dquot *dquot, unsigned int blk)
{
struct qtree_mem_dqinfo *info = &h->qh_info.u.v2_mdqi.dqi_qtree;
dqbuf_t buf = getdqbuf();
/* Find entry for given id in the tree */
static ext2_loff_t find_tree_dqentry(struct quota_handle *h,
struct dquot *dquot,
- uint blk, int depth)
+ unsigned int blk, int depth)
{
dqbuf_t buf = getdqbuf();
ext2_loff_t ret = 0;
- u_int32_t *ref = (u_int32_t *) buf;
+ __u32 *ref = (__u32 *) buf;
if (!buf)
return -ENOMEM;
#define set_bit(bmp, ind) ((bmp)[(ind) >> 3] |= (1 << ((ind) & 7)))
#define get_bit(bmp, ind) ((bmp)[(ind) >> 3] & (1 << ((ind) & 7)))
-static int report_block(struct dquot *dquot, uint blk, char *bitmap,
+static int report_block(struct dquot *dquot, unsigned int blk, char *bitmap,
int (*process_dquot) (struct dquot *, void *),
void *data)
{
return entries;
}
-static void check_reference(struct quota_handle *h, uint blk)
+static void check_reference(struct quota_handle *h, unsigned int blk)
{
if (blk >= h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks)
log_err("Illegal reference (%u >= %u) in %s quota file. "
type2name(h->qh_type));
}
-static int report_tree(struct dquot *dquot, uint blk, int depth, char *bitmap,
+static int report_tree(struct dquot *dquot, unsigned int blk, int depth,
+ char *bitmap,
int (*process_dquot) (struct dquot *, void *),
void *data)
{
int entries = 0, i;
dqbuf_t buf = getdqbuf();
- u_int32_t *ref = (u_int32_t *) buf;
+ __u32 *ref = (__u32 *) buf;
if (!buf)
return 0;
return entries;
}
-static uint find_set_bits(char *bmp, int blocks)
+static unsigned int find_set_bits(char *bmp, int blocks)
{
- uint i, used = 0;
+ unsigned int i, used = 0;
for (i = 0; i < blocks; i++)
if (get_bit(bmp, i))
#define V2_VERSION 1
struct v2_disk_dqheader {
- u_int32_t dqh_magic; /* Magic number identifying file */
- u_int32_t dqh_version; /* File version */
+ __u32 dqh_magic; /* Magic number identifying file */
+ __u32 dqh_version; /* File version */
} __attribute__ ((packed));
/* Flags for version specific files */
/* Header with type and version specific information */
struct v2_disk_dqinfo {
- u_int32_t dqi_bgrace; /* Time before block soft limit becomes
+ __u32 dqi_bgrace; /* Time before block soft limit becomes
* hard limit */
- u_int32_t dqi_igrace; /* Time before inode soft limit becomes
+ __u32 dqi_igrace; /* Time before inode soft limit becomes
* hard limit */
- u_int32_t dqi_flags; /* Flags for quotafile (DQF_*) */
- u_int32_t dqi_blocks; /* Number of blocks in file */
- u_int32_t dqi_free_blk; /* Number of first free block in the list */
- u_int32_t dqi_free_entry; /* Number of block with at least one
+ __u32 dqi_flags; /* Flags for quotafile (DQF_*) */
+ __u32 dqi_blocks; /* Number of blocks in file */
+ __u32 dqi_free_blk; /* Number of first free block in the list */
+ __u32 dqi_free_entry; /* Number of block with at least one
* free entry */
} __attribute__ ((packed));
struct v2r1_disk_dqblk {
- u_int32_t dqb_id; /* id this quota applies to */
- u_int32_t dqb_pad;
- u_int64_t dqb_ihardlimit; /* absolute limit on allocated inodes */
- u_int64_t dqb_isoftlimit; /* preferred inode limit */
- u_int64_t dqb_curinodes; /* current # allocated inodes */
- u_int64_t dqb_bhardlimit; /* absolute limit on disk space
+ __u32 dqb_id; /* id this quota applies to */
+ __u32 dqb_pad;
+ __u64 dqb_ihardlimit; /* absolute limit on allocated inodes */
+ __u64 dqb_isoftlimit; /* preferred inode limit */
+ __u64 dqb_curinodes; /* current # allocated inodes */
+ __u64 dqb_bhardlimit; /* absolute limit on disk space
* (in QUOTABLOCK_SIZE) */
- u_int64_t dqb_bsoftlimit; /* preferred limit on disk space
+ __u64 dqb_bsoftlimit; /* preferred limit on disk space
* (in QUOTABLOCK_SIZE) */
- u_int64_t dqb_curspace; /* current space occupied (in bytes) */
- u_int64_t dqb_btime; /* time limit for excessive disk use */
- u_int64_t dqb_itime; /* time limit for excessive inode use */
+ __u64 dqb_curspace; /* current space occupied (in bytes) */
+ __u64 dqb_btime; /* time limit for excessive disk use */
+ __u64 dqb_itime; /* time limit for excessive inode use */
} __attribute__ ((packed));
#endif