logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Move-definition-of-blk_zone_v2.patch (2899B)


  1. From 8aee18d96218ce523e705e0bb43b8b67909f83aa Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Fri, 4 Sep 2020 22:33:09 -0700
  4. Subject: [PATCH] Move definition of blk_zone_v2
  5. Otherwise, the definitions of blk_zone_type_str and blk_zone_cond_str
  6. still refer to the original struct blk_zone.
  7. ---
  8. include/f2fs_fs.h | 56 +++++++++++++++++++++++------------------------
  9. 1 file changed, 28 insertions(+), 28 deletions(-)
  10. diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
  11. index b5bda13..4d99fb7 100644
  12. --- a/include/f2fs_fs.h
  13. +++ b/include/f2fs_fs.h
  14. @@ -1288,6 +1288,34 @@ static inline int get_inline_xattr_addrs(struct f2fs_inode *inode)
  15. #define blk_zone_seq_pref(z) ((z)->type == BLK_ZONE_TYPE_SEQWRITE_PREF)
  16. #define blk_zone_seq(z) (blk_zone_seq_req(z) || blk_zone_seq_pref(z))
  17. +/*
  18. + * Handle kernel zone capacity support
  19. + */
  20. +#ifndef HAVE_BLK_ZONE_REP_V2
  21. +#define BLK_ZONE_REP_CAPACITY (1 << 0)
  22. +struct blk_zone_v2 {
  23. + __u64 start; /* Zone start sector */
  24. + __u64 len; /* Zone length in number of sectors */
  25. + __u64 wp; /* Zone write pointer position */
  26. + __u8 type; /* Zone type */
  27. + __u8 cond; /* Zone condition */
  28. + __u8 non_seq; /* Non-sequential write resources active */
  29. + __u8 reset; /* Reset write pointer recommended */
  30. + __u8 resv[4];
  31. + __u64 capacity; /* Zone capacity in number of sectors */
  32. + __u8 reserved[24];
  33. +};
  34. +#define blk_zone blk_zone_v2
  35. +
  36. +struct blk_zone_report_v2 {
  37. + __u64 sector;
  38. + __u32 nr_zones;
  39. + __u32 flags;
  40. +struct blk_zone zones[0];
  41. +};
  42. +#define blk_zone_report blk_zone_report_v2
  43. +#endif /* HAVE_BLK_ZONE_REP_V2 */
  44. +
  45. static inline const char *
  46. blk_zone_type_str(struct blk_zone *blkz)
  47. {
  48. @@ -1328,34 +1356,6 @@ blk_zone_cond_str(struct blk_zone *blkz)
  49. return "Unknown-cond";
  50. }
  51. -/*
  52. - * Handle kernel zone capacity support
  53. - */
  54. -#ifndef HAVE_BLK_ZONE_REP_V2
  55. -#define BLK_ZONE_REP_CAPACITY (1 << 0)
  56. -struct blk_zone_v2 {
  57. - __u64 start; /* Zone start sector */
  58. - __u64 len; /* Zone length in number of sectors */
  59. - __u64 wp; /* Zone write pointer position */
  60. - __u8 type; /* Zone type */
  61. - __u8 cond; /* Zone condition */
  62. - __u8 non_seq; /* Non-sequential write resources active */
  63. - __u8 reset; /* Reset write pointer recommended */
  64. - __u8 resv[4];
  65. - __u64 capacity; /* Zone capacity in number of sectors */
  66. - __u8 reserved[24];
  67. -};
  68. -#define blk_zone blk_zone_v2
  69. -
  70. -struct blk_zone_report_v2 {
  71. - __u64 sector;
  72. - __u32 nr_zones;
  73. - __u32 flags;
  74. -struct blk_zone zones[0];
  75. -};
  76. -#define blk_zone_report blk_zone_report_v2
  77. -#endif /* HAVE_BLK_ZONE_REP_V2 */
  78. -
  79. #define blk_zone_empty(z) (blk_zone_cond(z) == BLK_ZONE_COND_EMPTY)
  80. #define blk_zone_sector(z) (z)->start
  81. #define blk_zone_length(z) (z)->len
  82. --
  83. 2.28.0