xfs_io: stat: fix typo in statfs->f_flags
PATCH 1/2 xfs_io: stat: fix typo in statfs->f_flags
From: Jeff Mahoney <[email protected]>
The field name is f_flags.
--- io/stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io/stat.c +1 -1
@@ -199,7 +199,7 @@ statfs_f(printf (_ ("statfs.f_bavail = %lld\n" ), (long long ) st.f_bavail);printf (_ ("statfs.f_files = %lld\n" ), (long long ) st.f_files);printf (_ ("statfs.f_ffree = %lld\n" ), (long long ) st.f_ffree); -printf (_ ("statfs.f_fflags = 0x%llx\n" ), (long long ) st.f_flags); +printf (_ ("statfs.f_flags = 0x%llx\n" ), (long long ) st.f_flags); }if (file->flags &IO_FOREIGN )return 0 ;
Signature · 1 line
2.14.2
PATCH 2/2 xfs_io: stat: treat statfs.f_flags as optional
From: Jeff Mahoney <[email protected]>
Kernels prior to 2.6.36 didn't contain statfs.f_flags. Distros with initial releases with kernels prior to this may not have updated headers with this member. Only attempt to print it if we have the header with the member defined.
--- configure.ac | 1 + include/builddefs.in | 1 + io/stat.c | 2 ++ m4/package_libcdev.m4 | 14 ++++++++++++++ 4 files changed, 18 insertions(+)
configure.ac +1 -0
@@ -143,6 +143,7 @@ AC_HAVE_FSETXATTR AC_HAVE_MREMAP AC_NEED_INTERNAL_FSXATTR AC_HAVE_GETFSMAP +AC_HAVE_STATFS_FLAGS if test "$enable_blkid" = yes; then AC_HAVE_BLKID_TOPO
include/builddefs.in +1 -0
@@ -113,6 +113,7 @@ HAVE_FSETXATTR = @have_fsetxattr@ HAVE_MREMAP = @have_mremap@ NEED_INTERNAL_FSXATTR = @need_internal_fsxattr@ HAVE_GETFSMAP = @have_getfsmap@ +HAVE_STATFS_FLAGS = @have_statfs_flags@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall # -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
io/stat.c +2 -0
@@ -199,7 +199,9 @@ statfs_f(printf (_ ("statfs.f_bavail = %lld\n" ), (long long ) st.f_bavail);printf (_ ("statfs.f_files = %lld\n" ), (long long ) st.f_files);printf (_ ("statfs.f_ffree = %lld\n" ), (long long ) st.f_ffree); +#ifdef HAVE_STATFS_FLAGS printf (_ ("statfs.f_flags = 0x%llx\n" ), (long long ) st.f_flags); +#endif }if (file->flags &IO_FOREIGN )return 0 ;
m4/package_libcdev.m4 +14 -0
@@ -297,3 +297,17 @@ AC_DEFUN([AC_HAVE_GETFSMAP], AC_MSG_RESULT(no)) AC_SUBST(have_getfsmap) ]) + +AC_DEFUN([AC_HAVE_STATFS_FLAGS], + [ + AC_CHECK_TYPE(struct statfs, + [ + AC_CHECK_MEMBER(struct statfs.f_flags, + have_statfs_flags=yes,, + [#include <sys/vfs.h>] + ) + ],, + [#include <sys/vfs.h>] + ) + AC_SUBST(have_statfs_flags) + ])
Signature · 1 line
2.14.2
Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
Quoted 5 lines · On 11/17/17 1:54 PM, [email protected] wrote:
From: Jeff Mahoney <[email protected]>
Kernels prior to 2.6.36 didn't contain statfs.f_flags. Distros with initial releases with kernels prior to this may not have updated headers with this member.
You all are brave ;)
Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
Quoted 5 lines · Eric Sandeen
Quoted 2 lines · On 11/17/17 1:54 PM, [email protected] wrote:
From: Jeff Mahoney <[email protected]>
Quoted 7 lines
Quoted 3 lines
Kernels prior to 2.6.36 didn't contain statfs.f_flags. Distros with initial releases with kernels prior to this may not have updated headers with this member.
You all are brave ;)
Reviewed-by Eric Sandeen <[email protected]>
Oops, but not tested-by! This also needs:
io/Makefile +4 -0
@@ -110,6 +110,10 @@ ifeq ($(PKG_PLATFORM),linux) CFILES += fsmap.c endif +ifeq ($(HAVE_STATFS_FLAGS),yes) +LCFLAGS += -DHAVE_STATFS_FLAGS +endif + default: depend $(LTCOMMAND) include $(BUILDRULES)
but I can add it on the way in.
-Eric
Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
Quoted 35 lines · Eric Sandeen
Quoted 5 lines · Eric Sandeen
Quoted 2 lines · On 11/17/17 1:54 PM, [email protected] wrote:
From: Jeff Mahoney <[email protected]>
Quoted 7 lines
Quoted 3 lines
Kernels prior to 2.6.36 didn't contain statfs.f_flags. Distros with initial releases with kernels prior to this may not have updated headers with this member.
You all are brave ;)
Reviewed-by Eric Sandeen <[email protected]>Oops, but not tested-by! This also needs:
io/Makefile +4
-0@@ -110,6 +110,10 @@ ifeq ($(PKG_PLATFORM),linux) CFILES += fsmap.c endif +ifeq ($(HAVE_STATFS_FLAGS),yes) +LCFLAGS += -DHAVE_STATFS_FLAGS +endif + default: depend $(LTCOMMAND) include $(BUILDRULES)
Quoted 1 line
but I can add it on the way in.
Ah, right. My build tests all succeeded because it was just skipping f_flags.
Thanks,
-Jeff
Signature · 2 lines
Jeff Mahoney SUSE Labs
Quoted 5 lines · On 11/17/17 1:54 PM, [email protected] wrote:
From: Jeff Mahoney <[email protected]>
The field name is
f_flags.Signed-off-by Jeff Mahoney <[email protected]>
Quoted 18 lines
--- io/stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)io/stat.c +1
-1@@ -199,7 +199,7 @@ statfs_f(printf (_ ("statfs.f_bavail = %lld\n" ), (long long ) st.f_bavail);printf (_ ("statfs.f_files = %lld\n" ), (long long ) st.f_files);printf (_ ("statfs.f_ffree = %lld\n" ), (long long ) st.f_ffree); -printf (_ ("statfs.f_fflags = 0x%llx\n" ), (long long ) st.f_flags); +printf (_ ("statfs.f_flags = 0x%llx\n" ), (long long ) st.f_flags); }if (file->flags &IO_FOREIGN )return 0 ;