0001-fstrim-cleanup-uncludes.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 43abda66869e749044c6c4fd1d106d7df9484aca Mon Sep 17 00:00:00 2001
  2. From: Karel Zak <kzak@redhat.com>
  3. Date: Thu, 22 Mar 2018 13:17:10 +0100
  4. Subject: fstrim: cleanup includes
  5. * HAVE_SYS_FS_H is incorrect (should be HAVE_LINUX_FS_H)
  6. * linux/fs.h cannot be included together with sys/mount.h as the both
  7. files define MS_* constants. The libmount.h includes sys/mount.h now.
  8. Signed-off-by: Karel Zak <kzak@redhat.com>
  9. ---
  10. sys-utils/fstrim.c | 8 ++++----
  11. 1 file changed, 4 insertions(+), 4 deletions(-)
  12. diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
  13. index ca8cf256d..53ac594c0 100644
  14. --- a/sys-utils/fstrim.c
  15. +++ b/sys-utils/fstrim.c
  16. @@ -36,10 +36,6 @@
  17. #include <sys/ioctl.h>
  18. #include <sys/stat.h>
  19. -#ifdef HAVE_SYS_FS_H
  20. -# include <linux/fs.h>
  21. -#endif
  22. -
  23. #include "nls.h"
  24. #include "strutils.h"
  25. #include "c.h"
  26. @@ -49,6 +45,10 @@
  27. #include <libmount.h>
  28. +
  29. +/* We cannot include linux/fs.h due to MS_* constants collision with
  30. + * sys/mount.h (and libmount.h)
  31. + */
  32. #ifndef FITRIM
  33. struct fstrim_range {
  34. uint64_t start;