Whamcloud - gitweb
LU-64 define LOV default layout as FID_SEQ value
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 16 May 2011 06:02:24 +0000 (00:02 -0600)
committerOleg Drokin <green@whamcloud.com>
Mon, 13 Jun 2011 23:49:49 +0000 (16:49 -0700)
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 <adilger@whamcloud.com>
Change-Id: I0ae9dc993d15aedb38ab79e40c67a687d956a6c4
Reviewed-on: http://review.whamcloud.com/910
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre/lustre_idl.h
lustre/mdd/mdd_object.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_log.c
lustre/utils/liblustreapi.c

index e9add3b..3bdebf1 100644 (file)
@@ -416,7 +416,8 @@ enum fid_seq {
         FID_SEQ_START      = 0x200000000ULL,
         FID_SEQ_LOCAL_FILE = 0x200000001ULL,
         FID_SEQ_DOT_LUSTRE = 0x200000002ULL,
         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
 };
 
 #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_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 */
 #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 */
index 553e04a..6cef918 100644 (file)
@@ -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;
         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;
         lum->lmm_pattern = ldesc->ld_pattern;
         lum->lmm_stripe_size = ldesc->ld_default_stripe_size;
         lum->lmm_stripe_count = ldesc->ld_default_stripe_count;
index c2b6d01..f05b13b 100644 (file)
@@ -1234,7 +1234,7 @@ static int filter_prep_groups(struct obd_device *obd)
         if (off == 0)
                 last_group = FID_SEQ_OST_MDT0;
 
         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);
               FID_SEQ_OST_MDT0, last_group);
         filter->fo_committed_group = last_group;
         rc = filter_read_groups(obd, last_group, 1);
index 7670b39..7ae5f88 100644 (file)
@@ -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) {
         /* 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);
         }
                         exp->exp_obd->obd_name, oa->o_seq, FID_SEQ_OST_MAX);
                 RETURN(-EINVAL);
         }
index 1c903f8..dc989a7 100644 (file)
@@ -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';
 
         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) ");
         }
                 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 = &param->lmd->lmd_lmm;
                         lmm->lmm_magic = LOV_MAGIC_V1;
                         if (!param->raw)
                         struct lov_user_md *lmm = &param->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;
                         lmm->lmm_stripe_count = 0;
                         lmm->lmm_stripe_size = 0;
                         lmm->lmm_stripe_offset = -1;