From: Andreas Dilger Date: Mon, 30 Oct 2017 16:19:43 +0000 (-0400) Subject: LU-7813 lov: rename LOV_MAGIC_V*_DEF to *_DEFINED X-Git-Tag: 2.10.55~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=5b663ca0cb31517e307913873ca5df4676e5654d LU-7813 lov: rename LOV_MAGIC_V*_DEF to *_DEFINED Rename LOV_MAGIC_V1_DEF to LOV_MAGIC_V1_DEFINED so that it is not confused with "_DEFAULT" as one might expect. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Idb98fc24974a105077bf75bb122006fad34d69e2 Reviewed-on: https://review.whamcloud.com/18888 Tested-by: Jenkins Reviewed-by: Steve Guminski Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index b8763df..8008aee 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -1049,10 +1049,10 @@ enum obdo_flags { * those *_DEF magics are only used on server side internally, they * won't be put on wire or disk. */ -#define LOV_MAGIC_DEF 0x10000000 -#define LOV_MAGIC_V1_DEF (LOV_MAGIC_DEF | LOV_MAGIC_V1) -#define LOV_MAGIC_V3_DEF (LOV_MAGIC_DEF | LOV_MAGIC_V3) -#define LOV_MAGIC_COMP_V1_DEF (LOV_MAGIC_DEF | LOV_MAGIC_COMP_V1) +#define LOV_MAGIC_DEFINED 0x10000000 +#define LOV_MAGIC_V1_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_V1) +#define LOV_MAGIC_V3_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_V3) +#define LOV_MAGIC_COMP_V1_DEFINED (LOV_MAGIC_DEFINED | LOV_MAGIC_COMP_V1) #define lov_pattern(pattern) (pattern & ~LOV_PATTERN_F_MASK) #define lov_pattern_flags(pattern) (pattern & LOV_PATTERN_F_MASK) diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 08d5ce7..ff2eda4 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -1511,7 +1511,7 @@ static int lod_verify_v1v3(struct lod_device *d, const struct lu_buf *buf, GOTO(out, rc = -EINVAL); } - magic = le32_to_cpu(lum->lmm_magic) & ~LOV_MAGIC_DEF; + magic = le32_to_cpu(lum->lmm_magic) & ~LOV_MAGIC_DEFINED; if (magic != LOV_USER_MAGIC_V1 && magic != LOV_USER_MAGIC_V3 && magic != LOV_USER_MAGIC_SPECIFIC) { @@ -1637,7 +1637,7 @@ int lod_verify_striping(struct lod_device *d, const struct lu_buf *buf, RETURN(-EINVAL); } - magic = le32_to_cpu(lum->lmm_magic) & ~LOV_MAGIC_DEF; + magic = le32_to_cpu(lum->lmm_magic) & ~LOV_MAGIC_DEFINED; if (magic != LOV_USER_MAGIC_V1 && magic != LOV_USER_MAGIC_V3 && magic != LOV_USER_MAGIC_SPECIFIC && diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index c008ee7..330dd31 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -4863,9 +4863,9 @@ static int lod_declare_layout_change(const struct lu_env *env, if (buf && buf->lb_len) { struct lov_user_md_v1 *v1 = buf->lb_buf; - if (v1->lmm_magic != (LOV_MAGIC_DEF | LOV_MAGIC_COMP_V1) && - v1->lmm_magic != - __swab32(LOV_MAGIC_DEF | LOV_MAGIC_COMP_V1)) { + if (v1->lmm_magic != (LOV_MAGIC_DEFINED | LOV_MAGIC_COMP_V1) && + v1->lmm_magic != __swab32(LOV_MAGIC_DEFINED | + LOV_MAGIC_COMP_V1)) { CERROR("%s: the replay buffer of layout extend " "(magic %#x) does not contain expected " "composite layout.\n", diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index d42f7d1..4ae665d 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -1729,7 +1729,7 @@ int lod_use_defined_striping(const struct lu_env *env, int rc = 0, i; ENTRY; - magic = le32_to_cpu(v1->lmm_magic) & ~LOV_MAGIC_DEF; + magic = le32_to_cpu(v1->lmm_magic) & ~LOV_MAGIC_DEFINED; if (magic != LOV_MAGIC_V1 && magic != LOV_MAGIC_V3 && magic != LOV_MAGIC_COMP_V1) @@ -1857,7 +1857,7 @@ int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo, comp_v1 = buf->lb_buf; magic = v1->lmm_magic; - if (unlikely(le32_to_cpu(magic) & LOV_MAGIC_DEF)) { + if (unlikely(le32_to_cpu(magic) & LOV_MAGIC_DEFINED)) { /* try to use as fully defined striping */ rc = lod_use_defined_striping(env, lo, buf); RETURN(rc); diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 7a313c7..0fa360d 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -1565,7 +1565,7 @@ static int mdd_swap_layouts(const struct lu_env *env, struct md_object *obj1, } else { if ((snd_lmm->lmm_magic & cpu_to_le32(LOV_MAGIC_MASK)) == cpu_to_le32(LOV_MAGIC_MAGIC)) - snd_lmm->lmm_magic |= cpu_to_le32(LOV_MAGIC_DEF); + snd_lmm->lmm_magic |= cpu_to_le32(LOV_MAGIC_DEFINED); else GOTO(stop, rc = -EPROTO); } diff --git a/lustre/mdt/mdt_lib.c b/lustre/mdt/mdt_lib.c index 9e8e71d..3f3a7dc 100644 --- a/lustre/mdt/mdt_lib.c +++ b/lustre/mdt/mdt_lib.c @@ -1403,7 +1403,7 @@ static int mdt_rename_unpack(struct mdt_thread_info *info) } /* - * please see comment above LOV_MAGIC_V1_DEF + * please see comment above LOV_MAGIC_V1_DEFINED */ void mdt_fix_lov_magic(struct mdt_thread_info *info, void *eadata) { @@ -1413,10 +1413,10 @@ void mdt_fix_lov_magic(struct mdt_thread_info *info, void *eadata) if (unlikely(req_is_replay(mdt_info_req(info)))) { if ((v1->lmm_magic & LOV_MAGIC_MASK) == LOV_MAGIC_MAGIC) - v1->lmm_magic |= LOV_MAGIC_DEF; + v1->lmm_magic |= LOV_MAGIC_DEFINED; else if ((v1->lmm_magic & __swab32(LOV_MAGIC_MAGIC)) == __swab32(LOV_MAGIC_MAGIC)) - v1->lmm_magic |= __swab32(LOV_MAGIC_DEF); + v1->lmm_magic |= __swab32(LOV_MAGIC_DEFINED); } } diff --git a/lustre/mdt/mdt_open.c b/lustre/mdt/mdt_open.c index cd0d8b8..2fcdb85 100644 --- a/lustre/mdt/mdt_open.c +++ b/lustre/mdt/mdt_open.c @@ -1659,7 +1659,7 @@ static inline int mdt_hsm_set_released(struct lov_mds_md *lmm) __u32 off; int i; - if (lmm->lmm_magic == cpu_to_le32(LOV_MAGIC_COMP_V1_DEF)) { + if (lmm->lmm_magic == cpu_to_le32(LOV_MAGIC_COMP_V1_DEFINED)) { comp_v1 = (struct lov_comp_md_v1 *)lmm; if (comp_v1->lcm_entry_count == 0) @@ -1764,17 +1764,17 @@ static int mdt_hsm_release(struct mdt_thread_info *info, struct mdt_object *o, if (!(ma->ma_valid & MA_LOV)) { /* Even empty file are released */ memset(ma->ma_lmm, 0, sizeof(*ma->ma_lmm)); - ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V1_DEF); + ma->ma_lmm->lmm_magic = cpu_to_le32(LOV_MAGIC_V1_DEFINED); ma->ma_lmm->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0); ma->ma_lmm->lmm_stripe_size = cpu_to_le32(LOV_MIN_STRIPE_SIZE); ma->ma_lmm_size = sizeof(*ma->ma_lmm); } else { - /* Magic must be LOV_MAGIC_*_DEF otherwise LOD will interpret + /* Magic must be LOV_MAGIC_*_DEFINED or LOD will interpret * ma_lmm as lov_user_md, then it will be confused by union of * layout_gen and stripe_offset. */ if ((le32_to_cpu(ma->ma_lmm->lmm_magic) & LOV_MAGIC_MASK) == LOV_MAGIC_MAGIC) - ma->ma_lmm->lmm_magic |= cpu_to_le32(LOV_MAGIC_DEF); + ma->ma_lmm->lmm_magic |= cpu_to_le32(LOV_MAGIC_DEFINED); else GOTO(out_unlock, rc = -EINVAL); }