On Thu, Jul 09, 2020 at 04:26:57PM -0500, Bill O'Donnell wrote: > Since grace periods are now supported for three quota types (ugp), > modify xfs_quota state command to report times for all three. This looks like it'll clash with the patch that Darrick just sent.. > + if (type & XFS_USER_QUOTA) { > + if (xfsquotactl(XFS_GETQSTATV, dev, XFS_USER_QUOTA, > + 0, (void *)&sv) < 0) { > + if (xfsquotactl(XFS_GETQSTAT, dev, XFS_USER_QUOTA, > + 0, (void *)&s) < 0) { > + if (flags & VERBOSE_FLAG) > + fprintf(fp, > + _("%s quota are not enabled on %s\n"), > + type_to_string(XFS_USER_QUOTA), > + dev); > + return; > + } > + state_stat_to_statv(&s, &sv); > } > > state_qfilestat(fp, mount, XFS_USER_QUOTA, &sv.qs_uquota, > sv.qs_flags & XFS_QUOTA_UDQ_ACCT, > sv.qs_flags & XFS_QUOTA_UDQ_ENFD); > + state_timelimit(fp, XFS_BLOCK_QUOTA, sv.qs_btimelimit); > + state_timelimit(fp, XFS_INODE_QUOTA, sv.qs_itimelimit); > + state_timelimit(fp, XFS_RTBLOCK_QUOTA, sv.qs_rtbtimelimit); > + } Any chance we could factor this repititive code into a helper?