mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2024-11-23 10:10:00 +00:00
ed86f575e9
commit 1612bf99de322e2554a90dced7337ff2d8d1ded6 category: bugfix issue: #I6VAS0 CVE: NA Signed-off-by: DongSenhao <dongsenhao2@huawei.com> --------------------------------------- Applying the __attribute__((packed)) annotation to members that do not need it impacts performance negatively on architectures that do not support efficient unaligned accesses (e.g. ARMv7). Hence minimize the __attribute__((packed)) annotations. See also CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS in the Linux kernel. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
61 lines
1.8 KiB
C
61 lines
1.8 KiB
C
/*
|
|
*
|
|
* Header file for disk format of new quotafile format
|
|
*
|
|
*/
|
|
|
|
#ifndef GUARD_QUOTAIO_V2_H
|
|
#define GUARD_QUOTAIO_V2_H
|
|
|
|
#include <sys/types.h>
|
|
#include "quotaio.h"
|
|
|
|
/* Offset of info header in file */
|
|
#define V2_DQINFOOFF sizeof(struct v2_disk_dqheader)
|
|
/* Supported version of quota-tree format */
|
|
#define V2_VERSION 1
|
|
|
|
struct v2_disk_dqheader {
|
|
__le32 dqh_magic; /* Magic number identifying file */
|
|
__le32 dqh_version; /* File version */
|
|
};
|
|
|
|
static_assert(sizeof(struct v2_disk_dqheader) == 8, "");
|
|
|
|
/* Flags for version specific files */
|
|
#define V2_DQF_MASK 0x0000 /* Mask for all valid ondisk flags */
|
|
|
|
/* Header with type and version specific information */
|
|
struct v2_disk_dqinfo {
|
|
__le32 dqi_bgrace; /* Time before block soft limit becomes
|
|
* hard limit */
|
|
__le32 dqi_igrace; /* Time before inode soft limit becomes
|
|
* hard limit */
|
|
__le32 dqi_flags; /* Flags for quotafile (DQF_*) */
|
|
__le32 dqi_blocks; /* Number of blocks in file */
|
|
__le32 dqi_free_blk; /* Number of first free block in the list */
|
|
__le32 dqi_free_entry; /* Number of block with at least one
|
|
* free entry */
|
|
};
|
|
|
|
static_assert(sizeof(struct v2_disk_dqinfo) == 24, "");
|
|
|
|
struct v2r1_disk_dqblk {
|
|
__le32 dqb_id; /* id this quota applies to */
|
|
__le32 dqb_pad;
|
|
__le64 dqb_ihardlimit; /* absolute limit on allocated inodes */
|
|
__le64 dqb_isoftlimit; /* preferred inode limit */
|
|
__le64 dqb_curinodes; /* current # allocated inodes */
|
|
__le64 dqb_bhardlimit; /* absolute limit on disk space
|
|
* (in QUOTABLOCK_SIZE) */
|
|
__le64 dqb_bsoftlimit; /* preferred limit on disk space
|
|
* (in QUOTABLOCK_SIZE) */
|
|
__le64 dqb_curspace; /* current space occupied (in bytes) */
|
|
__le64 dqb_btime; /* time limit for excessive disk use */
|
|
__le64 dqb_itime; /* time limit for excessive inode use */
|
|
};
|
|
|
|
static_assert(sizeof(struct v2r1_disk_dqblk) == 72, "");
|
|
|
|
#endif
|