Whamcloud - gitweb
LU-11631 mdd: migrate symlink for cross-MDT rename
[fs/lustre-release.git] / lustre / tests / statx.c
index 80bc295..a3fbbeb 100644 (file)
@@ -73,6 +73,11 @@ static bool o_quiet;
 
 #ifdef __NR_statx
 #ifndef HAVE_STATX
+
+#define AT_STATX_SYNC_TYPE     0x6000
+#define AT_STATX_FORCE_SYNC    0x2000
+#define AT_STATX_DONT_SYNC     0x4000
+
 static __attribute__((unused))
 ssize_t statx(int dfd, const char *filename, int flags,
              unsigned int mask, struct statx *buffer)
@@ -154,9 +159,10 @@ static char const printf_flags[] = "'-+ #0I";
 static char const fmt_terse_fs[] = "%n %i %l %t %s %S %b %f %a %c %d\n";
 static char const fmt_terse_regular[] = "%n %s %b %f %u %g %D %i %h %t %T"
                                        " %X %Y %Z %W %o\n";
+#ifdef HAVE_SELINUX
 static char const fmt_terse_selinux[] = "%n %s %b %f %u %g %D %i %h %t %T"
                                        " %X %Y %Z %W %o %C\n";
-
+#endif
 static char *format;
 
 /* Whether to follow symbolic links;  True for --dereference (-L).  */
@@ -227,7 +233,7 @@ void usage(char *prog)
               "\t%%n   file name\n"
               "\t%%N   quoted file name with dereference if symbolic link\n"
               "\t%%o   optimal I/O transfer size hint\n"
-              "\t%%q   Mask to show what's supported in stx_attributes\n"
+              "\t%%p   Mask to show what's supported in stx_attributes\n"
               "\t%%r   Flags conveying information about the file: "
               "stx_attributes\n"
               "\t%%s   total size, in bytes\n"
@@ -920,8 +926,10 @@ static int out_file_context(char *pformat, size_t prefix_len,
 
        strcpy(pformat + prefix_len, "s");
        printf(pformat, (scontext ? scontext : "?"));
+#ifdef HAVE_SELINUX
        if (scontext)
                freecon(scontext);
+#endif
        return rc;
 }
 
@@ -1286,6 +1294,7 @@ static char *default_format(bool fs, bool terse, bool device)
 ");
                        free(temp);
 
+#ifdef HAVE_SELINUX
                        if (is_selinux_enabled() > 0) {
                                temp = format;
                                /* TRANSLATORS: This string uses format
@@ -1296,7 +1305,7 @@ static char *default_format(bool fs, bool terse, bool device)
                                                   "Context: %C\n");
                                free(temp);
                        }
-
+#endif
                        temp = format;
                        /* TRANSLATORS: This string uses format specifiers from
                         * 'stat --help' without --file-system, and NOT from