[PATCH 12/12] tests: Add tests for the quotactl syscall
Dmitry V. Levin
ldv at altlinux.org
Tue Sep 27 08:36:55 UTC 2016
On Wed, Sep 21, 2016 at 06:12:37AM +0300, Eugene Syromyatnikov wrote:
[...]
> diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c
> new file mode 100644
> index 0000000..bfbc83b
> --- /dev/null
> +++ b/tests/quotactl-xfs.c
[...]
> +static struct xlat xfs_types[] = {
> + XLAT_PAIR(1 << 0, "XFS_USER_QUOTA"),
> + XLAT_PAIR(1 << 1, "XFS_PROJ_QUOTA"),
> + XLAT_PAIR(1 << 2, "XFS_GROUP_QUOTA"),
> + XLAT_END
> +};
> +
> +static struct xlat xfs_flags[] = {
> + XLAT_PAIR(1 << 0, "XFS_QUOTA_UDQ_ACCT"),
> + XLAT_PAIR(1 << 1, "XFS_QUOTA_UDQ_ENFD"),
> + XLAT_PAIR(1 << 2, "XFS_QUOTA_GDQ_ACCT"),
> + XLAT_PAIR(1 << 3, "XFS_QUOTA_GDQ_ENFD"),
> + XLAT_PAIR(1 << 4, "XFS_QUOTA_PDQ_ACCT"),
> + XLAT_PAIR(1 << 5, "XFS_QUOTA_PDQ_ENFD"),
> + XLAT_END
> +};
Why do you want to duplicate these definitions?
If they are better than xlat/xfs_dqblk_flags.h and xlat/xfs_quota_flags.h
files, let's fix xlat/xfs_dqblk_flags.in and xlat/xfs_quota_flags.in
instead.
[...]
> +static const struct xlat dqblk_valid_vals[] = {
> + XLAT_PAIR(1, "QIF_BLIMITS"),
> + XLAT_PAIR(2, "QIF_SPACE"),
> + XLAT_PAIR(4, "QIF_ILIMITS"),
> + XLAT_PAIR(8, "QIF_INODES"),
> + XLAT_PAIR(16, "QIF_BTIME"),
> + XLAT_PAIR(32, "QIF_ITIME"),
> + XLAT_END
> +};
> +
> +static const struct xlat dqinfo_flags_vals[] = {
> + XLAT_PAIR(1 << 0, "DQF_ROOT_SQUASH"),
> + XLAT_PAIR(1 << 16, "DQF_SYS_FILE"),
> + XLAT_END
> +};
> +
> +static const struct xlat dqinfo_valid_vals[] = {
> + XLAT_PAIR(1, "IIF_BGRACE"),
> + XLAT_PAIR(2, "IIF_IGRACE"),
> + XLAT_PAIR(4, "IIF_FLAGS"),
> + XLAT_END
> +};
Likewise.
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160927/d8ec48a4/attachment.bin>
More information about the Strace-devel
mailing list