From: Andreas Dilger Date: Mon, 16 May 2011 06:02:24 +0000 (-0600) Subject: LU-64 define LOV default layout as FID_SEQ value X-Git-Tag: 2.0.63.0~14 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=624fd0ca0832e92dd2f5486984b6c7f7397619ba LU-64 define LOV default layout as FID_SEQ value For directories without any default striping information the MDS sends a magic LOV_OBJECT_GROUP_DEFAULT value for the lmm_seq field. Since this is really a magic FID_SEQ value, define it in the same place as other FID_SEQ values as FID_SEQ_LOV_DEFAULT so that it is visible. Signed-off-by: Andreas Dilger Change-Id: I0ae9dc993d15aedb38ab79e40c67a687d956a6c4 Reviewed-on: http://review.whamcloud.com/910 Reviewed-by: Prakash Surya Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index e9add3b..3bdebf1 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -416,7 +416,8 @@ enum fid_seq { FID_SEQ_START = 0x200000000ULL, FID_SEQ_LOCAL_FILE = 0x200000001ULL, FID_SEQ_DOT_LUSTRE = 0x200000002ULL, - FID_SEQ_NORMAL = 0x200000400ULL + FID_SEQ_NORMAL = 0x200000400ULL, + FID_SEQ_LOV_DEFAULT= 0xffffffffffffffffULL }; #define OBIF_OID_MAX_BITS 32 @@ -1215,9 +1216,6 @@ enum obdo_flags { #define LOV_PATTERN_FIRST 0x100 /* first stripe is not in round-robin */ #define LOV_PATTERN_CMOBD 0x200 -#define LOV_OBJECT_GROUP_DEFAULT ~0ULL -#define LOV_OBJECT_GROUP_CLEAR 0ULL - #define lov_ost_data lov_ost_data_v1 struct lov_ost_data_v1 { /* per-stripe data structure (little-endian)*/ __u64 l_object_id; /* OST object ID */ diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index 553e04a..6cef918 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -599,7 +599,7 @@ int mdd_get_default_md(struct mdd_object *mdd_obj, struct lov_mds_md *lmm) LASSERT(ldesc != NULL); lum->lmm_magic = LOV_MAGIC_V1; - lum->lmm_object_seq = LOV_OBJECT_GROUP_DEFAULT; + lum->lmm_object_seq = FID_SEQ_LOV_DEFAULT; lum->lmm_pattern = ldesc->ld_pattern; lum->lmm_stripe_size = ldesc->ld_default_stripe_size; lum->lmm_stripe_count = ldesc->ld_default_stripe_count; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index c2b6d01..f05b13b 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1234,7 +1234,7 @@ static int filter_prep_groups(struct obd_device *obd) if (off == 0) last_group = FID_SEQ_OST_MDT0; - CWARN("%s: initialize groups [%d,%d]\n", obd->obd_name, + CWARN("%s: initialize groups [%u,%u]\n", obd->obd_name, FID_SEQ_OST_MDT0, last_group); filter->fo_committed_group = last_group; rc = filter_read_groups(obd, last_group, 1); diff --git a/lustre/obdfilter/filter_log.c b/lustre/obdfilter/filter_log.c index 7670b39..7ae5f88 100644 --- a/lustre/obdfilter/filter_log.c +++ b/lustre/obdfilter/filter_log.c @@ -178,7 +178,7 @@ static int filter_recov_log_unlink_cb(struct llog_ctxt *ctxt, /* This check is only valid before FID-on-OST and it should * be removed after FID-on-OST is implemented */ if (oa->o_seq > FID_SEQ_OST_MAX) { - CERROR("%s: invalid group number "LPU64" > MAX_CMD_GROUP %d\n", + CERROR("%s: invalid group number "LPU64" > MAX_CMD_GROUP %u\n", exp->exp_obd->obd_name, oa->o_seq, FID_SEQ_OST_MAX); RETURN(-EINVAL); } diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 1c903f8..dc989a7 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -1557,8 +1557,8 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path, char *prefix = is_dir ? "" : "lmm_"; char nl = is_dir ? ' ' : '\n'; - if (is_dir && lum->lmm_object_seq == LOV_OBJECT_GROUP_DEFAULT) { - lum->lmm_object_seq = LOV_OBJECT_GROUP_CLEAR; + if (is_dir && lum->lmm_object_seq == FID_SEQ_LOV_DEFAULT) { + lum->lmm_object_seq = FID_SEQ_OST_MDT0; if (verbose & VERBOSE_DETAIL) llapi_printf(LLAPI_MSG_NORMAL, "(Default) "); } @@ -2301,7 +2301,7 @@ static int cb_getstripe(char *path, DIR *parent, DIR *d, void *data, struct lov_user_md *lmm = ¶m->lmd->lmd_lmm; lmm->lmm_magic = LOV_MAGIC_V1; if (!param->raw) - lmm->lmm_object_seq = LOV_OBJECT_GROUP_DEFAULT; + lmm->lmm_object_seq = FID_SEQ_LOV_DEFAULT; lmm->lmm_stripe_count = 0; lmm->lmm_stripe_size = 0; lmm->lmm_stripe_offset = -1;