summaryrefslogtreecommitdiff
path: root/quota.c
Commit message (Collapse)AuthorAgeFilesLines
* Move source files into src subdirectoryDmitry V. Levin2021-02-031-527/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/Makefile.am: New file. * src/.gitignore: Likewise. * scno.am: Move into src subdirectory. * scno.head: Likewise. * strace-graph: Likewise. * strace-log-merge: Likewise. * linux/: Likewise. * types/: Likewise. * xlat/: Likewise. * *.awk: Likewise. * *.c: Likewise. * *.h: Likewise. * *.sh: Likewise. * .gitignore: Update. * Makefile.am: Update. * bootstrap: Update. * configure.ac: Update. * debian/rules: Update. * debian/strace-udeb.install: Update. * debian/strace.examples: Update. * debian/strace.install: Update. * debian/strace64.install: Update. * m4/gen_bpf_attr_m4.sh: Update. * m4/mpers.m4: Update. * tests/Makefile.am: Update. * tests/init.sh: Update. * tests/legacy_syscall_info.test: Update. * tests/strace-log-merge-error.test: Update. * tests/strace-log-merge-suffix.test: Update.
* treewide: move #include "print_fields.h" to defs.hDmitry V. Levin2021-02-011-1/+0
| | | | | | As print_fields.h is going to be used by virtually every parser, include print_fields.h from defs.h, and stop including it in all other files except tests.
* treewide: replace tprints(", ...")Dmitry V. Levin2021-01-291-5/+10
| | | | | | | ... with tprint_struct_next()/tprint_array_next() followed by tprint_more_data_follows(). This applies to all users of print_fields.h macros except tests.
* treewide: replace tprints("}") with tprint_struct_end()Dmitry V. Levin2021-01-291-8/+8
| | | | This applies to all users of print_fields.h macros except tests.
* print_fields.h: remove prefix argument from all remaining PRINT_FIELD_* macrosDmitry V. Levin2021-01-291-57/+114
| | | | | | | | | | * print_fields.h (PRINT_FIELD_UID, PRINT_FIELD_LEN): Remove. (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_ID, PRINT_FIELD_TGID): Remove the first argument, all callers updated. * net.c (MAYBE_PRINT_FIELD_LEN): New macro, use it instead of PRINT_FIELD_LEN. * tests/nlattr_smc_diag_msg.c (PRINT_FIELD_SMC_DIAG_CURSOR): Remove the first argument, all callers updated.
* print_fields.h: remove prefix argument from PRINT_FIELD_X macroDmitry V. Levin2021-01-291-1/+2
| | | | | * print_fields.h (PRINT_FIELD_X): Remove the first argument, all callers updated.
* print_fields.h: remove prefix argument from PRINT_FIELD_FLAGS macroDmitry V. Levin2021-01-291-7/+14
| | | | | * print_fields.h (PRINT_FIELD_FLAGS): Remove the first argument, all callers updated.
* print_fields.h: remove prefix argument from PRINT_FIELD_OBJ_PTR macroDmitry V. Levin2021-01-291-5/+10
| | | | | * print_fields.h (PRINT_FIELD_OBJ_PTR): Remove the first argument, all callers updated.
* quota: avoid unnecessary string specificationsDmitry V. Levin2021-01-221-17/+30
| | | | | | | * quota.c (print_fs_qfilestat, print_fs_qfilestatv): New functions. (decode_cmd_data): Use them via PRINT_FIELD_OBJ_PTR to print struct fs_qfilestat fields of struct fs_quota_stat, and struct fs_qfilestatv fields of struct fs_quota_statv.
* Change my email addressDmitry V. Levin2020-12-311-1/+1
|
* quotactl: add xlat styles supportShankara Pailoor2018-12-241-5/+26
| | | | | | | | | | | | | | | | | | | | * quota.c (print_qcmd): New function. (SYS_FUNC(quotactl)): Use it to print the quotactl command. * tests/quotactl.c (print_dqinfo, print_dqfmt): Handle XLAT_RAW and XLAT_VERBOSE. (QUOTA_STR, QUOTA_ID_STR, QUOTA_STR_INVALID): New macros. (gen_quotacmd, gen_quotaid): New functions. (main): Use them. * tests/quotactl-Xabbrev.c: New file. * tests/quotactl-Xraw.c: Likewise. * tests/quotactl-Xverbose.c: Likewise. * tests/gen_tests.in (quotactl-Xabbrev, quotactl-Xraw, quotactl-Xverbose): New tests. * tests/pure_executables.list: Add quotactl-Xabbrev, quotactl-Xraw, and quotactl-Xverbose. * tests/.gitignore: Likewise. Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
* Change the license of strace to LGPL-2.1-or-laterDmitry V. Levin2018-12-101-21/+1
| | | | | | | | strace is now provided under the terms of the GNU Lesser General Public License version 2.1 or later, see COPYING for more details. strace test suite is now provided under the terms of the GNU General Public License version 2 or later, see tests/COPYING for more details.
* Mpersify decoder of struct xfs_dqstatsZhibin Li2018-07-151-42/+22
| | | | | | | | | * xfs_quota_stat.h: New file. * fetch_struct_xfs_quotastat.c: Likewise. * Makefile.am (strace_SOURCES): Add them. * quota.c: Include xfs_quota_stat.h (struct fs_qfilestat, struct xfs_dqstats): Moved to xfs_quota_stat.h. (decode_cmd_data) <case Q_XGETQSTAT>: Use fetch_struct_quotastat.
* quota: fix disorder of PRINT_FIELD invocationsZhibin Li2018-07-151-2/+2
| | | | | * quota.c (decode_cmd_data) <case Q_XGETQSTAT>: Print fields of struct xfs_dqstats in the structure order.
* Update copyright headersDmitry V. Levin2018-04-051-1/+1
| | | | | Headers updated automatically using maint/update_copyright_years.sh script.
* build: prepare for -Wimplicit-fallthrough=5Dmitry V. Levin2018-03-061-3/+3
| | | | | | | | | | | | | | | | | | | | | * gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro. * block.c (block_ioctl): Use it instead of "fall through" comment. * btrfs.c (btrfs_ioctl): Likewise. * loop.c (loop_ioctl): Likewise. * mtd.c (mtd_ioctl): Likewise. * rtc.c (rtc_ioctl): Likewise. * v4l2.c (v4l2_ioctl): Likewise. * dm.c (dm_decode_values): Likewise. * process.c (SYS_FUNC(ptrace)): Likewise. * quota.c (decode_cmd_data): Likewise. * ucopy.c (umovestr): Likewise. * unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)): Likewise. * term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH. * ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise. * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5. * tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement without implicit fallthrough.
* Update copyright headersEugene Syromyatnikov2017-09-051-0/+1
| | | | | | Headers updated automatically with maint/update_copyright_headers.sh -c
* quota: use PRINT_FIELD_FLAGSDmitry V. Levin2017-07-011-20/+13
| | | | | | * quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t to uint8_t. (decode_cmd_data): Use PRINT_FIELD_FLAGS.
* Unify different generic PRINT_FIELD_* implementationsDmitry V. Levin2017-07-011-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Create a new header print_fields.h and move generic PRINT_FIELD_* macros there. * print_fields.h: New file. * Makefile.am (strace_SOURCES): Add it. * netlink_sock_diag.c: Include "print_fields.h". (PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): Move to print_fields.h file. * quota.c: Include "print_fields.h". (PRINT_FIELD_D): Move to print_fields.h file. (PRINT_FIELD_U, PRINT_FIELD_X): Remove. * statx.c: Include "print_fields.h". (PRINT_FIELD_U): Remove. (SYS_FUNC(statx)): Update PRINT_FIELD_U callers. * tests/quotactl.h: Include "print_fields.h". * tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros. * tests/quotactl.c: Likewise. (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove. * tests/test_nlattr.h: Include "print_fields.h". (PRINT_FIELD_U, PRINT_FIELD_X): Remove. * tests/xstatx.c: Include "print_fields.h". (PRINT_FIELD_U): Remove. (print_stat): Update PRINT_FIELD_U callers. * tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf.
* Fix a few spacing style issuesDmitry V. Levin2017-06-171-10/+5
| | | | Reported by kernel's checkpatch.pl script.
* Automatically replace kernel_(scno|ureg)_t with kernel_ulong_tDmitry V. Levin2016-12-261-1/+1
| | | | | | | | | | | | | Remove temporary types created for transition from long to kernel_ulong_t. Automatically replace kernel_scno_t and kernel_ureg_t with kernel_ulong_t using $ git grep -El 'kernel_(scno|ureg)_t' | xargs sed -ri 's/kernel_(scno|ureg)_t/kernel_ulong_t/g' * kernel_types.h (kernel_scno_t, kernel_ureg_t): Remove. All users updated.
* quota: change address argument type from unsigned long to kernel_ureg_tDmitry V. Levin2016-12-251-1/+1
| | | | | * quota.c (decode_cmd_data): Change the type of data argument from unsigned long to kernel_ureg_t.
* quota: ensure that names of structure fields are printed properlyDmitry V. Levin2016-09-271-96/+109
| | | | | * quota.c (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): New macros. (decode_cmd_data): Use them to print structure fields.
* quota: move Q_QUOTAON handling to subcommand switch statementDmitry V. Levin2016-09-271-8/+6
| | | | | * quota.c (SYS_FUNC(quotactl)): Move handling of Q_QUOTAON subcommand ... (decode_cmd_data): ... here.
* quota: remove legacy subcommand decoding support codeEugene Syromyatnikov2016-09-271-191/+0
| | | | | | | | | | | | | | Support for these quota subcommands by linux kernels has been dropped long time ago (between 2.5.16 and 2.5.17), so lets drop it in order to minimize amount of code which should be subjected to testing and structured conversion. * quota.c (struct v1_dqblk, struct v2_dqblk, struct v2_dqinfo, struct v1_dqstats, struct v2_dqstats): Remove. (decode_cmd_data): Remove handling of Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_V2_GETINFO, Q_V2_SETINFO, Q_V1_GETSTATS, and Q_V2_GETSTATS subcommands. (SYS_FUNC(quotactl)): Remove handling of Q_V1_QUOTAON subcommand.
* quota: add realtime block limits fields to XFS disk quota printing codeEugene Syromyatnikov2016-09-271-0/+4
| | | | | * quota.c (decode_cmd_data): Add printing of d_rtb_hardlimit and d_rtb_softlimit fields to struct xfs_dqblk printing code.
* quota: add packed attribute to struct if_dqblk definitionEugene Syromyatnikov2016-09-271-1/+7
| | | | | | | | Since the only difference between 32-bit and 64-bit environments regarding this structure is its padding, lets just add packed attribute to its definition instead of going full mpers. * quota.c (struct if_dqblk): Add ATTRIBUTE_PACKED.
* quota: Add decoding for Q_XQUOTARM subcommandEugene Syromyatnikov2016-09-271-0/+13
| | | | | * quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand switch.
* quota: add dispatch of SYNC subcommandsEugene Syromyatnikov2016-09-271-0/+2
| | | | | | | | Q_XQUOTASYNC is no-op, but it does not require id/addr arguments anyway. * quota.c (decode_cmd_data): Add Q_SYNC and Q_XQUOTASYNC to subcommand dispatch switch since id/addr arguments for these subcommands are known to be ignored.
* quota: add missing prefixes to struct field namesEugene Syromyatnikov2016-09-271-94/+99
| | | | | * quota.c (decode_cmd_data): Print field names in accordance with their definition.
* quota: fix indentation inside subcommand dispatching switch statementEugene Syromyatnikov2016-09-271-324/+324
|
* quota: avoid printing id argument for those commands that ignore itEugene Syromyatnikov2016-09-271-17/+106
| | | | | | | | | | | | | | As id argument is not used for Q_QUOTAOFF, Q_GETFMT, Q_V2_GETINFO, Q_GETINFO, Q_V2_SEETINFO, Q_SETINFO, Q_SYNC, Q_XQUOTAON, Q_XQUOTAOFF, Q_XQUOTARM, Q_XGETQSTAT, Q_XGETQSTATV, Q_XQUOTASYNC, Q_V1_GETSTATS, and Q_V2_GETSTATS subcommands, do not print it for these subcommands. * quota.c (decode_cmd_data): Add id argument parameter, add printing of id argument for Q_GETQUOTA, Q_SETQUOTA, Q_GETNEXTQUOTA, Q_V1_GETQUOTA, Q_V1_SETQUOTA, Q_V2_GETQUOTA, Q_V2_SETQUOTA, Q_XGETQUOTA, Q_XGETNEXTQUOTA, Q_XSETQLIM, and unknown subcommands. (SYS_FUNC(quotactl)): Remove printing of id argument, pass it to decode_cmd_data.
* quota: use printuid for id parameter printingEugene Syromyatnikov2016-09-271-1/+2
| | | | | | * quota.c (SYS_FUNC(quotactl)): Since id call argument is used for user/group/project ID which all have special semantics for -1, print it the same way as UIDs are printed.
* quota: display quota subcommand as a macroEugene Syromyatnikov2016-09-271-2/+3
| | | | | * quota.c (SYS_FUNC(quotactl)): Replace disjunction of two xlat values (which also lacks shift of the left part) with QCMD macro call.
* Fix printing of invalid struct xfs_dqblk.d_flagsDmitry V. Levin2016-05-161-1/+1
| | | | | | * quota.c (decode_cmd_data): Explicitly cast struct xfs_dqblk.d_flags to uint8_t to avoid potential sign-extension bug when printing invalid struct xfs_dqblk.d_flags.
* quotactl: add decoding of Q_GETNEXTQUOTA and Q_XGETNEXTQUOTADmitry V. Levin2016-03-291-0/+39
| | | | | * quota.c (if_nextdqblk): New structure. (decode_cmd_data): Handle Q_GETNEXTQUOTA and Q_XGETNEXTQUOTA.
* quotactl: add Q_XGETQSTATV command decodingDmitry V. Levin2016-01-191-0/+54
| | | | | * quota.c (fs_qfilestatv, fs_quota_statv): New structures. (decode_cmd_data): Handle Q_XGETQSTATV case.
* quotactl: add decoding of if_dqinfo.dqi_flags constantsDmitry V. Levin2016-01-191-4/+7
| | | | | | * xlat/if_dqinfo_flags.in: New file. * quota.c: Include "xlat/if_dqinfo_flags.h". (decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags.
* quotactl: consistenly decode all write and unknown commands on enteringDmitry V. Levin2016-01-191-23/+25
| | | | | | | | | | | * quota.c (decode_cmd_data): Change return type to int. Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA, Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS, Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED for any other command. (SYS_FUNC(quotactl)): On entering, print third argument of any command. For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data and forward its return value.
* quotactl: fix Q_QUOTAON command decodingDmitry V. Levin2016-01-191-2/+4
| | | | * quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path.
* quotactl: print third argument as unsigned intDmitry V. Levin2016-01-191-8/+1
| | | | | * quota.c (SYS_FUNC(quotactl)): Consistently print the third argument using "%u" format.
* quotactl: fix Q_XQUOTAOFF command decodingDmitry V. Levin2016-01-191-0/+1
| | | | * quota.c (decode_cmd_data): Print xfs quota flags argument.
* quotactl: fix Q_GETFMT and Q_XQUOTAON commands decodingDmitry V. Levin2016-01-191-4/+4
| | | | | | * quota.c (decode_cmd_data): As quota format value and xfs quota flags are in-memory constants, print it like an array of one element instead of a structure.
* Replace u_int{8,16,32,64} with uint{8,16,32,64}Dmitry V. Levin2016-01-191-84/+84
| | | | | * util.c: Replace u_int{32,64} with uint{32,64}. * quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}.
* Move definitions of quotactl constants to xlat filesDmitry V. Levin2016-01-191-77/+3
| | | | | | | | | | * quota.c (Q_*): Move to xlat/quotacmds.in. (USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in. (QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in. (XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in. (XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in. (QIF_*): Move to xlat/if_dqblk_valid.in. (IIF_*): Move to xlat/if_dqinfo_valid.in.
* Enhance quotactl decodingDmitry V. Levin2015-07-181-87/+27
| | | | | | * quota.c (decode_cmd_data): Use umove_or_printaddr. (sys_quotactl): Do not disable the parser in verbose mode. Decode all "set" commands on entering syscall.
* Declare syscall parsers using SYS_FUNC macroDmitry V. Levin2015-04-071-2/+1
| | | | | | | | | | | | | | Introduce SYS_FUNC macro to declare and define all syscall parsers. * Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h. (sys_func.h): New rule. * defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros. * linux/syscall.h: Include "sys_func.h". [NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers. Remove other declarations. * linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs and osf_fstatfs syscall parsers. * *.c: Use SYS_FUNC to define syscall parsers.
* Compress blank linesDmitry V. Levin2014-05-301-1/+0
| | | | Suppress empty lines left after automated xlat conversion.
* Generate xlat/*.in filesDmitry V. Levin2014-05-301-77/+7
| | | | | Automatically convert xlat structures from *.c files to xlat/*.in files using "./generate_xlat_in.sh *.c" command.
* Use XLAT_END macroDmitry V. Levin2014-02-051-7/+7
| | | | | Automatically update all xlat structures using the following sed regexp: s/^[[:space:]]*{[[:space:]]*0[[:space:]]*,[[:space:]]*NULL[[:space:]]*,\?[[:space:]]*}[[:space:]]*,\?[[:space:]]*/\tXLAT_END/