* [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags
@ 2017-11-17 19:54 jeffm
2017-11-17 19:54 ` [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional jeffm
2017-11-20 17:48 ` [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags Eric Sandeen
0 siblings, 2 replies; 6+ messages in thread
From: jeffm @ 2017-11-17 19:54 UTC (permalink / raw)
To: linux-xfs; +Cc: Jeff Mahoney
From: Jeff Mahoney <jeffm@suse.com>
The field name is f_flags.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
io/stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io/stat.c b/io/stat.c
index 060ff833..6ab10abf 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -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;
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
2017-11-17 19:54 [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags jeffm
@ 2017-11-17 19:54 ` jeffm
2017-11-20 17:54 ` Eric Sandeen
2017-11-20 17:48 ` [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags Eric Sandeen
1 sibling, 1 reply; 6+ messages in thread
From: jeffm @ 2017-11-17 19:54 UTC (permalink / raw)
To: linux-xfs; +Cc: Jeff Mahoney
From: Jeff Mahoney <jeffm@suse.com>
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.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
configure.ac | 1 +
include/builddefs.in | 1 +
io/stat.c | 2 ++
m4/package_libcdev.m4 | 14 ++++++++++++++
4 files changed, 18 insertions(+)
diff --git a/configure.ac b/configure.ac
index 4161c3b4..939d802b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/include/builddefs.in b/include/builddefs.in
index ec630bd9..13756d79 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -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
diff --git a/io/stat.c b/io/stat.c
index 6ab10abf..1ca5b0d6 100644
--- a/io/stat.c
+++ b/io/stat.c
@@ -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;
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index fa5b6397..bc395acd 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -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)
+ ])
--
2.14.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags
2017-11-17 19:54 [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags jeffm
2017-11-17 19:54 ` [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional jeffm
@ 2017-11-20 17:48 ` Eric Sandeen
1 sibling, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2017-11-20 17:48 UTC (permalink / raw)
To: jeffm, linux-xfs
On 11/17/17 1:54 PM, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
>
> The field name is f_flags.
>
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
> ---
> io/stat.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/io/stat.c b/io/stat.c
> index 060ff833..6ab10abf 100644
> --- a/io/stat.c
> +++ b/io/stat.c
> @@ -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;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
2017-11-17 19:54 ` [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional jeffm
@ 2017-11-20 17:54 ` Eric Sandeen
2017-11-20 18:10 ` Eric Sandeen
0 siblings, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2017-11-20 17:54 UTC (permalink / raw)
To: jeffm, linux-xfs
On 11/17/17 1:54 PM, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
>
> 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 <sandeen@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
2017-11-20 17:54 ` Eric Sandeen
@ 2017-11-20 18:10 ` Eric Sandeen
2017-11-20 18:13 ` Jeff Mahoney
0 siblings, 1 reply; 6+ messages in thread
From: Eric Sandeen @ 2017-11-20 18:10 UTC (permalink / raw)
To: jeffm, linux-xfs
On 11/20/17 11:54 AM, Eric Sandeen wrote:
>
>
> On 11/17/17 1:54 PM, jeffm@suse.com wrote:
>> From: Jeff Mahoney <jeffm@suse.com>
>>
>> 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 <sandeen@redhat.com>
Oops, but not tested-by! This also needs:
diff --git a/io/Makefile b/io/Makefile
index 050d6bd..6725936 100644
--- a/io/Makefile
+++ b/io/Makefile
@@ -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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional
2017-11-20 18:10 ` Eric Sandeen
@ 2017-11-20 18:13 ` Jeff Mahoney
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Mahoney @ 2017-11-20 18:13 UTC (permalink / raw)
To: Eric Sandeen, linux-xfs
[-- Attachment #1.1: Type: text/plain, Size: 1046 bytes --]
On 11/20/17 1:10 PM, Eric Sandeen wrote:
>
>
> On 11/20/17 11:54 AM, Eric Sandeen wrote:
>>
>>
>> On 11/17/17 1:54 PM, jeffm@suse.com wrote:
>>> From: Jeff Mahoney <jeffm@suse.com>
>>>
>>> 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 <sandeen@redhat.com>
>
> Oops, but not tested-by! This also needs:
>
> diff --git a/io/Makefile b/io/Makefile
> index 050d6bd..6725936 100644
> --- a/io/Makefile
> +++ b/io/Makefile
> @@ -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.
Ah, right. My build tests all succeeded because it was just skipping
f_flags.
Thanks,
-Jeff
--
Jeff Mahoney
SUSE Labs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-11-20 18:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 19:54 [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags jeffm
2017-11-17 19:54 ` [PATCH 2/2] xfs_io: stat: treat statfs.f_flags as optional jeffm
2017-11-20 17:54 ` Eric Sandeen
2017-11-20 18:10 ` Eric Sandeen
2017-11-20 18:13 ` Jeff Mahoney
2017-11-20 17:48 ` [PATCH 1/2] xfs_io: stat: fix typo in statfs->f_flags Eric Sandeen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).