@@ -36,39 +36,50 @@ printpath(
int c;
if (index == 0) {
- printf(_("%sFilesystem Pathname\n"),
- number ? _(" ") : "");
+ if (foreign_allowed)
+ printf(_("%s Filesystem Pathname\n"),
+ number ? _(" ") : "");
+ else
+ printf(_("%sFilesystem Pathname\n"),
+ number ? _(" ") : "");
}
if (number) {
printf(_("%c%03d%c "), braces? '[':' ', index, braces? ']':' ');
}
- printf("%s ", (path->fs_flags & FS_FOREIGN) ? "(F)" : " ");
- printf(_("%-19s %s"), path->fs_dir, path->fs_name);
- if (path->fs_flags & FS_PROJECT_PATH) {
- prj = getprprid(path->fs_prid);
- printf(_(" (project %u"), path->fs_prid);
- if (prj)
- printf(_(", %s"), prj->pr_name);
- printf(")");
- } else if (xfsquotactl(XFS_GETQSTAT, path->fs_name, 0, 0,
- (void *)&qstat) == 0 && qstat.qs_flags) {
- c = 0;
- printf(" (");
- if (qstat.qs_flags & XFS_QUOTA_UDQ_ENFD)
- c = printf("uquota");
- else if (qstat.qs_flags & XFS_QUOTA_UDQ_ACCT)
- c = printf("uqnoenforce");
- if (qstat.qs_flags & XFS_QUOTA_GDQ_ENFD)
- c = printf("%sgquota", c ? ", " : "");
- else if (qstat.qs_flags & XFS_QUOTA_GDQ_ACCT)
- c = printf("%sgqnoenforce", c ? ", " : "");
- if (qstat.qs_flags & XFS_QUOTA_PDQ_ENFD)
- printf("%spquota", c ? ", " : "");
- else if (qstat.qs_flags & XFS_QUOTA_PDQ_ACCT)
- printf("%spqnoenforce", c ? ", " : "");
- printf(")");
+ if (!((path->fs_flags & FS_FOREIGN) && !foreign_allowed)) {
+ printf("%s", (path->fs_flags & FS_FOREIGN) ? "(F) " : "");
+ if (path->fs_flags & FS_FOREIGN)
+ printf(_("%-19s %s"), path->fs_dir, path->fs_name);
+ else if (foreign_allowed)
+ printf(_(" %-19s %s"), path->fs_dir, path->fs_name);
+ else
+ printf(_("%-19s %s"), path->fs_dir, path->fs_name);
+ if (path->fs_flags & FS_PROJECT_PATH) {
+ prj = getprprid(path->fs_prid);
+ printf(_(" (project %u"), path->fs_prid);
+ if (prj)
+ printf(_(", %s"), prj->pr_name);
+ printf(")");
+ } else if (xfsquotactl(XFS_GETQSTAT, path->fs_name, 0, 0,
+ (void *)&qstat) == 0 && qstat.qs_flags) {
+ c = 0;
+ printf(" (");
+ if (qstat.qs_flags & XFS_QUOTA_UDQ_ENFD)
+ c = printf("uquota");
+ else if (qstat.qs_flags & XFS_QUOTA_UDQ_ACCT)
+ c = printf("uqnoenforce");
+ if (qstat.qs_flags & XFS_QUOTA_GDQ_ENFD)
+ c = printf("%sgquota", c ? ", " : "");
+ else if (qstat.qs_flags & XFS_QUOTA_GDQ_ACCT)
+ c = printf("%sgqnoenforce", c ? ", " : "");
+ if (qstat.qs_flags & XFS_QUOTA_PDQ_ENFD)
+ printf("%spquota", c ? ", " : "");
+ else if (qstat.qs_flags & XFS_QUOTA_PDQ_ACCT)
+ printf("%spqnoenforce", c ? ", " : "");
+ printf(")");
+ }
+ printf("\n");
}
- printf("\n");
}
static int
This patch adjusts the formatting of the xfs_quota print and path outputs, in order to maintain reverse compatability: when -f flag isn't used, need to keep the output same as in previous version. Signed-off-by: Bill O'Donnell <billodo@redhat.com> --- quota/path.c | 67 +++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 28 deletions(-)