Whamcloud - gitweb
LU-16831 lod: replace (__u16)-1 with LOV_ALL_STRIPES 55/52055/3
authorJian Yu <yujian@whamcloud.com>
Wed, 23 Aug 2023 19:05:22 +0000 (12:05 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 6 Sep 2023 06:22:40 +0000 (06:22 +0000)
This patch replaces "(__u16)-1" with constant LOV_ALL_STRIPES
and replaces "(__u64)-1" with OBD_OBJECT_EOF.

Test-Parameters: trivial

Change-Id: I2345c5e67da20328e7173c9add8da27015df9d13
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52055
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Zhenyu Xu <bobijam@hotmail.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/lod/lod_object.c
lustre/lod/lod_qos.c

index 400a99d..1728218 100644 (file)
@@ -1255,7 +1255,7 @@ struct lov_mds_md_v3 {            /* LOV EA mds/wire data (little-endian) */
 
 static inline __u32 lov_mds_md_size(__u16 stripes, __u32 lmm_magic)
 {
-       if (stripes == (__u16)-1)
+       if (stripes == LOV_ALL_STRIPES)
                stripes = 0;
 
        if (lmm_magic == LOV_MAGIC_V3)
index 3e0e3ba..30ded1f 100644 (file)
@@ -1023,7 +1023,7 @@ struct lov_comp_md_v1 {
 
 static inline __u32 lov_user_md_size(__u16 stripes, __u32 lmm_magic)
 {
-       if (stripes == (__u16)-1)
+       if (stripes == LOV_ALL_STRIPES)
                stripes = 0;
 
        if (lmm_magic == LOV_USER_MAGIC_V1)
index fff20a9..feaa690 100644 (file)
@@ -2654,7 +2654,7 @@ __u16 lod_comp_entry_stripe_count(struct lod_object *lo, int comp_idx,
        entry = &lo->ldo_comp_entries[comp_idx];
        if (lod_comp_inited(entry))
                return entry->llc_stripe_count;
-       if (entry->llc_stripe_count == (__u16)-1)
+       if (entry->llc_stripe_count == LOV_ALL_STRIPES)
                return lod_get_stripe_count_plain(lod, lo,
                                                  entry->llc_stripe_count,
                                                  entry->llc_pattern &
@@ -2799,8 +2799,8 @@ static int lod_declare_layout_add(const struct lu_env *env,
                    (lod_comp_inited(lod_comp) ||
                     lod_comp->llc_extent.e_start <
                     lod_comp->llc_extent.e_end) &&
-                   lod_comp->llc_stripe_count != (__u16)-1 &&
-                   ext->e_end != (__u64)-1 &&
+                   lod_comp->llc_stripe_count != LOV_ALL_STRIPES &&
+                   ext->e_end != OBD_OBJECT_EOF &&
                    (__u64)(lod_comp->llc_stripe_count *
                            lod_comp->llc_stripe_size) >
                    (ext->e_end - ext->e_start))
index 95886cd..03cb117 100644 (file)
@@ -2210,8 +2210,8 @@ int lod_use_defined_striping(const struct lu_env *env,
                    (lod_comp_inited(lod_comp) ||
                     lod_comp->llc_extent.e_start <
                     lod_comp->llc_extent.e_end) &&
-                   lod_comp->llc_stripe_count != (__u16)-1 &&
-                   lod_comp->llc_extent.e_end != (__u64)-1 &&
+                   lod_comp->llc_stripe_count != LOV_ALL_STRIPES &&
+                   lod_comp->llc_extent.e_end != OBD_OBJECT_EOF &&
                    (__u64)lod_comp->llc_stripe_count *
                           lod_comp->llc_stripe_size >
                    (lod_comp->llc_extent.e_end - lod_comp->llc_extent.e_start))
@@ -2511,11 +2511,11 @@ int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
                 */
                if (lo->ldo_is_composite &&
                    !(lod_comp->llc_flags & LCME_FL_EXTENSION) &&
-                   lod_comp->llc_stripe_count != (__u16)-1 &&
+                   lod_comp->llc_stripe_count != LOV_ALL_STRIPES &&
                    (lod_comp_inited(lod_comp) ||
                     lod_comp->llc_extent.e_start <
                     lod_comp->llc_extent.e_end) &&
-                   lod_comp->llc_extent.e_end != (__u64)-1 &&
+                   lod_comp->llc_extent.e_end != OBD_OBJECT_EOF &&
                    lod_comp->llc_stripe_count * lod_comp->llc_stripe_size >
                    (lod_comp->llc_extent.e_end - lod_comp->llc_extent.e_start))
                        lod_comp->llc_stripe_count =