* comparing. This call increases the counter by one, dealing
* with the overflow between the overflows */
- if (args->key.min_offset < (uint64_t) -1) {
+ if (args->key.min_offset < UINT64_MAX) {
args->key.min_offset++;
return true;
}
- if (args->key.min_type < (uint8_t) -1) {
+ if (args->key.min_type < UINT8_MAX) {
args->key.min_type++;
args->key.min_offset = 0;
return true;
}
- if (args->key.min_objectid < (uint64_t) -1) {
+ if (args->key.min_objectid < UINT64_MAX) {
args->key.min_objectid++;
args->key.min_offset = 0;
args->key.min_type = 0;
.key.max_type = BTRFS_ROOT_ITEM_KEY,
.key.min_offset = 0,
- .key.max_offset = (uint64_t) -1,
+ .key.max_offset = UINT64_MAX,
/* No restrictions on the other components */
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
bool found = false;
/* No restrictions on the other components */
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
bool found_info = false, found_limit = false;
if (le64toh(qli->flags) & BTRFS_QGROUP_LIMIT_MAX_RFER)
ret->referenced_max = le64toh(qli->max_rfer);
else
- ret->referenced_max = (uint64_t) -1;
+ ret->referenced_max = UINT64_MAX;
if (le64toh(qli->flags) & BTRFS_QGROUP_LIMIT_MAX_EXCL)
ret->exclusive_max = le64toh(qli->max_excl);
else
- ret->exclusive_max = (uint64_t) -1;
+ ret->exclusive_max = UINT64_MAX;
found_limit = true;
}
return -ENODATA;
if (!found_info) {
- ret->referenced = (uint64_t) -1;
- ret->exclusive = (uint64_t) -1;
+ ret->referenced = UINT64_MAX;
+ ret->exclusive = UINT64_MAX;
}
if (!found_limit) {
- ret->referenced_max = (uint64_t) -1;
- ret->exclusive_max = (uint64_t) -1;
+ ret->referenced_max = UINT64_MAX;
+ ret->exclusive_max = UINT64_MAX;
}
return 0;
}
int btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret) {
- uint64_t level, lowest = (uint64_t) -1, lowest_qgroupid = 0;
+ uint64_t level, lowest = UINT64_MAX, lowest_qgroupid = 0;
_cleanup_free_ uint64_t *qgroups = NULL;
int r, n;
if (id != subvol_id)
continue;
- if (lowest == (uint64_t) -1 || level < lowest) {
+ if (lowest == UINT64_MAX || level < lowest) {
lowest_qgroupid = qgroups[i];
lowest = level;
}
}
- if (lowest == (uint64_t) -1) {
+ if (lowest == UINT64_MAX) {
/* No suitable higher-level qgroup found, let's return
* the leaf qgroup instead, and indicate that with the
* return value. */
.key.max_type = BTRFS_ROOT_BACKREF_KEY,
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
struct btrfs_ioctl_vol_args vol_args = {};
/* No restrictions on the other components */
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
int r;
.key.max_type = BTRFS_ROOT_BACKREF_KEY,
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
struct btrfs_ioctl_vol_args_v2 vol_args = {
/* No restrictions on the other components */
.key.min_offset = 0,
- .key.max_offset = (uint64_t) -1,
+ .key.max_offset = UINT64_MAX,
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
_cleanup_free_ uint64_t *items = NULL;
/* No restrictions on the other components */
.key.min_offset = 0,
- .key.max_offset = (uint64_t) -1,
+ .key.max_offset = UINT64_MAX,
.key.min_transid = 0,
- .key.max_transid = (uint64_t) -1,
+ .key.max_transid = UINT64_MAX,
};
int r;