Whamcloud - gitweb
LU-2684 fid: unify ostid and FID
authorwangdi <di.wang@whamcloud.com>
Fri, 17 Jan 2014 08:30:12 +0000 (00:30 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 10 Apr 2013 06:15:26 +0000 (02:15 -0400)
Since 2.4 will support FID on OST, so this patch will try to unify
ostid and FID, so one day, we will use FID to identify the object
everywhere.

Because both ostid and FID has 128 bits long, so we will re-define
ostid as union,

struct ost_id {
    union {
    struct ostid {
    __u64   oi_id;
    __u64   oi_seq;
    } oi;
    struct lu_fid oi_fid;
    };
};

If oi_seq == 0, it will still use <oi_seq, oi_id> to locate the
object as before. And when building reside, it still keeps the
old way res[0] = obj_id, res[1] = obj_seq;

If oi_seq != 0, it will use FID(oi_fid) directly to locate the
object, and use FID to build resid directly, so it will be unified
with META lock resid.

Remove other direct _id and _seq accessment from the code.

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes clientjob=lustre-b1_8 clientbuildno=258 testlist=runtests
Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes clientjob=lustre-b2_1 clientbuildno=191 testlist=runtests
Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes clientjob=lustre-b2_3 clientbuildno=41 testlist=runtests
Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I800a2b569169fcab4c886f3a17fc4e157ff78038
Reviewed-on: http://review.whamcloud.com/5820
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
59 files changed:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre_fid.h
lustre/include/lustre_log.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/liblustre/super.c
lustre/liblustre/tests/sanity.c
lustre/llite/file.c
lustre/lod/lod_lov.c
lustre/lod/lod_object.c
lustre/lov/lov_log.c
lustre/lov/lov_merge.c
lustre/lov/lov_obd.c
lustre/lov/lov_object.c
lustre/lov/lov_pack.c
lustre/lov/lov_request.c
lustre/mdd/mdd_device.c
lustre/obdclass/linux/linux-obdo.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_internal.h
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_lvfs.c
lustre/obdclass/llog_osd.c
lustre/obdclass/llog_swab.c
lustre/obdclass/llog_test.c
lustre/obdclass/obdo.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_fs.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c
lustre/ofd/ofd_lvb.c
lustre/ofd/ofd_obd.c
lustre/ofd/ofd_objects.c
lustre/osc/osc_io.c
lustre/osc/osc_object.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_compat.c
lustre/osd-zfs/osd_oi.c
lustre/osp/osp_internal.h
lustre/osp/osp_object.c
lustre/osp/osp_precreate.c
lustre/osp/osp_sync.c
lustre/ost/ost_handler.c
lustre/ost/ost_internal.h
lustre/ptlrpc/layout.c
lustre/ptlrpc/llog_server.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/wiretest.c
lustre/tests/sanity.sh
lustre/utils/liblustreapi.c
lustre/utils/loadgen.c
lustre/utils/obd.c
lustre/utils/obdiolib.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c

index 5043f43..15842e5 100644 (file)
@@ -329,22 +329,6 @@ struct hsm_attrs {
 };
 extern void lustre_hsm_swab(struct hsm_attrs *attrs);
 
 };
 extern void lustre_hsm_swab(struct hsm_attrs *attrs);
 
-static inline void ostid_cpu_to_le(struct ost_id *src_oi,
-                                  struct ost_id *dst_oi)
-{
-       dst_oi->oi_id = cpu_to_le64(src_oi->oi_id);
-       dst_oi->oi_seq = cpu_to_le64(src_oi->oi_seq);
-}
-
-static inline void ostid_le_to_cpu(struct ost_id *src_oi,
-                                  struct ost_id *dst_oi)
-{
-       dst_oi->oi_id = le64_to_cpu(src_oi->oi_id);
-       dst_oi->oi_seq = le64_to_cpu(src_oi->oi_seq);
-}
-
-extern void lustre_swab_ost_id(struct ost_id *oid);
-
 /**
  * fid constants
  */
 /**
  * fid constants
  */
@@ -495,6 +479,11 @@ static inline int fid_seq_is_dot(const __u64 seq)
        return seq == FID_SEQ_DOT_LUSTRE;
 }
 
        return seq == FID_SEQ_DOT_LUSTRE;
 }
 
+static inline int fid_seq_is_default(const __u64 seq)
+{
+       return seq == FID_SEQ_LOV_DEFAULT;
+}
+
 static inline int fid_is_mdt0(const struct lu_fid *fid)
 {
         return fid_seq_is_mdt0(fid_seq(fid));
 static inline int fid_is_mdt0(const struct lu_fid *fid)
 {
         return fid_seq_is_mdt0(fid_seq(fid));
@@ -571,143 +560,174 @@ static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid)
        return (fid_seq(fid) >> 16) & 0xffff;
 }
 
        return (fid_seq(fid) >> 16) & 0xffff;
 }
 
-/* unpack an ostid (id/seq) from a wire/disk structure into an IDIF FID */
-static inline void ostid_idif_unpack(struct ost_id *ostid,
-                                     struct lu_fid *fid, __u32 ost_idx)
+/* extract OST sequence (group) from a wire ost_id (id/seq) pair */
+static inline obd_seq ostid_seq(const struct ost_id *ostid)
 {
 {
-        fid->f_seq = fid_idif_seq(ostid->oi_id, ost_idx);
-        fid->f_oid = ostid->oi_id;       /* truncate to 32 bits by assignment */
-        fid->f_ver = ostid->oi_id >> 48; /* in theory, not currently used */
+       if (fid_seq_is_mdt0(ostid->oi.oi_seq))
+               return FID_SEQ_OST_MDT0;
+
+       if (fid_seq_is_default(ostid->oi.oi_seq))
+               return FID_SEQ_LOV_DEFAULT;
+
+       if (fid_is_idif(&ostid->oi_fid))
+               return FID_SEQ_OST_MDT0;
+
+       return fid_seq(&ostid->oi_fid);
 }
 
 }
 
-/* unpack an ostid (id/seq) from a wire/disk structure into a non-IDIF FID */
-static inline void ostid_fid_unpack(struct ost_id *ostid, struct lu_fid *fid)
+/* extract OST objid from a wire ost_id (id/seq) pair */
+static inline obd_id ostid_id(const struct ost_id *ostid)
 {
 {
-        fid->f_seq = ostid->oi_seq;
-        fid->f_oid = ostid->oi_id;       /* truncate to 32 bits by assignment */
-        fid->f_ver = ostid->oi_id >> 32; /* in theory, not currently used */
+       if (fid_seq_is_mdt0(ostid_seq(ostid)))
+               return ostid->oi.oi_id & IDIF_OID_MASK;
+
+       if (fid_is_idif(&ostid->oi_fid))
+               return fid_idif_id(fid_seq(&ostid->oi_fid),
+                                  fid_oid(&ostid->oi_fid), 0);
+
+       return fid_oid(&ostid->oi_fid);
 }
 
 }
 
-/* Unpack an OST object id/seq (group) into a FID.  This is needed for
- * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper
- * FIDs.  Note that if an id/seq is already in FID/IDIF format it will
- * be passed through unchanged.  Only legacy OST objects in "group 0"
- * will be mapped into the IDIF namespace so that they can fit into the
- * struct lu_fid fields without loss.  For reference see:
- * http://arch.lustre.org/index.php?title=Interoperability_fids_zfs
- */
-static inline int fid_ostid_unpack(struct lu_fid *fid, struct ost_id *ostid,
-                                   __u32 ost_idx)
+static inline void ostid_set_seq(struct ost_id *oi, __u64 seq)
 {
 {
-        if (ost_idx > 0xffff) {
-                CERROR("bad ost_idx, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
-                       ostid->oi_seq, ostid->oi_id, ost_idx);
-                return -EBADF;
-        }
-
-        if (fid_seq_is_mdt0(ostid->oi_seq)) {
-                /* This is a "legacy" (old 1.x/2.early) OST object in "group 0"
-                 * that we map into the IDIF namespace.  It allows up to 2^48
-                 * objects per OST, as this is the object namespace that has
-                 * been in production for years.  This can handle create rates
-                 * of 1M objects/s/OST for 9 years, or combinations thereof. */
-                if (ostid->oi_id >= IDIF_MAX_OID) {
-                         CERROR("bad MDT0 id, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
-                                ostid->oi_seq, ostid->oi_id, ost_idx);
-                         return -EBADF;
-                }
-                ostid_idif_unpack(ostid, fid, ost_idx);
-
-        } else if (fid_seq_is_rsvd(ostid->oi_seq)) {
-                /* These are legacy OST objects for LLOG/ECHO and CMD testing.
-                 * We only support 2^32 objects in these groups, and cannot
-                 * uniquely identify them in the system (i.e. they are the
-                 * duplicated on all OSTs), but this is not strictly required
-                 * for the old object protocol, which has a separate ost_idx. */
-                if (ostid->oi_id >= 0xffffffffULL) {
-                         CERROR("bad RSVD id, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
-                                ostid->oi_seq, ostid->oi_id, ost_idx);
-                         return -EBADF;
-                }
-                ostid_fid_unpack(ostid, fid);
-
-        } else if (unlikely(fid_seq_is_igif(ostid->oi_seq))) {
-                /* This is an MDT inode number, which should never collide with
-                 * proper OST object IDs, and is probably a broken filesystem */
-                CERROR("bad IGIF, seq:"LPU64" id:"LPU64" ost_idx:%u\n",
-                       ostid->oi_seq, ostid->oi_id, ost_idx);
-                return -EBADF;
-
-        } else /* if (fid_seq_is_idif(seq) || fid_seq_is_norm(seq)) */ {
-               /* This is either an IDIF object, which identifies objects across
-                * all OSTs, or a regular FID.  The IDIF namespace maps legacy
-                * OST objects into the FID namespace.  In both cases, we just
-                * pass the FID through, no conversion needed. */
-                ostid_fid_unpack(ostid, fid);
-        }
+       if (fid_seq_is_mdt0(seq) || fid_seq_is_default(seq)) {
+               oi->oi.oi_seq = seq;
+       } else {
+               oi->oi_fid.f_seq = seq;
+               /* Note: if f_oid + f_ver is zero, we need init it
+                * to be 1, otherwise, ostid_seq will treat this
+                * as old ostid (oi_seq == 0) */
+               if (oi->oi_fid.f_oid == 0 && oi->oi_fid.f_ver == 0)
+                       oi->oi_fid.f_oid = LUSTRE_FID_INIT_OID;
+       }
+}
 
 
-        return 0;
+static inline void ostid_set_seq_mdt0(struct ost_id *oi)
+{
+       ostid_set_seq(oi, FID_SEQ_OST_MDT0);
 }
 
 }
 
-/* pack an IDIF FID into an ostid (id/seq) for the wire/disk */
-static inline void ostid_idif_pack(const struct lu_fid *fid,
-                                   struct ost_id *ostid)
+static inline void ostid_set_seq_echo(struct ost_id *oi)
 {
 {
-        ostid->oi_seq = FID_SEQ_OST_MDT0;
-        ostid->oi_id  = fid_idif_id(fid->f_seq, fid->f_oid, fid->f_ver);
+       ostid_set_seq(oi, FID_SEQ_ECHO);
 }
 
 }
 
-/* pack a non-IDIF FID into an ostid (id/seq) for the wire/disk */
-static inline void ostid_normal_fid_pack(const struct lu_fid *fid,
-                                  struct ost_id *ostid)
+static inline void ostid_set_seq_llog(struct ost_id *oi)
 {
 {
-        ostid->oi_seq = fid_seq(fid);
-        ostid->oi_id  = fid_ver_oid(fid);
+       ostid_set_seq(oi, FID_SEQ_LLOG);
 }
 
 }
 
-/* pack any OST FID into an ostid (id/seq) for the wire/disk */
-static inline int fid_ostid_pack(const struct lu_fid *fid,
-                                 struct ost_id *ostid)
+/**
+ * Note: we need check oi_seq to decide where to set oi_id,
+ * so oi_seq should always be set ahead of oi_id.
+ */
+static inline void ostid_set_id(struct ost_id *oi, __u64 oid)
+{
+       if (fid_seq_is_mdt0(ostid_seq(oi))) {
+               if (oid >= IDIF_MAX_OID) {
+                       CERROR("Bad "LPU64" to set "DOSTID"\n",
+                               oid, POSTID(oi));
+                       return;
+               }
+               oi->oi.oi_id = oid;
+       } else {
+               if (oid > OBIF_MAX_OID) {
+                       CERROR("Bad "LPU64" to set "DOSTID"\n",
+                               oid, POSTID(oi));
+                       return;
+               }
+               oi->oi_fid.f_oid = oid;
+       }
+}
+
+static inline void ostid_inc_id(struct ost_id *oi)
 {
 {
-       if (unlikely(fid_seq_is_igif(fid->f_seq))) {
-               CERROR("bad IGIF, "DFID"\n", PFID(fid));
-               return -EBADF;
+       if (fid_seq_is_mdt0(ostid_seq(oi))) {
+               if (unlikely(ostid_id(oi) + 1 > IDIF_MAX_OID)) {
+                       CERROR("Bad inc "DOSTID"\n", POSTID(oi));
+                       return;
+               }
+               oi->oi.oi_id++;
+       } else {
+               oi->oi_fid.f_oid++;
        }
        }
+}
 
 
-       if (fid_is_idif(fid))
-               ostid_idif_pack(fid, ostid);
+static inline void ostid_dec_id(struct ost_id *oi)
+{
+       if (fid_seq_is_mdt0(ostid_seq(oi)))
+               oi->oi.oi_id--;
        else
        else
-               ostid_normal_fid_pack(fid, ostid);
-
-       return 0;
+               oi->oi_fid.f_oid--;
 }
 
 }
 
-/* extract OST sequence (group) from a wire ost_id (id/seq) pair */
-static inline obd_seq ostid_seq(struct ost_id *ostid)
+/**
+ * Unpack an OST object id/seq (group) into a FID.  This is needed for
+ * converting all obdo, lmm, lsm, etc. 64-bit id/seq pairs into proper
+ * FIDs.  Note that if an id/seq is already in FID/IDIF format it will
+ * be passed through unchanged.  Only legacy OST objects in "group 0"
+ * will be mapped into the IDIF namespace so that they can fit into the
+ * struct lu_fid fields without loss.  For reference see:
+ * http://arch.lustre.org/index.php?title=Interoperability_fids_zfs
+ */
+static inline int ostid_to_fid(struct lu_fid *fid, struct ost_id *ostid,
+                              __u32 ost_idx)
 {
 {
-        if (unlikely(fid_seq_is_igif(ostid->oi_seq)))
-                CWARN("bad IGIF, oi_seq: "LPU64" oi_id: "LPX64"\n",
-                      ostid->oi_seq, ostid->oi_id);
+       if (ost_idx > 0xffff) {
+               CERROR("bad ost_idx, "DOSTID" ost_idx:%u\n", POSTID(ostid),
+                      ost_idx);
+               return -EBADF;
+       }
 
 
-        if (unlikely(fid_seq_is_idif(ostid->oi_seq)))
-                return FID_SEQ_OST_MDT0;
+       if (fid_seq_is_mdt0(ostid_seq(ostid))) {
+               /* This is a "legacy" (old 1.x/2.early) OST object in "group 0"
+                * that we map into the IDIF namespace.  It allows up to 2^48
+                * objects per OST, as this is the object namespace that has
+                * been in production for years.  This can handle create rates
+                * of 1M objects/s/OST for 9 years, or combinations thereof. */
+               if (ostid_id(ostid) >= IDIF_MAX_OID) {
+                        CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
+                               POSTID(ostid), ost_idx);
+                        return -EBADF;
+               }
+               fid->f_seq = fid_idif_seq(ostid_id(ostid), ost_idx);
+               /* truncate to 32 bits by assignment */
+               fid->f_oid = ostid_id(ostid);
+               /* in theory, not currently used */
+               fid->f_ver = ostid_id(ostid) >> 48;
+       } else /* if (fid_seq_is_idif(seq) || fid_seq_is_norm(seq)) */ {
+              /* This is either an IDIF object, which identifies objects across
+               * all OSTs, or a regular FID.  The IDIF namespace maps legacy
+               * OST objects into the FID namespace.  In both cases, we just
+               * pass the FID through, no conversion needed. */
+               if (ostid->oi_fid.f_ver != 0) {
+                       CERROR("bad MDT0 id, "DOSTID" ost_idx:%u\n",
+                               POSTID(ostid), ost_idx);
+                       return -EBADF;
+               }
+               *fid = ostid->oi_fid;
+       }
 
 
-        return ostid->oi_seq;
+        return 0;
 }
 
 }
 
-/* extract OST objid from a wire ost_id (id/seq) pair */
-static inline obd_id ostid_id(struct ost_id *ostid)
+/* pack any OST FID into an ostid (id/seq) for the wire/disk */
+static inline int fid_to_ostid(const struct lu_fid *fid, struct ost_id *ostid)
 {
 {
-        if (ostid->oi_seq == FID_SEQ_OST_MDT0)
-                return ostid->oi_id & IDIF_OID_MASK;
-
-        if (fid_seq_is_rsvd(ostid->oi_seq))
-                return ostid->oi_id & OBIF_OID_MASK;
+       if (unlikely(fid_seq_is_igif(fid->f_seq))) {
+               CERROR("bad IGIF, "DFID"\n", PFID(fid));
+               return -EBADF;
+       }
 
 
-        if (fid_seq_is_idif(ostid->oi_seq))
-                return fid_idif_id(ostid->oi_seq, ostid->oi_id, 0);
+       if (fid_is_idif(fid)) {
+               ostid_set_seq_mdt0(ostid);
+               ostid_set_id(ostid, fid_idif_id(fid_seq(fid), fid_oid(fid),
+                                               fid_ver(fid)));
+       } else {
+               ostid->oi_fid = *fid;
+       }
 
 
-        return ostid->oi_id;
+       return 0;
 }
 
 /* Check whether the fid is for LAST_ID */
 }
 
 /* Check whether the fid is for LAST_ID */
@@ -727,6 +747,8 @@ static inline ino_t lu_igif_ino(const struct lu_fid *fid)
         return fid_seq(fid);
 }
 
         return fid_seq(fid);
 }
 
+extern void lustre_swab_ost_id(struct ost_id *oid);
+
 /**
  * Get inode generation from a igif.
  * \param fid a igif to get inode generation from.
 /**
  * Get inode generation from a igif.
  * \param fid a igif to get inode generation from.
@@ -836,6 +858,28 @@ static inline int lu_fid_cmp(const struct lu_fid *f0,
                 __diff_normalize(fid_ver(f0), fid_ver(f1));
 }
 
                 __diff_normalize(fid_ver(f0), fid_ver(f1));
 }
 
+static inline void ostid_cpu_to_le(struct ost_id *src_oi,
+                                  struct ost_id *dst_oi)
+{
+       if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
+               dst_oi->oi.oi_id = cpu_to_le64(src_oi->oi.oi_id);
+               dst_oi->oi.oi_seq = cpu_to_le64(src_oi->oi.oi_seq);
+       } else {
+               fid_cpu_to_le(&dst_oi->oi_fid, &src_oi->oi_fid);
+       }
+}
+
+static inline void ostid_le_to_cpu(struct ost_id *src_oi,
+                                  struct ost_id *dst_oi)
+{
+       if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
+               dst_oi->oi.oi_id = le64_to_cpu(src_oi->oi.oi_id);
+               dst_oi->oi.oi_seq = le64_to_cpu(src_oi->oi.oi_seq);
+       } else {
+               fid_le_to_cpu(&dst_oi->oi_fid, &src_oi->oi_fid);
+       }
+}
+
 /** @} lu_fid */
 
 /** \defgroup lu_dir lu_dir
 /** @} lu_fid */
 
 /** \defgroup lu_dir lu_dir
@@ -1635,9 +1679,6 @@ struct obd_ioobj {
 #define ioobj_max_brw_set(ioo, num)                                    \
 do { (ioo)->ioo_max_brw = ((num) - 1) << IOOBJ_MAX_BRW_BITS; } while (0)
 
 #define ioobj_max_brw_set(ioo, num)                                    \
 do { (ioo)->ioo_max_brw = ((num) - 1) << IOOBJ_MAX_BRW_BITS; } while (0)
 
-#define ioo_id ioo_oid.oi_id
-#define ioo_seq        ioo_oid.oi_seq
-
 extern void lustre_swab_obd_ioobj (struct obd_ioobj *ioo);
 
 /* multiple of 8 bytes => can array */
 extern void lustre_swab_obd_ioobj (struct obd_ioobj *ioo);
 
 /* multiple of 8 bytes => can array */
@@ -2779,8 +2820,7 @@ typedef enum {
 
 /** Identifier for a single log object */
 struct llog_logid {
 
 /** Identifier for a single log object */
 struct llog_logid {
-        __u64                   lgl_oid;
-        __u64                   lgl_oseq;
+       struct ost_id           lgl_oi;
         __u32                   lgl_ogen;
 } __attribute__((packed));
 
         __u32                   lgl_ogen;
 } __attribute__((packed));
 
@@ -2876,8 +2916,7 @@ struct llog_unlink64_rec {
 
 struct llog_setattr64_rec {
        struct llog_rec_hdr     lsr_hdr;
 
 struct llog_setattr64_rec {
        struct llog_rec_hdr     lsr_hdr;
-       obd_id                  lsr_oid;
-       obd_seq                 lsr_oseq;
+       struct ost_id           lsr_oi;
        __u32                   lsr_uid;
        __u32                   lsr_uid_h;
        __u32                   lsr_gid;
        __u32                   lsr_uid;
        __u32                   lsr_uid_h;
        __u32                   lsr_gid;
@@ -3026,7 +3065,7 @@ struct llogd_conn_body {
 /* Note: 64-bit types are 64-bit aligned in structure */
 struct obdo {
         obd_valid               o_valid;        /* hot fields in this obdo */
 /* Note: 64-bit types are 64-bit aligned in structure */
 struct obdo {
         obd_valid               o_valid;        /* hot fields in this obdo */
-        struct ost_id           o_oi;
+       struct ost_id           o_oi;
         obd_id                  o_parent_seq;
         obd_size                o_size;         /* o_size-o_blocks == ost_lvb */
         obd_time                o_mtime;
         obd_id                  o_parent_seq;
         obd_size                o_size;         /* o_size-o_blocks == ost_lvb */
         obd_time                o_mtime;
@@ -3064,8 +3103,6 @@ struct obdo {
        __u64                   o_padding_6;
 };
 
        __u64                   o_padding_6;
 };
 
-#define o_id     o_oi.oi_id
-#define o_seq    o_oi.oi_seq
 #define o_dirty   o_blocks
 #define o_undirty o_mode
 #define o_dropped o_misc
 #define o_dirty   o_blocks
 #define o_undirty o_mode
 #define o_dropped o_misc
index 60f6d9e..f41e66b 100644 (file)
@@ -110,17 +110,6 @@ struct obd_statfs {
 };
 
 /**
 };
 
 /**
- * OST object IDentifier.
- */
-struct ost_id {
-       __u64   oi_id;
-       __u64   oi_seq;
-};
-
-#define DOSTID LPX64":"LPU64
-#define POSTID(oi) (oi)->oi_seq, (oi)->oi_id
-
-/**
  * File IDentifier.
  *
  * FID is a cluster-wide unique identifier of a file or an object (stripe).
  * File IDentifier.
  *
  * FID is a cluster-wide unique identifier of a file or an object (stripe).
@@ -188,6 +177,22 @@ struct lustre_mdt_attrs {
  */
 #define LMA_OLD_SIZE (sizeof(struct lustre_mdt_attrs) + 5 * sizeof(__u64))
 
  */
 #define LMA_OLD_SIZE (sizeof(struct lustre_mdt_attrs) + 5 * sizeof(__u64))
 
+/**
+ * OST object IDentifier.
+ */
+struct ost_id {
+       union {
+               struct ostid {
+                       __u64   oi_id;
+                       __u64   oi_seq;
+               } oi;
+               struct lu_fid oi_fid;
+       };
+};
+
+#define DOSTID LPX64":"LPU64
+#define POSTID(oi) ostid_seq(oi), ostid_id(oi)
+
 /*
  * The ioctl naming rules:
  * LL_*     - works on the currently opened filehandle instead of parent dir
 /*
  * The ioctl naming rules:
  * LL_*     - works on the currently opened filehandle instead of parent dir
@@ -320,8 +325,6 @@ struct lov_user_ost_data_v1 {     /* per-stripe data structure */
        __u32 l_ost_gen;          /* generation of this OST index */
        __u32 l_ost_idx;          /* OST index in LOV */
 } __attribute__((packed));
        __u32 l_ost_gen;          /* generation of this OST index */
        __u32 l_ost_idx;          /* OST index in LOV */
 } __attribute__((packed));
-#define l_object_id    l_ost_oi.oi_id
-#define l_object_seq   l_ost_oi.oi_seq
 
 #define lov_user_md lov_user_md_v1
 struct lov_user_md_v1 {           /* LOV EA user data (host-endian) */
 
 #define lov_user_md lov_user_md_v1
 struct lov_user_md_v1 {           /* LOV EA user data (host-endian) */
index c52da03..3e5b73e 100644 (file)
@@ -562,31 +562,89 @@ fid_build_pdo_res_name(const struct lu_fid *f,
  * Build DLM resource name from object id & seq, which will be removed
  * finally, when we replace ost_id with FID in data stack.
  *
  * Build DLM resource name from object id & seq, which will be removed
  * finally, when we replace ost_id with FID in data stack.
  *
- * To keep the compatibility, res[0] = oid, res[1] = seq
+ * Currently, resid from the old client, whose res[0] = object_id,
+ * res[1] = object_seq, is just oposite with Metatdata
+ * resid, where, res[0] = fid->f_seq, res[1] = fid->f_oid.
+ * To unifiy the resid identification, we will reverse the data
+ * resid to keep it same with Metadata resid, i.e.
+ *
+ * For resid from the old client,
+ *    res[0] = objid,  res[1] = 0, still keep the original order,
+ *    for compatiblity.
+ *
+ * For new resid
+ *    res will be built from normal FID directly, i.e. res[0] = f_seq,
+ *    res[1] = f_oid + f_ver.
  */
  */
-static inline void ostid_build_res_name(struct ost_id *oid,
+static inline void ostid_build_res_name(struct ost_id *oi,
                                        struct ldlm_res_id *name)
 {
        memset(name, 0, sizeof *name);
                                        struct ldlm_res_id *name)
 {
        memset(name, 0, sizeof *name);
-       name->name[LUSTRE_RES_ID_SEQ_OFF] = oid->oi_id;
-       name->name[LUSTRE_RES_ID_VER_OID_OFF] = oid->oi_seq;
+       if (fid_seq_is_mdt0(ostid_seq(oi))) {
+               name->name[LUSTRE_RES_ID_SEQ_OFF] = ostid_id(oi);
+               name->name[LUSTRE_RES_ID_VER_OID_OFF] = ostid_seq(oi);
+       } else {
+               fid_build_reg_res_name((struct lu_fid *)oi, name);
+       }
 }
 
 }
 
-static inline void ostid_res_name_to_id(struct ost_id *oid,
+static inline void ostid_res_name_to_id(struct ost_id *oi,
                                        struct ldlm_res_id *name)
 {
                                        struct ldlm_res_id *name)
 {
-       oid->oi_id = name->name[LUSTRE_RES_ID_SEQ_OFF];
-       oid->oi_seq = name->name[LUSTRE_RES_ID_VER_OID_OFF];
+       if (fid_seq_is_mdt0(name->name[LUSTRE_RES_ID_SEQ_OFF])) {
+               /* old resid */
+               ostid_set_seq(oi, name->name[LUSTRE_RES_ID_VER_OID_OFF]);
+               ostid_set_id(oi, name->name[LUSTRE_RES_ID_SEQ_OFF]);
+       } else {
+               /* new resid */
+               fid_build_from_res_name((struct lu_fid *)oi, name);
+       }
 }
 
 /**
  * Return true if the resource is for the object identified by this id & group.
  */
 }
 
 /**
  * Return true if the resource is for the object identified by this id & group.
  */
-static inline int ostid_res_name_eq(struct ost_id *oid,
+static inline int ostid_res_name_eq(struct ost_id *oi,
                                    struct ldlm_res_id *name)
 {
                                    struct ldlm_res_id *name)
 {
-       return name->name[LUSTRE_RES_ID_SEQ_OFF] == oid->oi_id &&
-              name->name[LUSTRE_RES_ID_VER_OID_OFF] == oid->oi_seq;
+       /* Note: it is just a trick here to save some effort, probably the
+        * correct way would be turn them into the FID and compare */
+       if (fid_seq_is_mdt0(ostid_seq(oi))) {
+               return name->name[LUSTRE_RES_ID_SEQ_OFF] == ostid_id(oi) &&
+                      name->name[LUSTRE_RES_ID_VER_OID_OFF] == ostid_seq(oi);
+       } else {
+               return name->name[LUSTRE_RES_ID_SEQ_OFF] == ostid_seq(oi) &&
+                      name->name[LUSTRE_RES_ID_VER_OID_OFF] == ostid_id(oi);
+       }
+}
+
+/* The same as osc_build_res_name() */
+static inline void ost_fid_build_resid(const struct lu_fid *fid,
+                                      struct ldlm_res_id *resname)
+{
+       if (fid_is_mdt0(fid) || fid_is_idif(fid)) {
+               struct ost_id oi;
+               if (fid_to_ostid(fid, &oi) != 0)
+                       return;
+               ostid_build_res_name(&oi, resname);
+       } else {
+               fid_build_reg_res_name(fid, resname);
+       }
+}
+
+static inline void ost_fid_from_resid(struct lu_fid *fid,
+                                     const struct ldlm_res_id *name)
+{
+       if (fid_seq_is_mdt0(name->name[LUSTRE_RES_ID_VER_OID_OFF])) {
+               /* old resid */
+               struct ost_id oi;
+               ostid_set_seq(&oi, name->name[LUSTRE_RES_ID_VER_OID_OFF]);
+               ostid_set_id(&oi, name->name[LUSTRE_RES_ID_SEQ_OFF]);
+               ostid_to_fid(fid, &oi, 0);
+       } else {
+               /* new resid */
+               fid_build_from_res_name(fid, name);
+       }
 }
 
 /**
 }
 
 /**
index 2419161..e9d3f2c 100644 (file)
@@ -97,20 +97,38 @@ static inline void logid_to_fid(struct llog_logid *id, struct lu_fid *fid)
        /* For compatibility purposes we identify pre-OSD (~< 2.3.51 MDS)
         * logid's by non-zero ogen (inode generation) and convert them
         * into IGIF */
        /* For compatibility purposes we identify pre-OSD (~< 2.3.51 MDS)
         * logid's by non-zero ogen (inode generation) and convert them
         * into IGIF */
-       if (id->lgl_ogen == 0) {
-               fid->f_seq = id->lgl_oseq;
-               fid->f_oid = id->lgl_oid;
-               fid->f_ver = 0;
+       if (id->lgl_ogen == 0)
+               ostid_to_fid(fid, &id->lgl_oi, 0);
+       else
+               lu_igif_build(fid, ostid_id(&id->lgl_oi), id->lgl_ogen);
+}
+
+static inline void fid_to_logid(struct lu_fid *fid, struct llog_logid *id)
+{
+       if (fid_is_igif(fid)) {
+               /* See above lu_igif_build */
+               ostid_set_id(&id->lgl_oi, fid->f_seq);
+               id->lgl_ogen = fid->f_oid;
        } else {
        } else {
-               lu_igif_build(fid, id->lgl_oid, id->lgl_ogen);
+               fid_to_ostid(fid, &id->lgl_oi);
+               id->lgl_ogen = 0;
        }
 }
 
        }
 }
 
-static inline void fid_to_logid(struct lu_fid *fid, struct llog_logid *id)
+static inline void logid_set_id(struct llog_logid *log_id, __u64 id)
 {
 {
-       id->lgl_oseq = fid->f_seq;
-       id->lgl_oid = fid->f_oid;
-       id->lgl_ogen = 0;
+       if (log_id->lgl_ogen == 0)
+               ostid_set_id(&log_id->lgl_oi, id);
+       else
+               log_id->lgl_oi.oi.oi_id = id;
+}
+
+static inline __u64 logid_id(struct llog_logid *log_id)
+{
+       if (log_id->lgl_ogen == 0)
+               return ostid_id(&log_id->lgl_oi);
+       else
+               return log_id->lgl_oi.oi.oi_id;
 }
 
 struct llog_handle;
 }
 
 struct llog_handle;
index 81ac1b8..681e057 100644 (file)
@@ -78,17 +78,15 @@ struct osc_async_rc {
 };
 
 struct lov_oinfo {                 /* per-stripe data structure */
 };
 
 struct lov_oinfo {                 /* per-stripe data structure */
-        struct ost_id   loi_oi;    /* object ID/Sequence on the target OST */
-        int loi_ost_idx;           /* OST stripe index in lov_tgt_desc->tgts */
-        int loi_ost_gen;           /* generation of this loi_ost_idx */
-
-        unsigned long loi_kms_valid:1;
-        __u64 loi_kms;             /* known minimum size */
-        struct ost_lvb loi_lvb;
-        struct osc_async_rc     loi_ar;
+       struct ost_id   loi_oi;    /* object ID/Sequence on the target OST */
+       int loi_ost_idx;           /* OST stripe index in lov_tgt_desc->tgts */
+       int loi_ost_gen;           /* generation of this loi_ost_idx */
+
+       unsigned long loi_kms_valid:1;
+       __u64 loi_kms;             /* known minimum size */
+       struct ost_lvb loi_lvb;
+       struct osc_async_rc     loi_ar;
 };
 };
-#define loi_id  loi_oi.oi_id
-#define loi_seq loi_oi.oi_seq
 
 static inline void loi_kms_set(struct lov_oinfo *oinfo, __u64 kms)
 {
 
 static inline void loi_kms_set(struct lov_oinfo *oinfo, __u64 kms)
 {
index ec00115..2e7fd30 100644 (file)
@@ -1205,12 +1205,13 @@ static inline int obd_extent_calc(struct obd_export *exp,
 }
 
 static inline struct dentry *
 }
 
 static inline struct dentry *
-obd_lvfs_fid2dentry(struct obd_export *exp, __u64 id_ino, __u32 gen, __u64 gr)
+obd_lvfs_fid2dentry(struct obd_export *exp, struct ost_id *oi, __u32 gen)
 {
        struct lvfs_run_ctxt *ctxt = &exp->exp_obd->obd_lvfs_ctxt;
        LASSERT(exp->exp_obd);
 
 {
        struct lvfs_run_ctxt *ctxt = &exp->exp_obd->obd_lvfs_ctxt;
        LASSERT(exp->exp_obd);
 
-       return ctxt->cb_ops.l_fid2dentry(id_ino, gen, gr, exp->exp_obd);
+       return ctxt->cb_ops.l_fid2dentry(ostid_id(oi), gen, ostid_seq(oi),
+                                        exp->exp_obd);
 }
 
 /* @max_age is the oldest time in jiffies that we accept using a cached data.
 }
 
 /* @max_age is the oldest time in jiffies that we accept using a cached data.
index 6c54406..f390492 100644 (file)
@@ -220,10 +220,9 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
 
         valid &= src->o_valid;
 
 
         valid &= src->o_valid;
 
-        LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
-                            OBD_MD_FLID | OBD_MD_FLGROUP)),
-                 "object "LPU64"/"LPU64", valid %x\n",
-                 src->o_id, src->o_seq, valid);
+       LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
+                           OBD_MD_FLID | OBD_MD_FLGROUP)),
+                "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid);
 
         if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
                 CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T
 
         if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
                 CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T
@@ -306,9 +305,9 @@ int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
                                OBD_MD_FLMTIME | OBD_MD_FLCTIME |
                                OBD_MD_FLSIZE;
 
                                OBD_MD_FLMTIME | OBD_MD_FLCTIME |
                                OBD_MD_FLSIZE;
 
-        obdo_refresh_inode(inode, oinfo.oi_oa, oinfo.oi_oa->o_valid);
-        CDEBUG(D_INODE, "objid "LPX64" size %llu, blocks %llu, "
-              "blksize %llu\n", oinfo.oi_oa->o_id,
+       obdo_refresh_inode(inode, oinfo.oi_oa, oinfo.oi_oa->o_valid);
+       CDEBUG(D_INODE, "objid "DOSTID" size %llu, blocks %llu, "
+              "blksize %llu\n", POSTID(&oinfo.oi_oa->o_oi),
               (long long unsigned)llu_i2stat(inode)->st_size,
               (long long unsigned)llu_i2stat(inode)->st_blocks,
               (long long unsigned)llu_i2stat(inode)->st_blksize);
               (long long unsigned)llu_i2stat(inode)->st_size,
               (long long unsigned)llu_i2stat(inode)->st_blocks,
               (long long unsigned)llu_i2stat(inode)->st_blksize);
index 141ebdf..9652a6b 100644 (file)
@@ -1264,14 +1264,14 @@ int t55(char *name)
                printf("lmm_stripe_size:    %u\n",      lum->lmm_stripe_size);
                printf("lmm_stripe_pattern: %x\n",      lum->lmm_pattern);
 
                printf("lmm_stripe_size:    %u\n",      lum->lmm_stripe_size);
                printf("lmm_stripe_pattern: %x\n",      lum->lmm_pattern);
 
-                for (index = 0; index < lum->lmm_stripe_count; index++) {
-                        lo = lum->lmm_objects + index;
-                        printf("object %d:\n", index);
-                        printf("\tobject_seq:   "LPX64"\n", lo->l_object_seq);
-                        printf("\tobject_id:    "LPX64"\n", lo->l_object_id);
-                        printf("\tost_gen:      %#x\n", lo->l_ost_gen);
-                        printf("\tost_idx:      %u\n", lo->l_ost_idx);
-                }
+               for (index = 0; index < lum->lmm_stripe_count; index++) {
+                       lo = lum->lmm_objects + index;
+                       printf("object %d:\n", index);
+                       printf("\tobject_oid:   "DOSTID"\n",
+                              POSTID(&lo->l_ost_oi));
+                       printf("\tost_gen:      %#x\n", lo->l_ost_gen);
+                       printf("\tost_idx:      %u\n", lo->l_ost_idx);
+               }
         }
 
         if (lum->lmm_magic != LOV_USER_MAGIC ||
         }
 
         if (lum->lmm_magic != LOV_USER_MAGIC ||
@@ -1332,14 +1332,14 @@ int t55(char *name)
                printf("lmm_stripe_size:    %u\n",      lum->lmm_stripe_size);
                printf("lmm_stripe_pattern: %x\n",      lum->lmm_pattern);
 
                printf("lmm_stripe_size:    %u\n",      lum->lmm_stripe_size);
                printf("lmm_stripe_pattern: %x\n",      lum->lmm_pattern);
 
-                for (index = 0; index < lum->lmm_stripe_count; index++) {
-                        lo = lum->lmm_objects + index;
-                        printf("object %d:\n", index);
-                        printf("\tobject_seq:   "LPX64"\n", lo->l_object_seq);
-                        printf("\tobject_id:    "LPX64"\n", lo->l_object_id);
-                        printf("\tost_gen:      %#x\n", lo->l_ost_gen);
-                        printf("\tost_idx:      %u\n", lo->l_ost_idx);
-                }
+               for (index = 0; index < lum->lmm_stripe_count; index++) {
+                       lo = lum->lmm_objects + index;
+                       printf("object %d:\n", index);
+                       printf("\tobject_oid:   "DOSTID"\n",
+                              POSTID(&lo->l_ost_oi));
+                       printf("\tost_gen:      %#x\n", lo->l_ost_gen);
+                       printf("\tost_idx:      %u\n", lo->l_ost_idx);
+               }
         }
 
         if (lum->lmm_magic != LOV_USER_MAGIC ||
         }
 
         if (lum->lmm_magic != LOV_USER_MAGIC ||
index 01530a5..842e438 100644 (file)
@@ -1257,7 +1257,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,
 }
 #endif
 
 }
 #endif
 
-static int ll_lov_recreate(struct inode *inode, obd_id id, obd_seq seq,
+static int ll_lov_recreate(struct inode *inode, struct ost_id *oi,
                            obd_count ost_idx)
 {
        struct obd_export *exp = ll_i2dtexp(inode);
                            obd_count ost_idx)
 {
        struct obd_export *exp = ll_i2dtexp(inode);
@@ -1283,8 +1283,7 @@ static int ll_lov_recreate(struct inode *inode, obd_id id, obd_seq seq,
         if (lsm2 == NULL)
                 GOTO(out, rc = -ENOMEM);
 
         if (lsm2 == NULL)
                 GOTO(out, rc = -ENOMEM);
 
-        oa->o_id = id;
-        oa->o_seq = seq;
+       oa->o_oi = *oi;
         oa->o_nlink = ost_idx;
         oa->o_flags |= OBD_FL_RECREATE_OBJS;
         oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
         oa->o_nlink = ost_idx;
         oa->o_flags |= OBD_FL_RECREATE_OBJS;
         oa->o_valid = OBD_MD_FLID | OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
@@ -1307,6 +1306,7 @@ out:
 static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
 {
        struct ll_recreate_obj ucreat;
 static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
 {
        struct ll_recreate_obj ucreat;
+       struct ost_id           oi;
        ENTRY;
 
        if (!cfs_capable(CFS_CAP_SYS_ADMIN))
        ENTRY;
 
        if (!cfs_capable(CFS_CAP_SYS_ADMIN))
@@ -1316,14 +1316,15 @@ static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
                           sizeof(ucreat)))
                RETURN(-EFAULT);
 
                           sizeof(ucreat)))
                RETURN(-EFAULT);
 
-       RETURN(ll_lov_recreate(inode, ucreat.lrc_id, 0,
-                              ucreat.lrc_ost_idx));
+       ostid_set_seq_mdt0(&oi);
+       ostid_set_id(&oi, ucreat.lrc_id);
+       RETURN(ll_lov_recreate(inode, &oi, ucreat.lrc_ost_idx));
 }
 
 static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
 {
        struct lu_fid   fid;
 }
 
 static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
 {
        struct lu_fid   fid;
-       obd_id          id;
+       struct ost_id   oi;
        obd_count       ost_idx;
         ENTRY;
 
        obd_count       ost_idx;
         ENTRY;
 
@@ -1333,9 +1334,9 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
        if (copy_from_user(&fid, (struct lu_fid *)arg, sizeof(fid)))
                RETURN(-EFAULT);
 
        if (copy_from_user(&fid, (struct lu_fid *)arg, sizeof(fid)))
                RETURN(-EFAULT);
 
-       id = fid_oid(&fid) | ((fid_seq(&fid) & 0xffff) << 32);
+       fid_to_ostid(&fid, &oi);
        ost_idx = (fid_seq(&fid) >> 16) & 0xffff;
        ost_idx = (fid_seq(&fid) >> 16) & 0xffff;
-       RETURN(ll_lov_recreate(inode, id, 0, ost_idx));
+       RETURN(ll_lov_recreate(inode, &oi, ost_idx));
 }
 
 int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
 }
 
 int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
index e99f646..9c8b751 100644 (file)
@@ -518,7 +518,7 @@ int lod_generate_and_set_lovea(const struct lu_env *env,
 
        lmm->lmm_magic = cpu_to_le32(magic);
        lmm->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);
 
        lmm->lmm_magic = cpu_to_le32(magic);
        lmm->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);
-       fid_ostid_pack(fid, &lmm->lmm_oi);
+       fid_to_ostid(fid, &lmm->lmm_oi);
        ostid_cpu_to_le(&lmm->lmm_oi, &lmm->lmm_oi);
        lmm->lmm_stripe_size = cpu_to_le32(lo->ldo_stripe_size);
        lmm->lmm_stripe_count = cpu_to_le16(lo->ldo_stripenr);
        ostid_cpu_to_le(&lmm->lmm_oi, &lmm->lmm_oi);
        lmm->lmm_stripe_size = cpu_to_le32(lo->ldo_stripe_size);
        lmm->lmm_stripe_count = cpu_to_le16(lo->ldo_stripenr);
@@ -543,7 +543,7 @@ int lod_generate_and_set_lovea(const struct lu_env *env,
                LASSERT(lo->ldo_stripe[i]);
                fid = lu_object_fid(&lo->ldo_stripe[i]->do_lu);
 
                LASSERT(lo->ldo_stripe[i]);
                fid = lu_object_fid(&lo->ldo_stripe[i]->do_lu);
 
-               rc = fid_ostid_pack(fid, &info->lti_ostid);
+               rc = fid_to_ostid(fid, &info->lti_ostid);
                LASSERT(rc == 0);
 
                ostid_cpu_to_le(&info->lti_ostid, &objs[i].l_ost_oi);
                LASSERT(rc == 0);
 
                ostid_cpu_to_le(&info->lti_ostid, &objs[i].l_ost_oi);
@@ -691,7 +691,7 @@ int lod_initialize_objects(const struct lu_env *env, struct lod_object *lo,
        for (i = 0; i < lo->ldo_stripenr; i++) {
                ostid_le_to_cpu(&objs[i].l_ost_oi, &info->lti_ostid);
                idx = le64_to_cpu(objs[i].l_ost_idx);
        for (i = 0; i < lo->ldo_stripenr; i++) {
                ostid_le_to_cpu(&objs[i].l_ost_oi, &info->lti_ostid);
                idx = le64_to_cpu(objs[i].l_ost_idx);
-               fid_ostid_unpack(&info->lti_fid, &info->lti_ostid, idx);
+               ostid_to_fid(&info->lti_fid, &info->lti_ostid, idx);
                LASSERTF(fid_is_sane(&info->lti_fid), ""DFID" insane!\n",
                         PFID(&info->lti_fid));
                /*
                LASSERTF(fid_is_sane(&info->lti_fid), ""DFID" insane!\n",
                         PFID(&info->lti_fid));
                /*
index e2e632c..a5c22cd 100644 (file)
@@ -380,7 +380,7 @@ static int lod_xattr_get(const struct lu_env *env, struct dt_object *dt,
                        rc = sizeof(struct lov_user_md_v1);
                } else if (buf->lb_len >= sizeof(struct lov_user_md_v1)) {
                        lum->lmm_magic = LOV_USER_MAGIC_V1;
                        rc = sizeof(struct lov_user_md_v1);
                } else if (buf->lb_len >= sizeof(struct lov_user_md_v1)) {
                        lum->lmm_magic = LOV_USER_MAGIC_V1;
-                       lum->lmm_oi.oi_seq = FID_SEQ_LOV_DEFAULT;
+                       ostid_set_seq(&lum->lmm_oi, FID_SEQ_LOV_DEFAULT);
                        lum->lmm_pattern = desc->ld_pattern;
                        lum->lmm_stripe_size = desc->ld_default_stripe_size;
                        lum->lmm_stripe_count = desc->ld_default_stripe_count;
                        lum->lmm_pattern = desc->ld_pattern;
                        lum->lmm_stripe_size = desc->ld_default_stripe_size;
                        lum->lmm_stripe_count = desc->ld_default_stripe_count;
@@ -917,7 +917,7 @@ static int lod_declare_object_create(const struct lu_env *env,
 
                v3->lmm_magic = cpu_to_le32(LOV_MAGIC_V3);
                v3->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);
 
                v3->lmm_magic = cpu_to_le32(LOV_MAGIC_V3);
                v3->lmm_pattern = cpu_to_le32(LOV_PATTERN_RAID0);
-               fid_ostid_pack(lu_object_fid(&dt->do_lu), &v3->lmm_oi);
+               fid_to_ostid(lu_object_fid(&dt->do_lu), &v3->lmm_oi);
                ostid_cpu_to_le(&v3->lmm_oi, &v3->lmm_oi);
                v3->lmm_stripe_size = cpu_to_le32(lo->ldo_def_stripe_size);
                v3->lmm_stripe_count = cpu_to_le32(lo->ldo_def_stripenr);
                ostid_cpu_to_le(&v3->lmm_oi, &v3->lmm_oi);
                v3->lmm_stripe_size = cpu_to_le32(lo->ldo_def_stripe_size);
                v3->lmm_stripe_count = cpu_to_le32(lo->ldo_def_stripenr);
index 666ab4a..adec9a6 100644 (file)
@@ -91,14 +91,13 @@ static int lov_llog_origin_add(const struct lu_env *env,
                 switch (rec->lrh_type) {
                 case MDS_UNLINK_REC: {
                         struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
                 switch (rec->lrh_type) {
                 case MDS_UNLINK_REC: {
                         struct llog_unlink_rec *lur = (struct llog_unlink_rec *)rec;
-                        lur->lur_oid = loi->loi_id;
-                        lur->lur_oseq = loi->loi_seq;
+                        lur->lur_oid = ostid_id(&loi->loi_oi);
+                        lur->lur_oseq = (__u32)ostid_seq(&loi->loi_oi);
                         break;
                 }
                 case MDS_SETATTR64_REC: {
                         struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
                         break;
                 }
                 case MDS_SETATTR64_REC: {
                         struct llog_setattr64_rec *lsr = (struct llog_setattr64_rec *)rec;
-                        lsr->lsr_oid = loi->loi_id;
-                        lsr->lsr_oseq = loi->loi_seq;
+                        lsr->lsr_oi = loi->loi_oi;
                         break;
                 }
                 default:
                         break;
                 }
                 default:
index 42617c0..3607283 100644 (file)
@@ -63,14 +63,14 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
        obd_time current_ctime = lvb->lvb_ctime;
        int i;
        int rc = 0;
        obd_time current_ctime = lvb->lvb_ctime;
        int i;
        int rc = 0;
-       struct lu_fid fid;
+       struct lu_fid fid = {0};
 
        LASSERT_SPIN_LOCKED(&lsm->lsm_lock);
 #ifdef __KERNEL__
        LASSERT(lsm->lsm_lock_owner == cfs_curproc_pid());
 #endif
 
 
        LASSERT_SPIN_LOCKED(&lsm->lsm_lock);
 #ifdef __KERNEL__
        LASSERT(lsm->lsm_lock_owner == cfs_curproc_pid());
 #endif
 
-       ostid_fid_unpack(&lsm->lsm_oi, &fid);
+       ostid_to_fid(&fid, &lsm->lsm_oi, 0);
        CDEBUG(D_INODE, "MDT FID "DFID" initial value: s="LPU64" m="LPU64
               " a="LPU64" c="LPU64" b="LPU64"\n", PFID(&fid), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
        CDEBUG(D_INODE, "MDT FID "DFID" initial value: s="LPU64" m="LPU64
               " a="LPU64" c="LPU64" b="LPU64"\n", PFID(&fid), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
@@ -131,7 +131,7 @@ int lov_merge_lvb_kms(struct lov_stripe_md *lsm,
 int lov_merge_lvb(struct obd_export *exp,
                   struct lov_stripe_md *lsm, struct ost_lvb *lvb, int kms_only)
 {
 int lov_merge_lvb(struct obd_export *exp,
                   struct lov_stripe_md *lsm, struct ost_lvb *lvb, int kms_only)
 {
-       struct lu_fid fid;
+       struct lu_fid fid = {0};
        int   rc;
        __u64 kms;
 
        int   rc;
        __u64 kms;
 
@@ -142,7 +142,7 @@ int lov_merge_lvb(struct obd_export *exp,
        if (kms_only)
                lvb->lvb_size = kms;
 
        if (kms_only)
                lvb->lvb_size = kms;
 
-       ostid_fid_unpack(&lsm->lsm_oi, &fid);
+       ostid_to_fid(&fid, &lsm->lsm_oi, 0);
        CDEBUG(D_INODE, "merged for FID "DFID" s="LPU64" m="LPU64" a="LPU64
               " c="LPU64" b="LPU64"\n", PFID(&fid), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
        CDEBUG(D_INODE, "merged for FID "DFID" s="LPU64" m="LPU64" a="LPU64
               " c="LPU64" b="LPU64"\n", PFID(&fid), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks);
index 29df465..81c01f2 100644 (file)
@@ -1032,13 +1032,14 @@ static int lov_recreate(struct obd_export *exp, struct obdo *src_oa,
             !lov->lov_tgts[ost_idx])
                 GOTO(out, rc = -EINVAL);
 
             !lov->lov_tgts[ost_idx])
                 GOTO(out, rc = -EINVAL);
 
-        for (i = 0; i < lsm->lsm_stripe_count; i++) {
-                if (lsm->lsm_oinfo[i]->loi_ost_idx == ost_idx) {
-                        if (lsm->lsm_oinfo[i]->loi_id != src_oa->o_id)
-                                GOTO(out, rc = -EINVAL);
-                        break;
-                }
-        }
+       for (i = 0; i < lsm->lsm_stripe_count; i++) {
+               if (lsm->lsm_oinfo[i]->loi_ost_idx == ost_idx) {
+                       if (ostid_id(&lsm->lsm_oinfo[i]->loi_oi) !=
+                                       ostid_id(&src_oa->o_oi))
+                               GOTO(out, rc = -EINVAL);
+                       break;
+               }
+       }
         if (i == lsm->lsm_stripe_count)
                 GOTO(out, rc = -EINVAL);
 
         if (i == lsm->lsm_stripe_count)
                 GOTO(out, rc = -EINVAL);
 
@@ -2368,8 +2369,7 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key,
                         fm_local->fm_mapped_extents = 0;
                         fm_local->fm_flags = fiemap->fm_flags;
 
                         fm_local->fm_mapped_extents = 0;
                         fm_local->fm_flags = fiemap->fm_flags;
 
-                        fm_key->oa.o_id = lsm->lsm_oinfo[cur_stripe]->loi_id;
-                        fm_key->oa.o_seq = lsm->lsm_oinfo[cur_stripe]->loi_seq;
+                       fm_key->oa.o_oi = lsm->lsm_oinfo[cur_stripe]->loi_oi;
                         ost_index = lsm->lsm_oinfo[cur_stripe]->loi_ost_idx;
 
                         if (ost_index < 0 || ost_index >=lov->desc.ld_tgt_count)
                         ost_index = lsm->lsm_oinfo[cur_stripe]->loi_ost_idx;
 
                         if (ost_index < 0 || ost_index >=lov->desc.ld_tgt_count)
index eecfbcb..ed13cbc 100644 (file)
@@ -148,12 +148,11 @@ static int lov_init_sub(const struct lu_env *env, struct lov_object *lov,
         parent = subhdr->coh_parent;
 
        oinfo = lov->lo_lsm->lsm_oinfo[idx];
         parent = subhdr->coh_parent;
 
        oinfo = lov->lo_lsm->lsm_oinfo[idx];
-        CDEBUG(D_INODE, DFID"@%p[%d] -> "DFID"@%p: id: "LPU64" seq: "LPU64
-               " idx: %d gen: %d\n",
-               PFID(&subhdr->coh_lu.loh_fid), subhdr, idx,
-               PFID(&hdr->coh_lu.loh_fid), hdr,
-               oinfo->loi_id, oinfo->loi_seq,
-               oinfo->loi_ost_idx, oinfo->loi_ost_gen);
+       CDEBUG(D_INODE, DFID"@%p[%d] -> "DFID"@%p: ostid: "DOSTID
+              " idx: %d gen: %d\n",
+              PFID(&subhdr->coh_lu.loh_fid), subhdr, idx,
+              PFID(&hdr->coh_lu.loh_fid), hdr, POSTID(&oinfo->loi_oi),
+              oinfo->loi_ost_idx, oinfo->loi_ost_gen);
 
         if (parent == NULL) {
                 subhdr->coh_parent = hdr;
 
         if (parent == NULL) {
                 subhdr->coh_parent = hdr;
@@ -231,8 +230,7 @@ static int lov_init_raid0(const struct lu_env *env,
                         struct lov_oinfo *oinfo = lsm->lsm_oinfo[i];
                         int ost_idx = oinfo->loi_ost_idx;
 
                         struct lov_oinfo *oinfo = lsm->lsm_oinfo[i];
                         int ost_idx = oinfo->loi_ost_idx;
 
-                        fid_ostid_unpack(ofid, &oinfo->loi_oi,
-                                         oinfo->loi_ost_idx);
+                        ostid_to_fid(ofid, &oinfo->loi_oi, oinfo->loi_ost_idx);
                         subdev = lovsub2cl_dev(dev->ld_target[ost_idx]);
                         subconf->u.coc_oinfo = oinfo;
                         LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);
                         subdev = lovsub2cl_dev(dev->ld_target[ost_idx]);
                         subconf->u.coc_oinfo = oinfo;
                         LASSERTF(subdev != NULL, "not init ost %d\n", ost_idx);
index 93bf376..c3ef8c0 100644 (file)
@@ -240,9 +240,9 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
        for (i = 0; i < stripe_count; i++) {
                struct lov_oinfo *loi = lsm->lsm_oinfo[i];
                /* XXX LOV STACKING call down to osc_packmd() to do packing */
        for (i = 0; i < stripe_count; i++) {
                struct lov_oinfo *loi = lsm->lsm_oinfo[i];
                /* XXX LOV STACKING call down to osc_packmd() to do packing */
-               LASSERTF(loi->loi_id != 0, "lmm_oi "DOSTID" stripe %u/%u"
-                        " idx %u\n", POSTID(&lmmv1->lmm_oi), i, stripe_count,
-                        loi->loi_ost_idx);
+               LASSERTF(ostid_id(&loi->loi_oi) != 0, "lmm_oi "DOSTID
+                        " stripe %u/%u idx %u\n", POSTID(&lmmv1->lmm_oi),
+                        i, stripe_count, loi->loi_ost_idx);
                ostid_cpu_to_le(&loi->loi_oi, &lmm_objects[i].l_ost_oi);
                lmm_objects[i].l_ost_gen = cpu_to_le32(loi->loi_ost_gen);
                lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
                ostid_cpu_to_le(&loi->loi_oi, &lmm_objects[i].l_ost_oi);
                lmm_objects[i].l_ost_gen = cpu_to_le32(loi->loi_ost_gen);
                lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
@@ -555,13 +555,13 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
                                   &len, &last_id, NULL);
                 if (rc)
                         RETURN(rc);
                                   &len, &last_id, NULL);
                 if (rc)
                         RETURN(rc);
-                if (lmm_objects[i].l_object_id > last_id) {
-                        CERROR("Setting EA for object > than last id on "
-                               "ost idx %d "LPD64" > "LPD64" \n",
-                               lmm_objects[i].l_ost_idx,
-                               lmm_objects[i].l_object_id, last_id);
-                        RETURN(-EINVAL);
-                }
+               if (ostid_id(&lmm_objects[i].l_ost_oi) > last_id) {
+                       CERROR("Setting EA for object > than last id on"
+                              " ost idx %d "DOSTID" > "LPD64" \n",
+                              lmm_objects[i].l_ost_idx,
+                              POSTID(&lmm_objects[i].l_ost_oi), last_id);
+                       RETURN(-EINVAL);
+               }
         }
 
         rc = lov_setstripe(exp, 0, lsmp, lump);
         }
 
         rc = lov_setstripe(exp, 0, lsmp, lump);
@@ -571,8 +571,7 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
         for (i = 0; i < lump->lmm_stripe_count; i++) {
                 (*lsmp)->lsm_oinfo[i]->loi_ost_idx =
                         lmm_objects[i].l_ost_idx;
         for (i = 0; i < lump->lmm_stripe_count; i++) {
                 (*lsmp)->lsm_oinfo[i]->loi_ost_idx =
                         lmm_objects[i].l_ost_idx;
-                (*lsmp)->lsm_oinfo[i]->loi_id = lmm_objects[i].l_object_id;
-                (*lsmp)->lsm_oinfo[i]->loi_seq = lmm_objects[i].l_object_seq;
+               (*lsmp)->lsm_oinfo[i]->loi_oi = lmm_objects[i].l_ost_oi;
         }
         RETURN(0);
 }
         }
         RETURN(0);
 }
index b85a2b1..c6d8e84 100644 (file)
@@ -539,8 +539,8 @@ int lov_prep_cancel_set(struct obd_export *exp, struct obd_info *oinfo,
 
                 lov_lockhp = set->set_lockh->llh_handles + i;
                 if (!lustre_handle_is_used(lov_lockhp)) {
 
                 lov_lockhp = set->set_lockh->llh_handles + i;
                 if (!lustre_handle_is_used(lov_lockhp)) {
-                        CDEBUG(D_INFO, "lov idx %d subobj "LPX64" no lock\n",
-                               loi->loi_ost_idx, loi->loi_id);
+                        CDEBUG(D_INFO, "lov idx %d subobj "DOSTID" no lock\n",
+                               loi->loi_ost_idx, POSTID(&loi->loi_oi));
                         continue;
                 }
 
                         continue;
                 }
 
@@ -615,7 +615,7 @@ static int common_attr_done(struct lov_request_set *set)
                 GOTO(out, rc = -EIO);
         }
 
                 GOTO(out, rc = -EIO);
         }
 
-        tmp_oa->o_id = set->set_oi->oi_oa->o_id;
+        tmp_oa->o_oi = set->set_oi->oi_oa->o_oi;
         memcpy(set->set_oi->oi_oa, tmp_oa, sizeof(*set->set_oi->oi_oa));
 out:
         if (tmp_oa)
         memcpy(set->set_oi->oi_oa, tmp_oa, sizeof(*set->set_oi->oi_oa));
 out:
         if (tmp_oa)
@@ -732,8 +732,7 @@ int lov_prep_brw_set(struct obd_export *exp, struct obd_info *oinfo,
                         memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                                sizeof(*req->rq_oi.oi_oa));
                 }
                         memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                                sizeof(*req->rq_oi.oi_oa));
                 }
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+                req->rq_oi.oi_oa->o_oi = loi->loi_oi;
                 req->rq_oi.oi_oa->o_stripe_idx = i;
 
                 req->rq_buflen = sizeof(*req->rq_oi.oi_md);
                 req->rq_oi.oi_oa->o_stripe_idx = i;
 
                 req->rq_buflen = sizeof(*req->rq_oi.oi_md);
@@ -857,8 +856,7 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo,
                 }
                 memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                        sizeof(*req->rq_oi.oi_oa));
                 }
                 memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                        sizeof(*req->rq_oi.oi_oa));
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+                req->rq_oi.oi_oa->o_oi = loi->loi_oi;
                 req->rq_oi.oi_cb_up = cb_getattr_update;
                 req->rq_oi.oi_capa = oinfo->oi_capa;
 
                 req->rq_oi.oi_cb_up = cb_getattr_update;
                 req->rq_oi.oi_capa = oinfo->oi_capa;
 
@@ -936,8 +934,7 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo,
                         GOTO(out_set, rc = -ENOMEM);
                 }
                 memcpy(req->rq_oi.oi_oa, src_oa, sizeof(*req->rq_oi.oi_oa));
                         GOTO(out_set, rc = -ENOMEM);
                 }
                 memcpy(req->rq_oi.oi_oa, src_oa, sizeof(*req->rq_oi.oi_oa));
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+               req->rq_oi.oi_oa->o_oi = loi->loi_oi;
                 lov_set_add_req(req, set);
         }
         if (!set->set_count)
                 lov_set_add_req(req, set);
         }
         if (!set->set_count)
@@ -1046,13 +1043,12 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo,
                         OBD_FREE(req, sizeof(*req));
                         GOTO(out_set, rc = -ENOMEM);
                 }
                         OBD_FREE(req, sizeof(*req));
                         GOTO(out_set, rc = -ENOMEM);
                 }
-                memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
-                       sizeof(*req->rq_oi.oi_oa));
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq= loi->loi_seq;
-                req->rq_oi.oi_oa->o_stripe_idx = i;
-                req->rq_oi.oi_cb_up = cb_setattr_update;
-                req->rq_oi.oi_capa = oinfo->oi_capa;
+               memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
+                      sizeof(*req->rq_oi.oi_oa));
+               req->rq_oi.oi_oa->o_oi = loi->loi_oi;
+               req->rq_oi.oi_oa->o_stripe_idx = i;
+               req->rq_oi.oi_cb_up = cb_setattr_update;
+               req->rq_oi.oi_capa = oinfo->oi_capa;
 
                 if (oinfo->oi_oa->o_valid & OBD_MD_FLSIZE) {
                         int off = lov_stripe_offset(oinfo->oi_md,
 
                 if (oinfo->oi_oa->o_valid & OBD_MD_FLSIZE) {
                         int off = lov_stripe_offset(oinfo->oi_md,
@@ -1180,8 +1176,7 @@ int lov_prep_punch_set(struct obd_export *exp, struct obd_info *oinfo,
                 }
                 memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                        sizeof(*req->rq_oi.oi_oa));
                 }
                 memcpy(req->rq_oi.oi_oa, oinfo->oi_oa,
                        sizeof(*req->rq_oi.oi_oa));
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+               req->rq_oi.oi_oa->o_oi = loi->loi_oi;
                 req->rq_oi.oi_oa->o_valid |= OBD_MD_FLGROUP;
 
                 req->rq_oi.oi_oa->o_stripe_idx = i;
                 req->rq_oi.oi_oa->o_valid |= OBD_MD_FLGROUP;
 
                 req->rq_oi.oi_oa->o_stripe_idx = i;
@@ -1278,8 +1273,7 @@ int lov_prep_sync_set(struct obd_export *exp, struct obd_info *oinfo,
                         GOTO(out_set, rc = -ENOMEM);
                 }
                 *req->rq_oi.oi_oa = *oinfo->oi_oa;
                         GOTO(out_set, rc = -ENOMEM);
                 }
                 *req->rq_oi.oi_oa = *oinfo->oi_oa;
-                req->rq_oi.oi_oa->o_id = loi->loi_id;
-                req->rq_oi.oi_oa->o_seq = loi->loi_seq;
+                req->rq_oi.oi_oa->o_oi = loi->loi_oi;
                 req->rq_oi.oi_oa->o_stripe_idx = i;
 
                 req->rq_oi.oi_policy.l_extent.start = rs;
                 req->rq_oi.oi_oa->o_stripe_idx = i;
 
                 req->rq_oi.oi_policy.l_extent.start = rs;
index 50b292d..88d3b56 100644 (file)
@@ -189,20 +189,20 @@ static void mdd_device_shutdown(const struct lu_env *env,
 static int changelog_init_cb(const struct lu_env *env, struct llog_handle *llh,
                             struct llog_rec_hdr *hdr, void *data)
 {
 static int changelog_init_cb(const struct lu_env *env, struct llog_handle *llh,
                             struct llog_rec_hdr *hdr, void *data)
 {
-        struct mdd_device *mdd = (struct mdd_device *)data;
-        struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
+       struct mdd_device *mdd = (struct mdd_device *)data;
+       struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
 
 
-        LASSERT(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN);
-        LASSERT(rec->cr_hdr.lrh_type == CHANGELOG_REC);
+       LASSERT(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN);
+       LASSERT(rec->cr_hdr.lrh_type == CHANGELOG_REC);
 
 
-        CDEBUG(D_INFO,
-               "seeing record at index %d/%d/"LPU64" t=%x %.*s in log "LPX64"\n",
-               hdr->lrh_index, rec->cr_hdr.lrh_index, rec->cr.cr_index,
-               rec->cr.cr_type, rec->cr.cr_namelen, rec->cr.cr_name,
-               llh->lgh_id.lgl_oid);
+       CDEBUG(D_INFO,
+              "seeing record at index %d/%d/"LPU64" t=%x %.*s in log"
+              DOSTID"\n", hdr->lrh_index, rec->cr_hdr.lrh_index,
+              rec->cr.cr_index, rec->cr.cr_type, rec->cr.cr_namelen,
+              rec->cr.cr_name, POSTID(&llh->lgh_id.lgl_oi));
 
 
-        mdd->mdd_cl.mc_index = rec->cr.cr_index;
-        return LLOG_PROC_BREAK;
+       mdd->mdd_cl.mc_index = rec->cr.cr_index;
+       return LLOG_PROC_BREAK;
 }
 
 static int changelog_user_init_cb(const struct lu_env *env,
 }
 
 static int changelog_user_init_cb(const struct lu_env *env,
@@ -217,8 +217,8 @@ static int changelog_user_init_cb(const struct lu_env *env,
         LASSERT(rec->cur_hdr.lrh_type == CHANGELOG_USER_REC);
 
         CDEBUG(D_INFO, "seeing user at index %d/%d id=%d endrec="LPU64
         LASSERT(rec->cur_hdr.lrh_type == CHANGELOG_USER_REC);
 
         CDEBUG(D_INFO, "seeing user at index %d/%d id=%d endrec="LPU64
-               " in log "LPX64"\n", hdr->lrh_index, rec->cur_hdr.lrh_index,
-               rec->cur_id, rec->cur_endrec, llh->lgh_id.lgl_oid);
+               " in log "DOSTID"\n", hdr->lrh_index, rec->cur_hdr.lrh_index,
+               rec->cur_id, rec->cur_endrec, POSTID(&llh->lgh_id.lgl_oi));
 
        spin_lock(&mdd->mdd_cl.mc_user_lock);
        mdd->mdd_cl.mc_lastuser = rec->cur_id;
 
        spin_lock(&mdd->mdd_cl.mc_user_lock);
        mdd->mdd_cl.mc_lastuser = rec->cur_id;
@@ -275,9 +275,9 @@ static int llog_changelog_cancel(const struct lu_env *env,
                /* 0 or 1 means we're done */
                rc = 0;
        else
                /* 0 or 1 means we're done */
                rc = 0;
        else
-               CERROR("%s: cancel idx %u of catalog "LPX64" rc=%d\n",
+               CERROR("%s: cancel idx %u of catalog "DOSTID" rc=%d\n",
                       ctxt->loc_obd->obd_name, cathandle->lgh_last_idx,
                       ctxt->loc_obd->obd_name, cathandle->lgh_last_idx,
-                      cathandle->lgh_id.lgl_oid, rc);
+                      POSTID(&cathandle->lgh_id.lgl_oi), rc);
 
        RETURN(rc);
 }
 
        RETURN(rc);
 }
index 40bb3cf..3556ef6 100644 (file)
@@ -189,10 +189,9 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
 {
         valid &= src->o_valid;
 
 {
         valid &= src->o_valid;
 
-        LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
-                            OBD_MD_FLID | OBD_MD_FLGROUP)),
-                 "object "LPU64"/"LPU64", valid %x\n",
-                 src->o_id, src->o_seq, valid);
+       LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
+                           OBD_MD_FLID | OBD_MD_FLGROUP)),
+                "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid);
 
         if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
                 CDEBUG(D_INODE,
 
         if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
                 CDEBUG(D_INODE,
index f08fd6e..62c496b 100644 (file)
@@ -116,8 +116,8 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
         int rc = 0;
         ENTRY;
 
         int rc = 0;
         ENTRY;
 
-        CDEBUG(D_RPCTRACE, "Canceling %d in log "LPX64"\n",
-               index, loghandle->lgh_id.lgl_oid);
+        CDEBUG(D_RPCTRACE, "Canceling %d in log "DOSTID"\n",
+               index, POSTID(&loghandle->lgh_id.lgl_oi));
 
         if (index == 0) {
                 CERROR("Can't cancel index 0 which is header\n");
 
         if (index == 0) {
                 CERROR("Can't cancel index 0 which is header\n");
@@ -139,11 +139,10 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
                spin_unlock(&loghandle->lgh_hdr_lock);
                rc = llog_destroy(env, loghandle);
                if (rc < 0) {
                spin_unlock(&loghandle->lgh_hdr_lock);
                rc = llog_destroy(env, loghandle);
                if (rc < 0) {
-                       CERROR("%s: can't destroy empty llog #"LPX64"#"LPX64
+                       CERROR("%s: can't destroy empty llog #"DOSTID
                               "#%08x: rc = %d\n",
                               loghandle->lgh_ctxt->loc_obd->obd_name,
                               "#%08x: rc = %d\n",
                               loghandle->lgh_ctxt->loc_obd->obd_name,
-                              loghandle->lgh_id.lgl_oid,
-                              loghandle->lgh_id.lgl_oseq,
+                              POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, rc);
                        GOTO(out_err, rc);
                }
                               loghandle->lgh_id.lgl_ogen, rc);
                        GOTO(out_err, rc);
                }
@@ -153,11 +152,10 @@ int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
 
        rc = llog_write(env, loghandle, &llh->llh_hdr, NULL, 0, NULL, 0);
        if (rc < 0) {
 
        rc = llog_write(env, loghandle, &llh->llh_hdr, NULL, 0, NULL, 0);
        if (rc < 0) {
-               CERROR("%s: fail to write header for llog #"LPX64"#"LPX64
+               CERROR("%s: fail to write header for llog #"DOSTID
                       "#%08x: rc = %d\n",
                       loghandle->lgh_ctxt->loc_obd->obd_name,
                       "#%08x: rc = %d\n",
                       loghandle->lgh_ctxt->loc_obd->obd_name,
-                      loghandle->lgh_id.lgl_oid,
-                      loghandle->lgh_id.lgl_oseq,
+                      POSTID(&loghandle->lgh_id.lgl_oi),
                       loghandle->lgh_id.lgl_ogen, rc);
                GOTO(out_err, rc);
        }
                       loghandle->lgh_id.lgl_ogen, rc);
                GOTO(out_err, rc);
        }
index ced4c76..703b850 100644 (file)
@@ -118,9 +118,10 @@ static int llog_cat_new_log(const struct lu_env *env,
         cathandle->lgh_last_idx = index;
         llh->llh_tail.lrt_index = index;
 
         cathandle->lgh_last_idx = index;
         llh->llh_tail.lrt_index = index;
 
-        CDEBUG(D_RPCTRACE,"new recovery log "LPX64":%x for index %u of catalog "
-               LPX64"\n", loghandle->lgh_id.lgl_oid, loghandle->lgh_id.lgl_ogen,
-               index, cathandle->lgh_id.lgl_oid);
+       CDEBUG(D_RPCTRACE,"new recovery log "DOSTID":%x for index %u of catalog"
+              DOSTID"\n", POSTID(&loghandle->lgh_id.lgl_oi),
+              loghandle->lgh_id.lgl_ogen, index,
+              POSTID(&cathandle->lgh_id.lgl_oi));
         /* build the record for this log in the catalog */
         rec.lid_hdr.lrh_len = sizeof(rec);
         rec.lid_hdr.lrh_index = index;
         /* build the record for this log in the catalog */
         rec.lid_hdr.lrh_len = sizeof(rec);
         rec.lid_hdr.lrh_index = index;
@@ -167,11 +168,12 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
                                u.phd.phd_entry) {
                struct llog_logid *cgl = &loghandle->lgh_id;
 
                                u.phd.phd_entry) {
                struct llog_logid *cgl = &loghandle->lgh_id;
 
-               if (cgl->lgl_oid == logid->lgl_oid) {
+               if (ostid_id(&cgl->lgl_oi) == ostid_id(&logid->lgl_oi) &&
+                   ostid_seq(&cgl->lgl_oi) == ostid_seq(&logid->lgl_oi)) {
                        if (cgl->lgl_ogen != logid->lgl_ogen) {
                        if (cgl->lgl_ogen != logid->lgl_ogen) {
-                               CERROR("%s: log "LPX64" generation %x != %x\n",
+                               CERROR("%s: log "DOSTID" generation %x != %x\n",
                                       loghandle->lgh_ctxt->loc_obd->obd_name,
                                       loghandle->lgh_ctxt->loc_obd->obd_name,
-                                      logid->lgl_oid, cgl->lgl_ogen,
+                                      POSTID(&logid->lgl_oi), cgl->lgl_ogen,
                                       logid->lgl_ogen);
                                continue;
                        }
                                       logid->lgl_ogen);
                                continue;
                        }
@@ -185,9 +187,9 @@ int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
        rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, logid, NULL,
                       LLOG_OPEN_EXISTS);
        if (rc < 0) {
        rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, logid, NULL,
                       LLOG_OPEN_EXISTS);
        if (rc < 0) {
-               CERROR("%s: error opening log id "LPX64":%x: rc = %d\n",
+               CERROR("%s: error opening log id "DOSTID":%x: rc = %d\n",
                       cathandle->lgh_ctxt->loc_obd->obd_name,
                       cathandle->lgh_ctxt->loc_obd->obd_name,
-                      logid->lgl_oid, logid->lgl_ogen, rc);
+                      POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
@@ -508,9 +510,9 @@ int llog_cat_cancel_records(const struct lu_env *env,
 
                rc = llog_cat_id2handle(env, cathandle, &loghandle, lgl);
                if (rc) {
 
                rc = llog_cat_id2handle(env, cathandle, &loghandle, lgl);
                if (rc) {
-                       CERROR("%s: cannot find handle for llog "LPX64": %d\n",
+                       CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                               cathandle->lgh_ctxt->loc_obd->obd_name,
                               cathandle->lgh_ctxt->loc_obd->obd_name,
-                              lgl->lgl_oid, rc);
+                              POSTID(&lgl->lgl_oi), rc);
                        failed++;
                        continue;
                }
                        failed++;
                        continue;
                }
@@ -551,15 +553,15 @@ int llog_cat_process_cb(const struct lu_env *env, struct llog_handle *cat_llh,
                 CERROR("invalid record in catalog\n");
                 RETURN(-EINVAL);
         }
                 CERROR("invalid record in catalog\n");
                 RETURN(-EINVAL);
         }
-        CDEBUG(D_HA, "processing log "LPX64":%x at index %u of catalog "
-               LPX64"\n", lir->lid_id.lgl_oid, lir->lid_id.lgl_ogen,
-               rec->lrh_index, cat_llh->lgh_id.lgl_oid);
+       CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
+              DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
+              rec->lrh_index, POSTID(&cat_llh->lgh_id.lgl_oi));
 
        rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
        if (rc) {
 
        rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
        if (rc) {
-               CERROR("%s: cannot find handle for llog "LPX64": %d\n",
+               CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
-                      lir->lid_id.lgl_oid, rc);
+                      POSTID(&lir->lid_id.lgl_oi), rc);
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
@@ -604,8 +606,8 @@ int llog_cat_process_or_fork(const struct lu_env *env,
         if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
                 struct llog_process_cat_data cd;
 
         if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
                 struct llog_process_cat_data cd;
 
-                CWARN("catlog "LPX64" crosses index zero\n",
-                      cat_llh->lgh_id.lgl_oid);
+                CWARN("catlog "DOSTID" crosses index zero\n",
+                      POSTID(&cat_llh->lgh_id.lgl_oi));
 
                 cd.lpcd_first_idx = llh->llh_cat_idx;
                 cd.lpcd_last_idx = 0;
 
                 cd.lpcd_first_idx = llh->llh_cat_idx;
                 cd.lpcd_last_idx = 0;
@@ -639,24 +641,24 @@ static int llog_cat_reverse_process_cb(const struct lu_env *env,
                                       struct llog_handle *cat_llh,
                                       struct llog_rec_hdr *rec, void *data)
 {
                                       struct llog_handle *cat_llh,
                                       struct llog_rec_hdr *rec, void *data)
 {
-        struct llog_process_data *d = data;
-        struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
-        struct llog_handle *llh;
-        int rc;
+       struct llog_process_data *d = data;
+       struct llog_logid_rec *lir = (struct llog_logid_rec *)rec;
+       struct llog_handle *llh;
+       int rc;
 
 
-        if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
-                CERROR("invalid record in catalog\n");
-                RETURN(-EINVAL);
-        }
-        CDEBUG(D_HA, "processing log "LPX64":%x at index %u of catalog "
-               LPX64"\n", lir->lid_id.lgl_oid, lir->lid_id.lgl_ogen,
-               le32_to_cpu(rec->lrh_index), cat_llh->lgh_id.lgl_oid);
+       if (le32_to_cpu(rec->lrh_type) != LLOG_LOGID_MAGIC) {
+               CERROR("invalid record in catalog\n");
+               RETURN(-EINVAL);
+       }
+       CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
+              DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
+              le32_to_cpu(rec->lrh_index), POSTID(&cat_llh->lgh_id.lgl_oi));
 
        rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
        if (rc) {
 
        rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id);
        if (rc) {
-               CERROR("%s: cannot find handle for llog "LPX64": %d\n",
+               CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
                       cat_llh->lgh_ctxt->loc_obd->obd_name,
-                      lir->lid_id.lgl_oid, rc);
+                      POSTID(&lir->lid_id.lgl_oi), rc);
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
@@ -679,9 +681,9 @@ int llog_cat_reverse_process(const struct lu_env *env,
         d.lpd_data = data;
         d.lpd_cb = cb;
 
         d.lpd_data = data;
         d.lpd_cb = cb;
 
-        if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
-                CWARN("catalog "LPX64" crosses index zero\n",
-                      cat_llh->lgh_id.lgl_oid);
+       if (llh->llh_cat_idx > cat_llh->lgh_last_idx) {
+               CWARN("catalog "DOSTID" crosses index zero\n",
+                     POSTID(&cat_llh->lgh_id.lgl_oi));
 
                 cd.lpcd_first_idx = 0;
                 cd.lpcd_last_idx = cat_llh->lgh_last_idx;
 
                 cd.lpcd_first_idx = 0;
                 cd.lpcd_last_idx = cat_llh->lgh_last_idx;
@@ -731,11 +733,11 @@ int llog_cat_set_first_idx(struct llog_handle *cathandle, int index)
                         }
                 }
 out:
                         }
                 }
 out:
-                CDEBUG(D_RPCTRACE, "set catlog "LPX64" first idx %u\n",
-                       cathandle->lgh_id.lgl_oid, llh->llh_cat_idx);
-        }
+               CDEBUG(D_RPCTRACE, "set catlog "DOSTID" first idx %u\n",
+                      POSTID(&cathandle->lgh_id.lgl_oi), llh->llh_cat_idx);
+       }
 
 
-        RETURN(0);
+       RETURN(0);
 }
 
 /* Cleanup deleted plain llog traces from catalog */
 }
 
 /* Cleanup deleted plain llog traces from catalog */
@@ -762,8 +764,8 @@ int llog_cat_cleanup(const struct lu_env *env, struct llog_handle *cathandle,
        rc = llog_cancel_rec(env, cathandle, index);
        if (rc == 0)
                CDEBUG(D_HA, "cancel plain log at index"
        rc = llog_cancel_rec(env, cathandle, index);
        if (rc == 0)
                CDEBUG(D_HA, "cancel plain log at index"
-                      " %u of catalog "LPX64"\n",
-                      index, cathandle->lgh_id.lgl_oid);
+                      " %u of catalog "DOSTID"\n",
+                      index, POSTID(&cathandle->lgh_id.lgl_oi));
        return rc;
 }
 
        return rc;
 }
 
@@ -781,15 +783,16 @@ int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle,
                CERROR("invalid record in catalog\n");
                RETURN(-EINVAL);
        }
                CERROR("invalid record in catalog\n");
                RETURN(-EINVAL);
        }
-       CDEBUG(D_HA, "processing log "LPX64":%x at index %u of catalog "
-              LPX64"\n", lir->lid_id.lgl_oid, lir->lid_id.lgl_ogen,
-              rec->lrh_index, cathandle->lgh_id.lgl_oid);
+
+       CDEBUG(D_HA, "processing log "DOSTID":%x at index %u of catalog "
+              DOSTID"\n", POSTID(&lir->lid_id.lgl_oi), lir->lid_id.lgl_ogen,
+              rec->lrh_index, POSTID(&cathandle->lgh_id.lgl_oi));
 
        rc = llog_cat_id2handle(env, cathandle, &loghandle, &lir->lid_id);
        if (rc) {
 
        rc = llog_cat_id2handle(env, cathandle, &loghandle, &lir->lid_id);
        if (rc) {
-               CERROR("%s: cannot find handle for llog "LPX64": %d\n",
+               CERROR("%s: cannot find handle for llog "DOSTID": %d\n",
                       cathandle->lgh_ctxt->loc_obd->obd_name,
                       cathandle->lgh_ctxt->loc_obd->obd_name,
-                      lir->lid_id.lgl_oid, rc);
+                      POSTID(&lir->lid_id.lgl_oi), rc);
                if (rc == -ENOENT || rc == -ESTALE) {
                        /* remove index from catalog */
                        llog_cat_cleanup(env, cathandle, NULL, rec->lrh_index);
                if (rc == -ENOENT || rc == -ESTALE) {
                        /* remove index from catalog */
                        llog_cat_cleanup(env, cathandle, NULL, rec->lrh_index);
index 32f3f96..2d9f600 100644 (file)
@@ -71,6 +71,14 @@ static inline struct llog_thread_info *llog_info(const struct lu_env *env)
        return lgi;
 }
 
        return lgi;
 }
 
+static inline void
+lustre_build_llog_lvfs_oid(struct llog_logid *logid, __u64 ino, __u32 gen)
+{
+       ostid_set_seq_llog(&logid->lgl_oi);
+       ostid_set_id(&logid->lgl_oi, ino);
+       logid->lgl_ogen = gen;
+}
+
 int llog_info_init(void);
 void llog_info_fini(void);
 
 int llog_info_init(void);
 void llog_info_fini(void);
 
index e210d95..aa7504f 100644 (file)
@@ -43,6 +43,7 @@
 static int str2logid(struct llog_logid *logid, char *str, int len)
 {
         char *start, *end, *endp;
 static int str2logid(struct llog_logid *logid, char *str, int len)
 {
         char *start, *end, *endp;
+       __u64 id, seq;
 
         ENTRY;
         start = str;
 
         ENTRY;
         start = str;
@@ -57,7 +58,7 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
                 RETURN(-EINVAL);
 
         *end = '\0';
                 RETURN(-EINVAL);
 
         *end = '\0';
-        logid->lgl_oid = simple_strtoull(start, &endp, 0);
+       id = simple_strtoull(start, &endp, 0);
         if (endp != end)
                 RETURN(-EINVAL);
 
         if (endp != end)
                 RETURN(-EINVAL);
 
@@ -69,11 +70,14 @@ static int str2logid(struct llog_logid *logid, char *str, int len)
                 RETURN(-EINVAL);
 
         *end = '\0';
                 RETURN(-EINVAL);
 
         *end = '\0';
-        logid->lgl_oseq = simple_strtoull(start, &endp, 0);
+       seq = simple_strtoull(start, &endp, 0);
         if (endp != end)
                 RETURN(-EINVAL);
 
         if (endp != end)
                 RETURN(-EINVAL);
 
-        start = ++end;
+       ostid_set_seq(&logid->lgl_oi, seq);
+       ostid_set_id(&logid->lgl_oi, id);
+
+       start = ++end;
         if (start - str >= len - 1)
                 RETURN(-EINVAL);
         logid->lgl_ogen = simple_strtoul(start, &endp, 16);
         if (start - str >= len - 1)
                 RETURN(-EINVAL);
         logid->lgl_ogen = simple_strtoul(start, &endp, 16);
@@ -130,9 +134,8 @@ static int llog_check_cb(const struct lu_env *env, struct llog_handle *handle,
                         RETURN(-EOPNOTSUPP);
                rc = llog_cat_id2handle(env, handle, &loghandle, &lir->lid_id);
                if (rc) {
                         RETURN(-EOPNOTSUPP);
                rc = llog_cat_id2handle(env, handle, &loghandle, &lir->lid_id);
                if (rc) {
-                       CDEBUG(D_IOCTL,
-                              "cannot find log #"LPX64"#"LPX64"#%08x\n",
-                              lir->lid_id.lgl_oid, lir->lid_id.lgl_oseq,
+                       CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
+                              POSTID(&lir->lid_id.lgl_oi),
                               lir->lid_id.lgl_ogen);
                        RETURN(rc);
                }
                               lir->lid_id.lgl_ogen);
                        RETURN(rc);
                }
@@ -210,10 +213,10 @@ static int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
                         RETURN(-EINVAL);
                 }
 
                         RETURN(-EINVAL);
                 }
 
-                l = snprintf(out, remains,
-                             "[index]: %05d  [logid]: #"LPX64"#"LPX64"#%08x\n",
-                             cur_index, lir->lid_id.lgl_oid,
-                             lir->lid_id.lgl_oseq, lir->lid_id.lgl_ogen);
+               l = snprintf(out, remains,
+                            "[index]: %05d  [logid]: #"DOSTID"#%08x\n",
+                            cur_index, POSTID(&lir->lid_id.lgl_oi),
+                            lir->lid_id.lgl_ogen);
        } else if (rec->lrh_type == OBD_CFG_REC) {
                int rc;
 
        } else if (rec->lrh_type == OBD_CFG_REC) {
                int rc;
 
@@ -245,8 +248,8 @@ static int llog_remove_log(const struct lu_env *env, struct llog_handle *cat,
 
        rc = llog_cat_id2handle(env, cat, &log, logid);
        if (rc) {
 
        rc = llog_cat_id2handle(env, cat, &log, logid);
        if (rc) {
-               CDEBUG(D_IOCTL, "cannot find log #"LPX64"#"LPX64"#%08x\n",
-                      logid->lgl_oid, logid->lgl_oseq, logid->lgl_ogen);
+               CDEBUG(D_IOCTL, "cannot find log #"DOSTID"#%08x\n",
+                      POSTID(&logid->lgl_oi), logid->lgl_ogen);
                RETURN(-ENOENT);
        }
 
                RETURN(-ENOENT);
        }
 
@@ -316,18 +319,18 @@ int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
                                   cfs_size_round(data->ioc_inllen1);
                char    *out = data->ioc_bulk;
 
                                   cfs_size_round(data->ioc_inllen1);
                char    *out = data->ioc_bulk;
 
-                l = snprintf(out, remains,
-                             "logid:            #"LPX64"#"LPX64"#%08x\n"
-                             "flags:            %x (%s)\n"
-                             "records count:    %d\n"
-                             "last index:       %d\n",
-                             handle->lgh_id.lgl_oid, handle->lgh_id.lgl_oseq,
-                             handle->lgh_id.lgl_ogen,
-                             handle->lgh_hdr->llh_flags,
-                             handle->lgh_hdr->llh_flags &
-                             LLOG_F_IS_CAT ? "cat" : "plain",
-                             handle->lgh_hdr->llh_count,
-                             handle->lgh_last_idx);
+               l = snprintf(out, remains,
+                            "logid:            #"DOSTID"#%08x\n"
+                            "flags:            %x (%s)\n"
+                            "records count:    %d\n"
+                            "last index:       %d\n",
+                            POSTID(&handle->lgh_id.lgl_oi),
+                            handle->lgh_id.lgl_ogen,
+                            handle->lgh_hdr->llh_flags,
+                            handle->lgh_hdr->llh_flags &
+                            LLOG_F_IS_CAT ? "cat" : "plain",
+                            handle->lgh_hdr->llh_count,
+                            handle->lgh_last_idx);
                 out += l;
                 remains -= l;
                if (remains <= 0) {
                 out += l;
                 remains -= l;
                if (remains <= 0) {
index 8d9deb1..1bfbcd8 100644 (file)
@@ -272,9 +272,9 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
                         /* We assume that caller has set lgh_cur_* */
                         saved_offset = loghandle->lgh_cur_offset;
                         CDEBUG(D_OTHER,
                         /* We assume that caller has set lgh_cur_* */
                         saved_offset = loghandle->lgh_cur_offset;
                         CDEBUG(D_OTHER,
-                               "modify record "LPX64": idx:%d/%u/%d, len:%u "
+                               "modify record "DOSTID": idx:%d/%u/%d, len:%u "
                                "offset %llu\n",
                                "offset %llu\n",
-                               loghandle->lgh_id.lgl_oid, idx, rec->lrh_index,
+                               POSTID(&loghandle->lgh_id.lgl_oi), idx, rec->lrh_index,
                                loghandle->lgh_cur_idx, rec->lrh_len,
                                (long long)(saved_offset - sizeof(*llh)));
                         if (rec->lrh_index != loghandle->lgh_cur_idx) {
                                loghandle->lgh_cur_idx, rec->lrh_len,
                                (long long)(saved_offset - sizeof(*llh)));
                         if (rec->lrh_index != loghandle->lgh_cur_idx) {
@@ -348,8 +348,8 @@ static int llog_lvfs_write_rec(const struct lu_env *env,
         if (rc)
                 RETURN(rc);
 
         if (rc)
                 RETURN(rc);
 
-        CDEBUG(D_RPCTRACE, "added record "LPX64": idx: %u, %u \n",
-               loghandle->lgh_id.lgl_oid, index, rec->lrh_len);
+       CDEBUG(D_RPCTRACE, "added record "DOSTID": idx: %u, %u \n",
+              POSTID(&loghandle->lgh_id.lgl_oi), index, rec->lrh_len);
         if (rc == 0 && reccookie) {
                 reccookie->lgc_lgl = loghandle->lgh_id;
                 reccookie->lgc_index = index;
         if (rc == 0 && reccookie) {
                 reccookie->lgc_lgl = loghandle->lgh_id;
                 reccookie->lgc_index = index;
@@ -417,13 +417,13 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                                        loghandle->lgh_file, buf, llen,
                                        cur_offset);
                if (rc < 0) {
                                        loghandle->lgh_file, buf, llen,
                                        cur_offset);
                if (rc < 0) {
-                        CERROR("Cant read llog block at log id "LPU64
-                               "/%u offset "LPU64"\n",
-                               loghandle->lgh_id.lgl_oid,
-                               loghandle->lgh_id.lgl_ogen,
-                               *cur_offset);
-                        RETURN(rc);
-                }
+                       CERROR("Cant read llog block at log id "DOSTID
+                              "/%u offset "LPU64"\n",
+                              POSTID(&loghandle->lgh_id.lgl_oi),
+                              loghandle->lgh_id.lgl_ogen,
+                              *cur_offset);
+                       RETURN(rc);
+               }
 
                 /* put number of bytes read into rc to make code simpler */
                rc = *cur_offset - ppos;
 
                 /* put number of bytes read into rc to make code simpler */
                rc = *cur_offset - ppos;
@@ -435,12 +435,12 @@ static int llog_lvfs_next_block(const struct lu_env *env,
                 if (rc == 0) /* end of file, nothing to do */
                         RETURN(0);
 
                 if (rc == 0) /* end of file, nothing to do */
                         RETURN(0);
 
-                if (rc < sizeof(*tail)) {
-                        CERROR("Invalid llog block at log id "LPU64"/%u offset "
-                               LPU64"\n", loghandle->lgh_id.lgl_oid,
-                               loghandle->lgh_id.lgl_ogen, *cur_offset);
-                        RETURN(-EINVAL);
-                }
+               if (rc < sizeof(*tail)) {
+                       CERROR("Invalid llog block at log id "DOSTID"/%u offset"
+                              LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
+                              loghandle->lgh_id.lgl_ogen, *cur_offset);
+                       RETURN(-EINVAL);
+               }
 
                 rec = buf;
                if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
 
                 rec = buf;
                if (LLOG_REC_HDR_NEEDS_SWABBING(rec))
@@ -459,13 +459,13 @@ static int llog_lvfs_next_block(const struct lu_env *env,
 
                 *cur_idx = tail->lrt_index;
 
 
                 *cur_idx = tail->lrt_index;
 
-                /* this shouldn't happen */
-                if (tail->lrt_index == 0) {
-                        CERROR("Invalid llog tail at log id "LPU64"/%u offset "
-                               LPU64"\n", loghandle->lgh_id.lgl_oid,
-                               loghandle->lgh_id.lgl_ogen, *cur_offset);
-                        RETURN(-EINVAL);
-                }
+               /* this shouldn't happen */
+               if (tail->lrt_index == 0) {
+                       CERROR("Invalid llog tail at log id "DOSTID"/%u offset "
+                              LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
+                              loghandle->lgh_id.lgl_ogen, *cur_offset);
+                       RETURN(-EINVAL);
+               }
                 if (tail->lrt_index < next_idx)
                         continue;
 
                 if (tail->lrt_index < next_idx)
                         continue;
 
@@ -506,13 +506,13 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                                        loghandle->lgh_file, buf, len,
                                        &cur_offset);
                if (rc < 0) {
                                        loghandle->lgh_file, buf, len,
                                        &cur_offset);
                if (rc < 0) {
-                        CERROR("Cant read llog block at log id "LPU64
-                               "/%u offset "LPU64"\n",
-                               loghandle->lgh_id.lgl_oid,
-                               loghandle->lgh_id.lgl_ogen,
-                               cur_offset);
-                        RETURN(rc);
-                }
+                       CERROR("Cant read llog block at log id "DOSTID
+                              "/%u offset "LPU64"\n",
+                              POSTID(&loghandle->lgh_id.lgl_oi),
+                              loghandle->lgh_id.lgl_ogen,
+                              cur_offset);
+                       RETURN(rc);
+               }
 
                 /* put number of bytes read into rc to make code simpler */
                rc = cur_offset - ppos;
 
                 /* put number of bytes read into rc to make code simpler */
                rc = cur_offset - ppos;
@@ -521,8 +521,8 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                         RETURN(0);
 
                 if (rc < sizeof(*tail)) {
                         RETURN(0);
 
                 if (rc < sizeof(*tail)) {
-                        CERROR("Invalid llog block at log id "LPU64"/%u offset "
-                               LPU64"\n", loghandle->lgh_id.lgl_oid,
+                        CERROR("Invalid llog block at log id "DOSTID"/%u offset"
+                               LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
                                loghandle->lgh_id.lgl_ogen, cur_offset);
                         RETURN(-EINVAL);
                 }
                                loghandle->lgh_id.lgl_ogen, cur_offset);
                         RETURN(-EINVAL);
                 }
@@ -542,13 +542,13 @@ static int llog_lvfs_prev_block(const struct lu_env *env,
                        lustre_swab_llog_rec(last_rec);
                LASSERT(last_rec->lrh_index == tail->lrt_index);
 
                        lustre_swab_llog_rec(last_rec);
                LASSERT(last_rec->lrh_index == tail->lrt_index);
 
-                /* this shouldn't happen */
-                if (tail->lrt_index == 0) {
-                        CERROR("Invalid llog tail at log id "LPU64"/%u offset "
-                               LPU64"\n", loghandle->lgh_id.lgl_oid,
-                               loghandle->lgh_id.lgl_ogen, cur_offset);
-                        RETURN(-EINVAL);
-                }
+               /* this shouldn't happen */
+               if (tail->lrt_index == 0) {
+                       CERROR("Invalid llog tail at log id "DOSTID"/%u offset"
+                              LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi),
+                              loghandle->lgh_id.lgl_ogen, cur_offset);
+                       RETURN(-EINVAL);
+               }
                if (tail->lrt_index < prev_idx)
                         continue;
 
                if (tail->lrt_index < prev_idx)
                         continue;
 
@@ -605,23 +605,21 @@ static int llog_lvfs_open(const struct lu_env *env,  struct llog_handle *handle,
 
        LASSERT(handle);
        if (logid != NULL) {
 
        LASSERT(handle);
        if (logid != NULL) {
-               dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, logid->lgl_oid,
-                                            logid->lgl_ogen, logid->lgl_oseq);
+               dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, &logid->lgl_oi,
+                                            logid->lgl_ogen);
                if (IS_ERR(dchild)) {
                        rc = PTR_ERR(dchild);
                if (IS_ERR(dchild)) {
                        rc = PTR_ERR(dchild);
-                       CERROR("%s: error looking up logfile #"LPX64"#"
-                              LPX64"#%08x: rc = %d\n",
-                              ctxt->loc_obd->obd_name, logid->lgl_oid,
-                              logid->lgl_oseq, logid->lgl_ogen, rc);
+                       CERROR("%s: error looking up logfile #"DOSTID "#%08x:"
+                              " rc = %d\n", ctxt->loc_obd->obd_name,
+                              POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
                        GOTO(out, rc);
                }
                if (dchild->d_inode == NULL) {
                        l_dput(dchild);
                        rc = -ENOENT;
                        GOTO(out, rc);
                }
                if (dchild->d_inode == NULL) {
                        l_dput(dchild);
                        rc = -ENOENT;
-                       CERROR("%s: nonexistent llog #"LPX64"#"LPX64"#%08x: "
+                       CERROR("%s: nonexistent llog #"DOSTID"#%08x:"
                               "rc = %d\n", ctxt->loc_obd->obd_name,
                               "rc = %d\n", ctxt->loc_obd->obd_name,
-                              logid->lgl_oid, logid->lgl_oseq,
-                              logid->lgl_ogen, rc);
+                              POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
                        GOTO(out, rc);
                }
                handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
                        GOTO(out, rc);
                }
                handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
@@ -630,10 +628,9 @@ static int llog_lvfs_open(const struct lu_env *env,  struct llog_handle *handle,
                if (IS_ERR(handle->lgh_file)) {
                        rc = PTR_ERR(handle->lgh_file);
                        handle->lgh_file = NULL;
                if (IS_ERR(handle->lgh_file)) {
                        rc = PTR_ERR(handle->lgh_file);
                        handle->lgh_file = NULL;
-                       CERROR("%s: error opening llog #"LPX64"#"LPX64"#%08x: "
+                       CERROR("%s: error opening llog #"DOSTID"#%08x:"
                               "rc = %d\n", ctxt->loc_obd->obd_name,
                               "rc = %d\n", ctxt->loc_obd->obd_name,
-                              logid->lgl_oid, logid->lgl_oseq,
-                              logid->lgl_ogen, rc);
+                              POSTID(&logid->lgl_oi), logid->lgl_ogen, rc);
                        GOTO(out, rc);
                }
                handle->lgh_id = *logid;
                        GOTO(out, rc);
                }
                handle->lgh_id = *logid;
@@ -654,11 +651,9 @@ static int llog_lvfs_open(const struct lu_env *env,  struct llog_handle *handle,
                                GOTO(out, rc);
                        }
                } else {
                                GOTO(out, rc);
                        }
                } else {
-                       handle->lgh_id.lgl_oseq = FID_SEQ_LLOG;
-                       handle->lgh_id.lgl_oid =
-                               handle->lgh_file->f_dentry->d_inode->i_ino;
-                       handle->lgh_id.lgl_ogen =
-                               handle->lgh_file->f_dentry->d_inode->i_generation;
+                       lustre_build_llog_lvfs_oid(&handle->lgh_id,
+                           handle->lgh_file->f_dentry->d_inode->i_ino,
+                           handle->lgh_file->f_dentry->d_inode->i_generation);
                }
        } else {
                LASSERTF(open_param == LLOG_OPEN_NEW, "%#x\n", open_param);
                }
        } else {
                LASSERTF(open_param == LLOG_OPEN_NEW, "%#x\n", open_param);
@@ -709,17 +704,16 @@ static int llog_lvfs_create(const struct lu_env *env,
                if (IS_ERR(file))
                        RETURN(PTR_ERR(file));
 
                if (IS_ERR(file))
                        RETURN(PTR_ERR(file));
 
-               handle->lgh_id.lgl_oseq = FID_SEQ_LLOG;
-               handle->lgh_id.lgl_oid = file->f_dentry->d_inode->i_ino;
-               handle->lgh_id.lgl_ogen =
-                               file->f_dentry->d_inode->i_generation;
+               lustre_build_llog_lvfs_oid(&handle->lgh_id,
+                               file->f_dentry->d_inode->i_ino,
+                               file->f_dentry->d_inode->i_generation);
                handle->lgh_file = file;
        } else {
                OBDO_ALLOC(oa);
                if (oa == NULL)
                        RETURN(-ENOMEM);
 
                handle->lgh_file = file;
        } else {
                OBDO_ALLOC(oa);
                if (oa == NULL)
                        RETURN(-ENOMEM);
 
-               oa->o_seq = FID_SEQ_LLOG;
+               ostid_set_seq_llog(&oa->o_oi);
                oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
 
                rc = obd_create(NULL, ctxt->loc_exp, oa, NULL, NULL);
                oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
 
                rc = obd_create(NULL, ctxt->loc_exp, oa, NULL, NULL);
@@ -730,8 +724,8 @@ static int llog_lvfs_create(const struct lu_env *env,
                 *        this API along with mds_obd_{create,destroy}.
                 *        Hopefully it is only an internal API issue. */
 #define o_generation o_parent_oid
                 *        this API along with mds_obd_{create,destroy}.
                 *        Hopefully it is only an internal API issue. */
 #define o_generation o_parent_oid
-               dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, oa->o_id,
-                                            oa->o_generation, oa->o_seq);
+               dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, &oa->o_oi,
+                                            oa->o_generation);
                if (IS_ERR(dchild))
                        GOTO(out, rc = PTR_ERR(dchild));
 
                if (IS_ERR(dchild))
                        GOTO(out, rc = PTR_ERR(dchild));
 
@@ -739,8 +733,7 @@ static int llog_lvfs_create(const struct lu_env *env,
                l_dput(dchild);
                if (IS_ERR(file))
                        GOTO(out, rc = PTR_ERR(file));
                l_dput(dchild);
                if (IS_ERR(file))
                        GOTO(out, rc = PTR_ERR(file));
-               handle->lgh_id.lgl_oseq = oa->o_seq;
-               handle->lgh_id.lgl_oid = oa->o_id;
+               handle->lgh_id.lgl_oi = oa->o_oi;
                handle->lgh_id.lgl_ogen = oa->o_generation;
                handle->lgh_file = file;
 out:
                handle->lgh_id.lgl_ogen = oa->o_generation;
                handle->lgh_file = file;
 out:
@@ -760,9 +753,9 @@ static int llog_lvfs_close(const struct lu_env *env,
                RETURN(0);
        rc = filp_close(handle->lgh_file, 0);
        if (rc)
                RETURN(0);
        rc = filp_close(handle->lgh_file, 0);
        if (rc)
-               CERROR("%s: error closing llog #"LPX64"#"LPX64"#%08x: "
+               CERROR("%s: error closing llog #"DOSTID"#%08x: "
                       "rc = %d\n", handle->lgh_ctxt->loc_obd->obd_name,
                       "rc = %d\n", handle->lgh_ctxt->loc_obd->obd_name,
-                      handle->lgh_id.lgl_oid, handle->lgh_id.lgl_oseq,
+                      POSTID(&handle->lgh_id.lgl_oi),
                       handle->lgh_id.lgl_ogen, rc);
        handle->lgh_file = NULL;
        if (handle->lgh_name) {
                       handle->lgh_id.lgl_ogen, rc);
        handle->lgh_file = NULL;
        if (handle->lgh_name) {
@@ -812,9 +805,8 @@ static int llog_lvfs_destroy(const struct lu_env *env,
         if (oa == NULL)
                 RETURN(-ENOMEM);
 
         if (oa == NULL)
                 RETURN(-ENOMEM);
 
-        oa->o_id = handle->lgh_id.lgl_oid;
-        oa->o_seq = handle->lgh_id.lgl_oseq;
-        oa->o_generation = handle->lgh_id.lgl_ogen;
+       oa->o_oi = handle->lgh_id.lgl_oi;
+       oa->o_generation = handle->lgh_id.lgl_ogen;
 #undef o_generation
         oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLGENER;
 
 #undef o_generation
         oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLGENER;
 
index e344f00..75f558a 100644 (file)
@@ -390,9 +390,10 @@ static int llog_osd_write_rec(const struct lu_env *env,
                        /* We assume that caller has set lgh_cur_* */
                        lgi->lgi_off = loghandle->lgh_cur_offset;
                        CDEBUG(D_OTHER,
                        /* We assume that caller has set lgh_cur_* */
                        lgi->lgi_off = loghandle->lgh_cur_offset;
                        CDEBUG(D_OTHER,
-                              "modify record "LPX64": idx:%d/%u/%d, len:%u "
+                              "modify record "DOSTID": idx:%d/%u/%d, len:%u "
                               "offset %llu\n",
                               "offset %llu\n",
-                              loghandle->lgh_id.lgl_oid, idx, rec->lrh_index,
+                              POSTID(&loghandle->lgh_id.lgl_oi), idx,
+                              rec->lrh_index,
                               loghandle->lgh_cur_idx, rec->lrh_len,
                               (long long)(lgi->lgi_off - sizeof(*llh)));
                        if (rec->lrh_index != loghandle->lgh_cur_idx) {
                               loghandle->lgh_cur_idx, rec->lrh_len,
                               (long long)(lgi->lgi_off - sizeof(*llh)));
                        if (rec->lrh_index != loghandle->lgh_cur_idx) {
@@ -494,8 +495,8 @@ out:
                                    &lgi->lgi_off, th);
        }
 
                                    &lgi->lgi_off, th);
        }
 
-       CDEBUG(D_RPCTRACE, "added record "LPX64": idx: %u, %u\n",
-              loghandle->lgh_id.lgl_oid, index, rec->lrh_len);
+       CDEBUG(D_RPCTRACE, "added record "DOSTID": idx: %u, %u\n",
+              POSTID(&loghandle->lgh_id.lgl_oi), index, rec->lrh_len);
        if (rc == 0 && reccookie) {
                reccookie->lgc_lgl = loghandle->lgh_id;
                reccookie->lgc_index = index;
        if (rc == 0 && reccookie) {
                reccookie->lgc_lgl = loghandle->lgh_id;
                reccookie->lgc_index = index;
@@ -606,10 +607,10 @@ static int llog_osd_next_block(const struct lu_env *env,
                        GOTO(out, rc);
 
                if (rc < sizeof(*tail)) {
                        GOTO(out, rc);
 
                if (rc < sizeof(*tail)) {
-                       CERROR("%s: invalid llog block at log id "LPU64"/%u "
+                       CERROR("%s: invalid llog block at log id "DOSTID"/%u "
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
-                              loghandle->lgh_id.lgl_oid,
+                              POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
@@ -632,10 +633,10 @@ static int llog_osd_next_block(const struct lu_env *env,
 
                /* this shouldn't happen */
                if (tail->lrt_index == 0) {
 
                /* this shouldn't happen */
                if (tail->lrt_index == 0) {
-                       CERROR("%s: invalid llog tail at log id "LPU64"/%u "
+                       CERROR("%s: invalid llog tail at log id "DOSTID"/%u "
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
-                              loghandle->lgh_id.lgl_oid,
+                              POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
                               loghandle->lgh_id.lgl_ogen, *cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
@@ -714,10 +715,10 @@ static int llog_osd_prev_block(const struct lu_env *env,
                        GOTO(out, rc);
 
                if (rc < sizeof(*tail)) {
                        GOTO(out, rc);
 
                if (rc < sizeof(*tail)) {
-                       CERROR("%s: invalid llog block at log id "LPU64"/%u "
+                       CERROR("%s: invalid llog block at log id "DOSTID"/%u "
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
-                              loghandle->lgh_id.lgl_oid,
+                              POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
                               loghandle->lgh_id.lgl_ogen, cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
@@ -738,10 +739,10 @@ static int llog_osd_prev_block(const struct lu_env *env,
 
                /* this shouldn't happen */
                if (tail->lrt_index == 0) {
 
                /* this shouldn't happen */
                if (tail->lrt_index == 0) {
-                       CERROR("%s: invalid llog tail at log id "LPU64"/%u "
+                       CERROR("%s: invalid llog tail at log id "DOSTID"/%u "
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
                               "offset "LPU64"\n",
                               o->do_lu.lo_dev->ld_obd->obd_name,
-                              loghandle->lgh_id.lgl_oid,
+                              POSTID(&loghandle->lgh_id.lgl_oi),
                               loghandle->lgh_id.lgl_ogen, cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
                               loghandle->lgh_id.lgl_ogen, cur_offset);
                        GOTO(out, rc = -EINVAL);
                }
index ddb64e5..4136a2d 100644 (file)
@@ -51,8 +51,8 @@
 static void print_llogd_body(struct llogd_body *d)
 {
         CDEBUG(D_OTHER, "llogd body: %p\n", d);
 static void print_llogd_body(struct llogd_body *d)
 {
         CDEBUG(D_OTHER, "llogd body: %p\n", d);
-        CDEBUG(D_OTHER, "\tlgd_logid.lgl_oid: "LPX64"\n", d->lgd_logid.lgl_oid);
-        CDEBUG(D_OTHER, "\tlgd_logid.lgl_oseq: "LPX64"\n", d->lgd_logid.lgl_oseq);
+        CDEBUG(D_OTHER, "\tlgd_logid.lgl_oi: "DOSTID"\n",
+              POSTID(&d->lgd_logid.lgl_oi));
         CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogen: %#x\n", d->lgd_logid.lgl_ogen);
         CDEBUG(D_OTHER, "\tlgd_ctxt_idx: %#x\n", d->lgd_ctxt_idx);
         CDEBUG(D_OTHER, "\tlgd_llh_flags: %#x\n", d->lgd_llh_flags);
         CDEBUG(D_OTHER, "\tlgd_logid.lgl_ogen: %#x\n", d->lgd_logid.lgl_ogen);
         CDEBUG(D_OTHER, "\tlgd_ctxt_idx: %#x\n", d->lgd_ctxt_idx);
         CDEBUG(D_OTHER, "\tlgd_llh_flags: %#x\n", d->lgd_llh_flags);
@@ -62,12 +62,30 @@ static void print_llogd_body(struct llogd_body *d)
         CDEBUG(D_OTHER, "\tlgd_cur_offset: "LPX64"\n", d->lgd_cur_offset);
 }
 
         CDEBUG(D_OTHER, "\tlgd_cur_offset: "LPX64"\n", d->lgd_cur_offset);
 }
 
+void lustre_swab_lu_fid(struct lu_fid *fid)
+{
+        __swab64s (&fid->f_seq);
+        __swab32s (&fid->f_oid);
+        __swab32s (&fid->f_ver);
+}
+EXPORT_SYMBOL(lustre_swab_lu_fid);
+
+void lustre_swab_ost_id(struct ost_id *oid)
+{
+       if (fid_seq_is_mdt0(oid->oi.oi_seq)) {
+               __swab64s(&oid->oi.oi_id);
+               __swab64s(&oid->oi.oi_seq);
+       } else {
+               lustre_swab_lu_fid(&oid->oi_fid);
+       }
+}
+EXPORT_SYMBOL(lustre_swab_ost_id);
+
 void lustre_swab_llogd_body (struct llogd_body *d)
 {
         ENTRY;
         print_llogd_body(d);
 void lustre_swab_llogd_body (struct llogd_body *d)
 {
         ENTRY;
         print_llogd_body(d);
-        __swab64s (&d->lgd_logid.lgl_oid);
-        __swab64s (&d->lgd_logid.lgl_oseq);
+       lustre_swab_ost_id(&d->lgd_logid.lgl_oi);
         __swab32s (&d->lgd_logid.lgl_ogen);
         __swab32s (&d->lgd_ctxt_idx);
         __swab32s (&d->lgd_llh_flags);
         __swab32s (&d->lgd_logid.lgl_ogen);
         __swab32s (&d->lgd_ctxt_idx);
         __swab32s (&d->lgd_llh_flags);
@@ -84,8 +102,7 @@ void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
 {
         __swab64s (&d->lgdc_gen.mnt_cnt);
         __swab64s (&d->lgdc_gen.conn_cnt);
 {
         __swab64s (&d->lgdc_gen.mnt_cnt);
         __swab64s (&d->lgdc_gen.conn_cnt);
-        __swab64s (&d->lgdc_logid.lgl_oid);
-        __swab64s (&d->lgdc_logid.lgl_oseq);
+       lustre_swab_ost_id(&d->lgdc_logid.lgl_oi);
         __swab32s (&d->lgdc_logid.lgl_ogen);
         __swab32s (&d->lgdc_ctxt_idx);
 }
         __swab32s (&d->lgdc_logid.lgl_ogen);
         __swab32s (&d->lgdc_ctxt_idx);
 }
@@ -99,14 +116,6 @@ void lustre_swab_ll_fid(struct ll_fid *fid)
 }
 EXPORT_SYMBOL(lustre_swab_ll_fid);
 
 }
 EXPORT_SYMBOL(lustre_swab_ll_fid);
 
-void lustre_swab_lu_fid(struct lu_fid *fid)
-{
-        __swab64s (&fid->f_seq);
-        __swab32s (&fid->f_oid);
-        __swab32s (&fid->f_ver);
-}
-EXPORT_SYMBOL(lustre_swab_lu_fid);
-
 void lustre_swab_lu_seq_range(struct lu_seq_range *range)
 {
         __swab64s (&range->lsr_start);
 void lustre_swab_lu_seq_range(struct lu_seq_range *range)
 {
         __swab64s (&range->lsr_start);
@@ -196,8 +205,7 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
                struct llog_setattr64_rec *lsr =
                        (struct llog_setattr64_rec *)rec;
 
                struct llog_setattr64_rec *lsr =
                        (struct llog_setattr64_rec *)rec;
 
-               __swab64s(&lsr->lsr_oid);
-               __swab64s(&lsr->lsr_oseq);
+               lustre_swab_ost_id(&lsr->lsr_oi);
                __swab32s(&lsr->lsr_uid);
                __swab32s(&lsr->lsr_uid_h);
                __swab32s(&lsr->lsr_gid);
                __swab32s(&lsr->lsr_uid);
                __swab32s(&lsr->lsr_uid_h);
                __swab32s(&lsr->lsr_gid);
@@ -223,14 +231,13 @@ void lustre_swab_llog_rec(struct llog_rec_hdr *rec)
         }
        case LLOG_LOGID_MAGIC:
        {
         }
        case LLOG_LOGID_MAGIC:
        {
-                struct llog_logid_rec *lid = (struct llog_logid_rec *)rec;
+               struct llog_logid_rec *lid = (struct llog_logid_rec *)rec;
 
 
-                __swab64s(&lid->lid_id.lgl_oid);
-                __swab64s(&lid->lid_id.lgl_oseq);
-                __swab32s(&lid->lid_id.lgl_ogen);
+               lustre_swab_ost_id(&lid->lid_id.lgl_oi);
+               __swab32s(&lid->lid_id.lgl_ogen);
                tail = &lid->lid_tail;
                tail = &lid->lid_tail;
-                break;
-        }
+               break;
+       }
        case LLOG_GEN_REC:
        {
                struct llog_gen_rec *lgr = (struct llog_gen_rec *)rec;
        case LLOG_GEN_REC:
        {
                struct llog_gen_rec *lgr = (struct llog_gen_rec *)rec;
index 54e964f..c63fcee 100644 (file)
@@ -433,7 +433,7 @@ static int cat_print_cb(const struct lu_env *env, struct llog_handle *llh,
                        struct llog_rec_hdr *rec, void *data)
 {
        struct llog_logid_rec   *lir = (struct llog_logid_rec *)rec;
                        struct llog_rec_hdr *rec, void *data)
 {
        struct llog_logid_rec   *lir = (struct llog_logid_rec *)rec;
-       struct lu_fid            fid;
+       struct lu_fid            fid = {0};
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
 
        if (rec->lrh_type != LLOG_LOGID_MAGIC) {
                CERROR("invalid record in catalog\n");
@@ -456,7 +456,7 @@ static int plain_counter;
 static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
                          struct llog_rec_hdr *rec, void *data)
 {
 static int plain_print_cb(const struct lu_env *env, struct llog_handle *llh,
                          struct llog_rec_hdr *rec, void *data)
 {
-       struct lu_fid fid;
+       struct lu_fid fid = {0};
 
        if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
                CERROR("log is not plain\n");
 
        if (!(llh->lgh_hdr->llh_flags & LLOG_F_IS_PLAIN)) {
                CERROR("log is not plain\n");
@@ -703,7 +703,7 @@ static union {
 static int test_7_print_cb(const struct lu_env *env, struct llog_handle *llh,
                           struct llog_rec_hdr *rec, void *data)
 {
 static int test_7_print_cb(const struct lu_env *env, struct llog_handle *llh,
                           struct llog_rec_hdr *rec, void *data)
 {
-       struct lu_fid fid;
+       struct lu_fid fid = {0};
 
        logid_to_fid(&llh->lgh_id, &fid);
 
 
        logid_to_fid(&llh->lgh_id, &fid);
 
index a0175aa..6883833 100644 (file)
@@ -122,8 +122,8 @@ EXPORT_SYMBOL(obdo_from_inode);
 void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid)
 {
 #ifdef __KERNEL__
 void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid)
 {
 #ifdef __KERNEL__
-        CDEBUG(D_INODE, "src obdo "LPX64" valid "LPX64", dst obdo "LPX64"\n",
-               src->o_id, src->o_valid, dst->o_id);
+        CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n",
+               POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi));
 #endif
         if (valid & OBD_MD_FLATIME)
                 dst->o_atime = src->o_atime;
 #endif
         if (valid & OBD_MD_FLATIME)
                 dst->o_atime = src->o_atime;
@@ -207,11 +207,10 @@ EXPORT_SYMBOL(obdo_cmp_md);
 
 void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj)
 {
 
 void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj)
 {
-       ioobj->ioo_id = oa->o_id;
-       if (oa->o_valid & OBD_MD_FLGROUP)
-               ioobj->ioo_seq = oa->o_seq;
-       else
-               ioobj->ioo_seq = 0;
+       ioobj->ioo_oid = oa->o_oi;
+       if (unlikely(!(oa->o_valid & OBD_MD_FLGROUP)))
+               ostid_set_seq_mdt0(&ioobj->ioo_oid);
+
        /* Since 2.4 this does not contain o_mode in the low 16 bits.
         * Instead, it holds (bd_md_max_brw - 1) for multi-bulk BRW RPCs */
        ioobj->ioo_max_brw = 0;
        /* Since 2.4 this does not contain o_mode in the low 16 bits.
         * Instead, it holds (bd_md_max_brw - 1) for multi-bulk BRW RPCs */
        ioobj->ioo_max_brw = 0;
index af69bbf..34a5847 100644 (file)
@@ -137,10 +137,11 @@ static int echo_create(const struct lu_env *env, struct obd_export *exp,
                 return -EINVAL;
         }
 
                 return -EINVAL;
         }
 
-        oa->o_id = echo_next_id(obd);
-        oa->o_valid = OBD_MD_FLID;
+       ostid_set_seq_echo(&oa->o_oi);
+       ostid_set_id(&oa->o_oi, echo_next_id(obd));
+       oa->o_valid = OBD_MD_FLID;
 
 
-        return 0;
+       return 0;
 }
 
 static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
 }
 
 static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
@@ -162,10 +163,11 @@ static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
                 RETURN(-EINVAL);
         }
 
                 RETURN(-EINVAL);
         }
 
-        if (oa->o_id > obd->u.echo.eo_lastino || oa->o_id < ECHO_INIT_OID) {
-                CERROR("bad destroy objid: "LPX64"\n", oa->o_id);
-                RETURN(-EINVAL);
-        }
+       if (ostid_id(&oa->o_oi) > obd->u.echo.eo_lastino ||
+           ostid_id(&oa->o_oi) < ECHO_INIT_OID) {
+               CERROR("bad destroy objid: "DOSTID"\n", POSTID(&oa->o_oi));
+               RETURN(-EINVAL);
+       }
 
         RETURN(0);
 }
 
         RETURN(0);
 }
@@ -173,8 +175,8 @@ static int echo_destroy(const struct lu_env *env, struct obd_export *exp,
 static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
                         struct obd_info *oinfo)
 {
 static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
                         struct obd_info *oinfo)
 {
-        struct obd_device *obd = class_exp2obd(exp);
-        obd_id id = oinfo->oi_oa->o_id;
+       struct obd_device *obd = class_exp2obd(exp);
+       obd_id id = ostid_id(&oinfo->oi_oa->o_oi);
 
         ENTRY;
         if (!obd) {
 
         ENTRY;
         if (!obd) {
@@ -189,10 +191,11 @@ static int echo_getattr(const struct lu_env *env, struct obd_export *exp,
                 RETURN(-EINVAL);
         }
 
                 RETURN(-EINVAL);
         }
 
-        obdo_cpy_md(oinfo->oi_oa, &obd->u.echo.eo_oa, oinfo->oi_oa->o_valid);
-        oinfo->oi_oa->o_id = id;
+       obdo_cpy_md(oinfo->oi_oa, &obd->u.echo.eo_oa, oinfo->oi_oa->o_valid);
+       ostid_set_seq_echo(&oinfo->oi_oa->o_oi);
+       ostid_set_id(&oinfo->oi_oa->o_oi, id);
 
 
-        RETURN(0);
+       RETURN(0);
 }
 
 static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
 }
 
 static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
@@ -215,7 +218,7 @@ static int echo_setattr(const struct lu_env *env, struct obd_export *exp,
 
         memcpy(&obd->u.echo.eo_oa, oinfo->oi_oa, sizeof(*oinfo->oi_oa));
 
 
         memcpy(&obd->u.echo.eo_oa, oinfo->oi_oa, sizeof(*oinfo->oi_oa));
 
-        if (oinfo->oi_oa->o_id & 4) {
+        if (ostid_id(&oinfo->oi_oa->o_oi) & 4) {
                 /* Save lock to force ACKed reply */
                 ldlm_lock_addref (&obd->u.echo.eo_nl_lock, LCK_NL);
                 oti->oti_ack_locks[0].mode = LCK_NL;
                 /* Save lock to force ACKed reply */
                 ldlm_lock_addref (&obd->u.echo.eo_nl_lock, LCK_NL);
                 oti->oti_ack_locks[0].mode = LCK_NL;
@@ -288,14 +291,15 @@ static int echo_map_nb_to_lb(struct obdo *oa, struct obd_ioobj *obj,
                              struct niobuf_remote *nb, int *pages,
                              struct niobuf_local *lb, int cmd, int *left)
 {
                              struct niobuf_remote *nb, int *pages,
                              struct niobuf_local *lb, int cmd, int *left)
 {
-        int gfp_mask = (obj->ioo_id & 1) ? CFS_ALLOC_HIGHUSER : CFS_ALLOC_STD;
-        int ispersistent = obj->ioo_id == ECHO_PERSISTENT_OBJID;
-        int debug_setup = (!ispersistent &&
-                           (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
-                           (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
-        struct niobuf_local *res = lb;
-        obd_off offset = nb->offset;
-        int len = nb->len;
+       int gfp_mask = (ostid_id(&obj->ioo_oid) & 1) ?
+                       CFS_ALLOC_HIGHUSER : CFS_ALLOC_STD;
+       int ispersistent = ostid_id(&obj->ioo_oid) == ECHO_PERSISTENT_OBJID;
+       int debug_setup = (!ispersistent &&
+                          (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
+                          (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
+       struct niobuf_local *res = lb;
+       obd_off offset = nb->offset;
+       int len = nb->len;
 
         while (len > 0) {
                 int plen = CFS_PAGE_SIZE - (offset & (CFS_PAGE_SIZE-1));
 
         while (len > 0) {
                 int plen = CFS_PAGE_SIZE - (offset & (CFS_PAGE_SIZE-1));
@@ -322,8 +326,8 @@ static int echo_map_nb_to_lb(struct obdo *oa, struct obd_ioobj *obj,
                 } else {
                         OBD_PAGE_ALLOC(res->page, gfp_mask);
                         if (res->page == NULL) {
                 } else {
                         OBD_PAGE_ALLOC(res->page, gfp_mask);
                         if (res->page == NULL) {
-                                CERROR("can't get page for id " LPU64"\n",
-                                       obj->ioo_id);
+                                CERROR("can't get page for id " DOSTID"\n",
+                                       POSTID(&obj->ioo_oid));
                                 return -ENOMEM;
                         }
                 }
                                 return -ENOMEM;
                         }
                 }
@@ -334,8 +338,9 @@ static int echo_map_nb_to_lb(struct obdo *oa, struct obd_ioobj *obj,
                 if (cmd & OBD_BRW_READ)
                         res->rc = res->len;
 
                 if (cmd & OBD_BRW_READ)
                         res->rc = res->len;
 
-                if (debug_setup)
-                        echo_page_debug_setup(res->page, cmd, obj->ioo_id,
+               if (debug_setup)
+                       echo_page_debug_setup(res->page, cmd,
+                                             ostid_id(&obj->ioo_oid),
                                              res->lnb_file_offset, res->len);
 
                 offset += plen;
                                              res->lnb_file_offset, res->len);
 
                 offset += plen;
@@ -364,25 +369,27 @@ static int echo_finalize_lb(struct obdo *oa, struct obd_ioobj *obj,
                 cfs_page_t *page = res->page;
                 void       *addr;
 
                 cfs_page_t *page = res->page;
                 void       *addr;
 
-                if (page == NULL) {
-                        CERROR("null page objid "LPU64":%p, buf %d/%d\n",
-                               obj->ioo_id, page, i, obj->ioo_bufcnt);
-                        return -EFAULT;
-                }
+               if (page == NULL) {
+                       CERROR("null page objid "LPU64":%p, buf %d/%d\n",
+                              ostid_id(&obj->ioo_oid), page, i,
+                              obj->ioo_bufcnt);
+                       return -EFAULT;
+               }
 
                 addr = cfs_kmap(page);
 
                 CDEBUG(D_PAGE, "$$$$ use page %p, addr %p@"LPU64"\n",
                       res->page, addr, res->lnb_file_offset);
 
 
                 addr = cfs_kmap(page);
 
                 CDEBUG(D_PAGE, "$$$$ use page %p, addr %p@"LPU64"\n",
                       res->page, addr, res->lnb_file_offset);
 
-                if (verify) {
-                        int vrc = echo_page_debug_check(page, obj->ioo_id,
+               if (verify) {
+                       int vrc = echo_page_debug_check(page,
+                                                       ostid_id(&obj->ioo_oid),
                                                        res->lnb_file_offset,
                                                        res->len);
                                                        res->lnb_file_offset,
                                                        res->len);
-                        /* check all the pages always */
-                        if (vrc != 0 && rc == 0)
-                                rc = vrc;
-                }
+                       /* check all the pages always */
+                       if (vrc != 0 && rc == 0)
+                               rc = vrc;
+               }
 
                 cfs_kunmap(page);
                 /* NB see comment above regarding persistent pages */
 
                 cfs_kunmap(page);
                 /* NB see comment above regarding persistent pages */
@@ -504,27 +511,27 @@ static int echo_commitrw(const struct lu_env *env, int cmd,
 
         LASSERT(oti == NULL || oti->oti_handle == (void *)DESC_PRIV);
 
 
         LASSERT(oti == NULL || oti->oti_handle == (void *)DESC_PRIV);
 
-        for (i = 0; i < objcount; i++, obj++) {
-                int verify = (rc == 0 &&
-                              obj->ioo_id != ECHO_PERSISTENT_OBJID &&
-                              (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
-                              (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
-                int j;
-
-                for (j = 0 ; j < obj->ioo_bufcnt ; j++, rb++) {
-                        int vrc = echo_finalize_lb(oa, obj, rb, &pgs, &res[pgs], verify);
+       for (i = 0; i < objcount; i++, obj++) {
+               int verify = (rc == 0 &&
+                            ostid_id(&obj->ioo_oid) != ECHO_PERSISTENT_OBJID &&
+                             (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
+                             (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
+               int j;
 
 
-                        if (vrc == 0)
-                                continue;
+               for (j = 0 ; j < obj->ioo_bufcnt ; j++, rb++) {
+                       int vrc = echo_finalize_lb(oa, obj, rb, &pgs, &res[pgs],
+                                                  verify);
+                       if (vrc == 0)
+                               continue;
 
 
-                        if (vrc == -EFAULT)
-                                GOTO(commitrw_cleanup, rc = vrc);
+                       if (vrc == -EFAULT)
+                               GOTO(commitrw_cleanup, rc = vrc);
 
 
-                        if (rc == 0)
-                                rc = vrc;
-                }
+                       if (rc == 0)
+                               rc = vrc;
+               }
 
 
-        }
+       }
 
         cfs_atomic_sub(pgs, &obd->u.echo.eo_prep);
 
 
         cfs_atomic_sub(pgs, &obd->u.echo.eo_prep);
 
index e4b9118..cb89ac4 100644 (file)
@@ -535,7 +535,7 @@ static int echo_alloc_memmd(struct echo_device *ed,
 
        loi_init((*lsmp)->lsm_oinfo[0]);
        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
 
        loi_init((*lsmp)->lsm_oinfo[0]);
        (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES;
-       (*lsmp)->lsm_oi.oi_seq = FID_SEQ_ECHO;
+       ostid_set_seq_echo(&(*lsmp)->lsm_oi);
 
        RETURN(lsm_size);
 }
 
        RETURN(lsm_size);
 }
@@ -1114,7 +1114,7 @@ static struct echo_object *cl_echo_object_find(struct echo_device *d,
         conf->eoc_md = lsmp;
 
         fid  = &info->eti_fid;
         conf->eoc_md = lsmp;
 
         fid  = &info->eti_fid;
-       ostid_fid_unpack(&lsm->lsm_oi, fid);
+       ostid_to_fid(fid, &lsm->lsm_oi, 0);
 
        /* In the function below, .hs_keycmp resolves to
         * lu_obj_hop_keycmp() */
 
        /* In the function below, .hs_keycmp resolves to
         * lu_obj_hop_keycmp() */
@@ -2118,8 +2118,8 @@ static void echo_ucred_fini(struct lu_env *env)
 #define ECHO_MD_CTX_TAG (LCT_REMEMBER | LCT_MD_THREAD)
 #define ECHO_MD_SES_TAG (LCT_REMEMBER | LCT_SESSION)
 static int echo_md_handler(struct echo_device *ed, int command,
 #define ECHO_MD_CTX_TAG (LCT_REMEMBER | LCT_MD_THREAD)
 #define ECHO_MD_SES_TAG (LCT_REMEMBER | LCT_SESSION)
 static int echo_md_handler(struct echo_device *ed, int command,
-                           char *path, int path_len, int id, int count,
-                           struct obd_ioctl_data *data)
+                          char *path, int path_len, __u64 id, int count,
+                          struct obd_ioctl_data *data)
 {
        struct echo_thread_info *info;
         struct lu_device      *ld = ed->ed_next;
 {
        struct echo_thread_info *info;
         struct lu_device      *ld = ed->ed_next;
@@ -2183,9 +2183,7 @@ static int echo_md_handler(struct echo_device *ed, int command,
                 int stripe_count = (int)data->ioc_obdo2.o_misc;
                 int stripe_index = (int)data->ioc_obdo2.o_stripe_idx;
 
                 int stripe_count = (int)data->ioc_obdo2.o_misc;
                 int stripe_index = (int)data->ioc_obdo2.o_stripe_idx;
 
-                fid->f_seq = data->ioc_obdo1.o_seq;
-                fid->f_oid = (__u32)data->ioc_obdo1.o_id;
-                fid->f_ver = 0;
+               ostid_to_fid(fid, &data->ioc_obdo1.o_oi, 0);
                /* In the function below, .hs_keycmp resolves to
                 * lu_obj_hop_keycmp() */
                /* coverity[overrun-buffer-val] */
                /* In the function below, .hs_keycmp resolves to
                 * lu_obj_hop_keycmp() */
                /* coverity[overrun-buffer-val] */
@@ -2274,7 +2272,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
 
                /* setup stripes: indices + default ids if required */
                for (i = 0; i < lsm->lsm_stripe_count; i++) {
 
                /* setup stripes: indices + default ids if required */
                for (i = 0; i < lsm->lsm_stripe_count; i++) {
-                       if (lsm->lsm_oinfo[i]->loi_id == 0)
+                       if (ostid_id(&lsm->lsm_oinfo[i]->loi_oi) == 0)
                                lsm->lsm_oinfo[i]->loi_oi = lsm->lsm_oi;
 
                        lsm->lsm_oinfo[i]->loi_ost_idx =
                                lsm->lsm_oinfo[i]->loi_oi = lsm->lsm_oi;
 
                        lsm->lsm_oinfo[i]->loi_ost_idx =
@@ -2283,24 +2281,26 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
         }
 
        /* setup object ID here for !on_target and LOV hint */
         }
 
        /* setup object ID here for !on_target and LOV hint */
-       if (oa->o_valid & OBD_MD_FLID)
-               lsm->lsm_oi.oi_id = oa->o_id;
+       if (oa->o_valid & OBD_MD_FLID) {
+               LASSERT(oa->o_valid & OBD_MD_FLGROUP);
+               lsm->lsm_oi = oa->o_oi;
+       }
 
        if (ostid_id(&lsm->lsm_oi) == 0)
 
        if (ostid_id(&lsm->lsm_oi) == 0)
-               lsm->lsm_oi.oi_id = ++last_object_id;
+               ostid_set_id(&lsm->lsm_oi, ++last_object_id);
 
         rc = 0;
 
         rc = 0;
-        if (on_target) {
-                /* Only echo objects are allowed to be created */
-                LASSERT((oa->o_valid & OBD_MD_FLGROUP) &&
-                        (oa->o_seq == FID_SEQ_ECHO));
-                rc = obd_create(env, ec->ec_exp, oa, &lsm, oti);
-                if (rc != 0) {
-                        CERROR("Cannot create objects: rc = %d\n", rc);
-                        GOTO(failed, rc);
-                }
-                created = 1;
-        }
+       if (on_target) {
+               /* Only echo objects are allowed to be created */
+               LASSERT((oa->o_valid & OBD_MD_FLGROUP) &&
+                       (ostid_seq(&oa->o_oi) == FID_SEQ_ECHO));
+               rc = obd_create(env, ec->ec_exp, oa, &lsm, oti);
+               if (rc != 0) {
+                       CERROR("Cannot create objects: rc = %d\n", rc);
+                       GOTO(failed, rc);
+               }
+               created = 1;
+       }
 
         /* See what object ID we were given */
        oa->o_oi = lsm->lsm_oi;
 
         /* See what object ID we were given */
        oa->o_oi = lsm->lsm_oi;
@@ -2311,7 +2311,7 @@ static int echo_create_object(const struct lu_env *env, struct echo_device *ed,
                 GOTO(failed, rc = PTR_ERR(eco));
         cl_echo_object_put(eco);
 
                 GOTO(failed, rc = PTR_ERR(eco));
         cl_echo_object_put(eco);
 
-        CDEBUG(D_INFO, "oa->o_id = %lx\n", (long)oa->o_id);
+        CDEBUG(D_INFO, "oa oid "DOSTID"\n", POSTID(&oa->o_oi));
         EXIT;
 
  failed:
         EXIT;
 
  failed:
@@ -2332,9 +2332,8 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
         int                     rc;
         ENTRY;
 
         int                     rc;
         ENTRY;
 
-        if ((oa->o_valid & OBD_MD_FLID) == 0 ||
-            oa->o_id == 0)  /* disallow use of object id 0 */
-        {
+        if ((oa->o_valid & OBD_MD_FLID) == 0 || ostid_id(&oa->o_oi) == 0) {
+               /* disallow use of object id 0 */
                 CERROR ("No valid oid\n");
                 RETURN(-EINVAL);
         }
                 CERROR ("No valid oid\n");
                 RETURN(-EINVAL);
         }
@@ -2345,7 +2344,7 @@ static int echo_get_object(struct echo_object **ecop, struct echo_device *ed,
 
        lsm->lsm_oi = oa->o_oi;
        if (!(oa->o_valid & OBD_MD_FLGROUP))
 
        lsm->lsm_oi = oa->o_oi;
        if (!(oa->o_valid & OBD_MD_FLGROUP))
-               lsm->lsm_oi.oi_seq = FID_SEQ_ECHO;
+               ostid_set_seq_echo(&lsm->lsm_oi);
 
         rc = 0;
         eco = cl_echo_object_find(ed, &lsm);
 
         rc = 0;
         eco = cl_echo_object_find(ed, &lsm);
@@ -2389,8 +2388,8 @@ echo_get_stripe_off_id (struct lov_stripe_md *lsm, obd_off *offp, obd_id *idp)
 
         stripe_index = woffset / stripe_size;
 
 
         stripe_index = woffset / stripe_size;
 
-        *idp = lsm->lsm_oinfo[stripe_index]->loi_id;
-        *offp = offset * stripe_size + woffset % stripe_size;
+       *idp = ostid_id(&lsm->lsm_oinfo[stripe_index]->loi_oi);
+       *offp = offset * stripe_size + woffset % stripe_size;
 }
 
 static void
 }
 
 static void
@@ -2476,11 +2475,11 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
         int                     brw_flags = 0;
         ENTRY;
 
         int                     brw_flags = 0;
         ENTRY;
 
-        verify = ((oa->o_id) != ECHO_PERSISTENT_OBJID &&
+        verify = (ostid_id(&oa->o_oi) != ECHO_PERSISTENT_OBJID &&
                   (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
                   (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
 
                   (oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
                   (oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
 
-        gfp_mask = ((oa->o_id & 2) == 0) ? CFS_ALLOC_STD : CFS_ALLOC_HIGHUSER;
+        gfp_mask = ((ostid_id(&oa->o_oi) & 2) == 0) ? CFS_ALLOC_STD : CFS_ALLOC_HIGHUSER;
 
        LASSERT(rw == OBD_BRW_WRITE || rw == OBD_BRW_READ);
        LASSERT(lsm != NULL);
 
        LASSERT(rw == OBD_BRW_WRITE || rw == OBD_BRW_READ);
        LASSERT(lsm != NULL);
@@ -2522,9 +2521,10 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
                 pgp->off = off;
                 pgp->flag = brw_flags;
 
                 pgp->off = off;
                 pgp->flag = brw_flags;
 
-                if (verify)
-                        echo_client_page_debug_setup(lsm, pgp->pg, rw,
-                                                     oa->o_id, off, pgp->count);
+               if (verify)
+                       echo_client_page_debug_setup(lsm, pgp->pg, rw,
+                                                    ostid_id(&oa->o_oi), off,
+                                                    pgp->count);
         }
 
         /* brw mode can only be used at client */
         }
 
         /* brw mode can only be used at client */
@@ -2539,14 +2539,15 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
                 if (pgp->pg == NULL)
                         continue;
 
                 if (pgp->pg == NULL)
                         continue;
 
-                if (verify) {
-                        int vrc;
-                        vrc = echo_client_page_debug_check(lsm, pgp->pg, oa->o_id,
-                                                           pgp->off, pgp->count);
-                        if (vrc != 0 && rc == 0)
-                                rc = vrc;
-                }
-                OBD_PAGE_FREE(pgp->pg);
+               if (verify) {
+                       int vrc;
+                       vrc = echo_client_page_debug_check(lsm, pgp->pg,
+                                                          ostid_id(&oa->o_oi),
+                                                          pgp->off, pgp->count);
+                       if (vrc != 0 && rc == 0)
+                               rc = vrc;
+               }
+               OBD_PAGE_FREE(pgp->pg);
         }
         OBD_FREE(pga, npages * sizeof(*pga));
         OBD_FREE(pages, npages * sizeof(*pages));
         }
         OBD_FREE(pga, npages * sizeof(*pga));
         OBD_FREE(pages, npages * sizeof(*pages));
@@ -2622,22 +2623,22 @@ static int echo_client_prep_commit(const struct lu_env *env,
                         if (async)
                                 lnb[i].flags |= OBD_BRW_ASYNC;
 
                         if (async)
                                 lnb[i].flags |= OBD_BRW_ASYNC;
 
-                        if (oa->o_id == ECHO_PERSISTENT_OBJID ||
-                            (oa->o_valid & OBD_MD_FLFLAGS) == 0 ||
-                            (oa->o_flags & OBD_FL_DEBUG_CHECK) == 0)
-                                continue;
-
-                        if (rw == OBD_BRW_WRITE)
-                                echo_client_page_debug_setup(lsm, page, rw,
-                                                             oa->o_id,
-                                                             rnb[i].offset,
-                                                             rnb[i].len);
-                        else
-                                echo_client_page_debug_check(lsm, page,
-                                                             oa->o_id,
-                                                             rnb[i].offset,
-                                                             rnb[i].len);
-                }
+                       if (ostid_id(&oa->o_oi) == ECHO_PERSISTENT_OBJID ||
+                           (oa->o_valid & OBD_MD_FLFLAGS) == 0 ||
+                           (oa->o_flags & OBD_FL_DEBUG_CHECK) == 0)
+                               continue;
+
+                       if (rw == OBD_BRW_WRITE)
+                               echo_client_page_debug_setup(lsm, page, rw,
+                                                           ostid_id(&oa->o_oi),
+                                                            rnb[i].offset,
+                                                            rnb[i].len);
+                       else
+                               echo_client_page_debug_check(lsm, page,
+                                                           ostid_id(&oa->o_oi),
+                                                            rnb[i].offset,
+                                                            rnb[i].len);
+               }
 
                ret = obd_commitrw(env, rw, exp, oa, 1, &ioo,
                                   rnb, npages, lnb, oti, ret);
 
                ret = obd_commitrw(env, rw, exp, oa, 1, &ioo,
                                   rnb, npages, lnb, oti, ret);
@@ -2783,14 +2784,14 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
         memset(&dummy_oti, 0, sizeof(dummy_oti));
 
 
         memset(&dummy_oti, 0, sizeof(dummy_oti));
 
-        oa = &data->ioc_obdo1;
-        if (!(oa->o_valid & OBD_MD_FLGROUP)) {
-                oa->o_valid |= OBD_MD_FLGROUP;
-                oa->o_seq = FID_SEQ_ECHO;
-        }
+       oa = &data->ioc_obdo1;
+       if (!(oa->o_valid & OBD_MD_FLGROUP)) {
+               oa->o_valid |= OBD_MD_FLGROUP;
+               ostid_set_seq_echo(&oa->o_oi);
+       }
 
         /* This FID is unpacked just for validation at this point */
 
         /* This FID is unpacked just for validation at this point */
-        rc = fid_ostid_unpack(&fid, &oa->o_oi, 0);
+        rc = ostid_to_fid(&fid, &oa->o_oi, 0);
         if (rc < 0)
                 RETURN(rc);
 
         if (rc < 0)
                 RETURN(rc);
 
@@ -2811,35 +2812,35 @@ echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                                         data->ioc_plen1, &dummy_oti);
                 GOTO(out, rc);
 
                                         data->ioc_plen1, &dummy_oti);
                 GOTO(out, rc);
 
-        case OBD_IOC_ECHO_MD: {
-                int count;
-                int cmd;
-                char *dir = NULL;
-                int dirlen;
-                __u64 id;
+       case OBD_IOC_ECHO_MD: {
+               int count;
+               int cmd;
+               char *dir = NULL;
+               int dirlen;
+               __u64 id;
 
 
-                if (!cfs_capable(CFS_CAP_SYS_ADMIN))
-                        GOTO(out, rc = -EPERM);
+               if (!cfs_capable(CFS_CAP_SYS_ADMIN))
+                       GOTO(out, rc = -EPERM);
 
 
-                count = data->ioc_count;
-                cmd = data->ioc_command;
+               count = data->ioc_count;
+               cmd = data->ioc_command;
 
 
-                id = data->ioc_obdo2.o_id;
+               id = ostid_id(&data->ioc_obdo2.o_oi);
 
 
-                dirlen = data->ioc_plen1;
-                OBD_ALLOC(dir, dirlen + 1);
-                if (dir == NULL)
-                        GOTO(out, rc = -ENOMEM);
+               dirlen = data->ioc_plen1;
+               OBD_ALLOC(dir, dirlen + 1);
+               if (dir == NULL)
+                       GOTO(out, rc = -ENOMEM);
 
 
-                if (cfs_copy_from_user(dir, data->ioc_pbuf1, dirlen)) {
-                        OBD_FREE(dir, data->ioc_plen1 + 1);
-                        GOTO(out, rc = -EFAULT);
-                }
+               if (cfs_copy_from_user(dir, data->ioc_pbuf1, dirlen)) {
+                       OBD_FREE(dir, data->ioc_plen1 + 1);
+                       GOTO(out, rc = -EFAULT);
+               }
 
 
-                rc = echo_md_handler(ed, cmd, dir, dirlen, id, count, data);
-                OBD_FREE(dir, dirlen + 1);
-                GOTO(out, rc);
-        }
+               rc = echo_md_handler(ed, cmd, dir, dirlen, id, count, data);
+               OBD_FREE(dir, dirlen + 1);
+               GOTO(out, rc);
+       }
         case OBD_IOC_ECHO_ALLOC_SEQ: {
                 struct lu_env   *cl_env;
                 int              refcheck;
         case OBD_IOC_ECHO_ALLOC_SEQ: {
                 struct lu_env   *cl_env;
                 int              refcheck;
index 0d91844..6b31949 100644 (file)
@@ -191,8 +191,7 @@ static int lprocfs_ofd_rd_last_id(char *page, char **start, off_t off,
 
        read_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
 
        read_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
-               rc = snprintf(page, count, LPX64": "LPX64"\n",
-                             oseq->os_seq, ofd_seq_last_oid(oseq));
+               rc = snprintf(page, count, DOSTID"\n", POSTID(&oseq->os_oi));
                if (rc < 0) {
                        retval = rc;
                        break;
                if (rc < 0) {
                        retval = rc;
                        break;
index 9b61f58..2c10049 100644 (file)
@@ -85,7 +85,7 @@ struct ofd_seq *ofd_seq_get(struct ofd_device *ofd, obd_seq seq)
 
        read_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
 
        read_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
-               if (oseq->os_seq == seq) {
+               if (ostid_seq(&oseq->os_oi) == seq) {
                        cfs_atomic_inc(&oseq->os_refc);
                        read_unlock(&ofd->ofd_seq_list_lock);
                        return oseq;
                        cfs_atomic_inc(&oseq->os_refc);
                        read_unlock(&ofd->ofd_seq_list_lock);
                        return oseq;
@@ -132,7 +132,7 @@ static struct ofd_seq *ofd_seq_add(const struct lu_env *env,
 
        write_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(os, &ofd->ofd_seq_list, os_list) {
 
        write_lock(&ofd->ofd_seq_list_lock);
        cfs_list_for_each_entry(os, &ofd->ofd_seq_list, os_list) {
-               if (os->os_seq == new_seq->os_seq) {
+               if (ostid_seq(&os->os_oi) == ostid_seq(&new_seq->os_oi)) {
                        cfs_atomic_inc(&os->os_refc);
                        write_unlock(&ofd->ofd_seq_list_lock);
                        /* The seq has not been added to the list */
                        cfs_atomic_inc(&os->os_refc);
                        write_unlock(&ofd->ofd_seq_list_lock);
                        /* The seq has not been added to the list */
@@ -152,7 +152,7 @@ obd_id ofd_seq_last_oid(struct ofd_seq *oseq)
        obd_id id;
 
        spin_lock(&oseq->os_last_oid_lock);
        obd_id id;
 
        spin_lock(&oseq->os_last_oid_lock);
-       id = oseq->os_last_oid;
+       id = ostid_id(&oseq->os_oi);
        spin_unlock(&oseq->os_last_oid_lock);
 
        return id;
        spin_unlock(&oseq->os_last_oid_lock);
 
        return id;
@@ -161,8 +161,8 @@ obd_id ofd_seq_last_oid(struct ofd_seq *oseq)
 void ofd_seq_last_oid_set(struct ofd_seq *oseq, obd_id id)
 {
        spin_lock(&oseq->os_last_oid_lock);
 void ofd_seq_last_oid_set(struct ofd_seq *oseq, obd_id id)
 {
        spin_lock(&oseq->os_last_oid_lock);
-       if (likely(oseq->os_last_oid < id))
-               oseq->os_last_oid = id;
+       if (likely(ostid_id(&oseq->os_oi) < id))
+               ostid_set_id(&oseq->os_oi, id);
        spin_unlock(&oseq->os_last_oid_lock);
 }
 
        spin_unlock(&oseq->os_last_oid_lock);
 }
 
@@ -175,17 +175,18 @@ int ofd_seq_last_oid_write(const struct lu_env *env, struct ofd_device *ofd,
 
        ENTRY;
 
 
        ENTRY;
 
+       tmp = cpu_to_le64(ofd_seq_last_oid(oseq));
+
        info->fti_buf.lb_buf = &tmp;
        info->fti_buf.lb_len = sizeof(tmp);
        info->fti_off = 0;
 
        info->fti_buf.lb_buf = &tmp;
        info->fti_buf.lb_len = sizeof(tmp);
        info->fti_off = 0;
 
-       CDEBUG(D_INODE, "%s: write last_objid for seq "LPX64" : "LPX64"\n",
-              ofd_name(ofd), oseq->os_seq, ofd_seq_last_oid(oseq));
-
-       tmp = cpu_to_le64(ofd_seq_last_oid(oseq));
-
        rc = ofd_record_write(env, ofd, oseq->os_lastid_obj, &info->fti_buf,
                              &info->fti_off);
        rc = ofd_record_write(env, ofd, oseq->os_lastid_obj, &info->fti_buf,
                              &info->fti_off);
+
+       CDEBUG(D_INODE, "%s: write last_objid "DOSTID": rc = %d\n",
+              ofd_name(ofd), POSTID(&oseq->os_oi), rc);
+
        RETURN(rc);
 }
 
        RETURN(rc);
 }
 
@@ -296,7 +297,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
        CFS_INIT_LIST_HEAD(&oseq->os_list);
        mutex_init(&oseq->os_create_lock);
        spin_lock_init(&oseq->os_last_oid_lock);
        CFS_INIT_LIST_HEAD(&oseq->os_list);
        mutex_init(&oseq->os_create_lock);
        spin_lock_init(&oseq->os_last_oid_lock);
-       oseq->os_seq = seq;
+       ostid_set_seq(&oseq->os_oi, seq);
 
        cfs_atomic_set(&oseq->os_refc, 1);
 
 
        cfs_atomic_set(&oseq->os_refc, 1);
 
@@ -306,7 +307,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
 
        if (info->fti_attr.la_size == 0) {
                /* object is just created, initialize last id */
 
        if (info->fti_attr.la_size == 0) {
                /* object is just created, initialize last id */
-               oseq->os_last_oid = OFD_INIT_OBJID;
+               ofd_seq_last_oid_set(oseq, OFD_INIT_OBJID);
                ofd_seq_last_oid_write(env, ofd, oseq);
        } else if (info->fti_attr.la_size == sizeof(lastid)) {
                info->fti_off = 0;
                ofd_seq_last_oid_write(env, ofd, oseq);
        } else if (info->fti_attr.la_size == sizeof(lastid)) {
                info->fti_off = 0;
@@ -319,7 +320,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
                                ofd_name(ofd), rc);
                        GOTO(cleanup, rc);
                }
                                ofd_name(ofd), rc);
                        GOTO(cleanup, rc);
                }
-               oseq->os_last_oid = le64_to_cpu(lastid);
+               ofd_seq_last_oid_set(oseq, le64_to_cpu(lastid));
        } else {
                CERROR("%s: corrupted size "LPU64" LAST_ID of seq "LPX64"\n",
                        ofd_name(ofd), (__u64)info->fti_attr.la_size, seq);
        } else {
                CERROR("%s: corrupted size "LPU64" LAST_ID of seq "LPX64"\n",
                        ofd_name(ofd), (__u64)info->fti_attr.la_size, seq);
index e329154..f4ac047 100644 (file)
@@ -107,7 +107,7 @@ static inline void ofd_counter_incr(struct obd_export *exp, int opcode,
 
 struct ofd_seq {
        cfs_list_t              os_list;
 
 struct ofd_seq {
        cfs_list_t              os_list;
-       struct  ost_id          os_oi;
+       struct ost_id           os_oi;
        spinlock_t              os_last_oid_lock;
        struct mutex            os_create_lock;
        cfs_atomic_t            os_refc;
        spinlock_t              os_last_oid_lock;
        struct mutex            os_create_lock;
        cfs_atomic_t            os_refc;
@@ -115,9 +115,6 @@ struct ofd_seq {
        unsigned long           os_destroys_in_progress:1;
 };
 
        unsigned long           os_destroys_in_progress:1;
 };
 
-#define os_seq         os_oi.oi_seq
-#define os_last_oid    os_oi.oi_id
-
 struct ofd_device {
        struct dt_device         ofd_dt_dev;
        struct dt_device        *ofd_osd;
 struct ofd_device {
        struct dt_device         ofd_dt_dev;
        struct dt_device        *ofd_osd;
@@ -531,34 +528,6 @@ static inline struct ofd_thread_info * ofd_info_init(const struct lu_env *env,
        return info;
 }
 
        return info;
 }
 
-/* The same as osc_build_res_name() */
-static inline void ofd_build_resid(const struct lu_fid *fid,
-                                  struct ldlm_res_id *resname)
-{
-       struct ost_id oid;
-
-       if (fid_is_idif(fid)) {
-               oid.oi_id = fid_idif_id(fid_seq(fid), fid_oid(fid),
-                                       fid_ver(fid));
-               oid.oi_seq = FID_SEQ_OST_MDT0;
-       } else {
-               oid.oi_id = fid_oid(fid);
-               oid.oi_seq = fid_seq(fid);
-       }
-       ostid_build_res_name(&oid, resname);
-}
-
-static inline void ofd_fid_from_resid(struct lu_fid *fid,
-                                     const struct ldlm_res_id *name)
-{
-       /* To keep compatiblity, res[0] = oi_id, res[1] = oi_seq. */
-       struct ost_id ostid;
-
-       ostid.oi_id = name->name[LUSTRE_RES_ID_SEQ_OFF];
-       ostid.oi_seq = name->name[LUSTRE_RES_ID_VER_OID_OFF];
-       fid_ostid_unpack(fid, &ostid, 0);
-}
-
 static inline void ofd_oti2info(struct ofd_thread_info *info,
                                struct obd_trans_info *oti)
 {
 static inline void ofd_oti2info(struct ofd_thread_info *info,
                                struct obd_trans_info *oti)
 {
@@ -593,7 +562,7 @@ static inline void ofd_slc_set(struct ofd_device *ofd)
 static inline void ofd_prepare_fidea(struct filter_fid *ff, struct obdo *oa)
 {
        if (!(oa->o_valid & OBD_MD_FLGROUP))
 static inline void ofd_prepare_fidea(struct filter_fid *ff, struct obdo *oa)
 {
        if (!(oa->o_valid & OBD_MD_FLGROUP))
-               oa->o_seq = 0;
+               ostid_set_seq_mdt0(&oa->o_oi);
        /* packing fid and converting it to LE for storing into EA.
         * Here ->o_stripe_idx should be filled by LOV and rest of
         * fields - by client. */
        /* packing fid and converting it to LE for storing into EA.
         * Here ->o_stripe_idx should be filled by LOV and rest of
         * fields - by client. */
index ea54334..8655093 100644 (file)
@@ -143,8 +143,8 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
 
        ofd_read_lock(env, fo);
        if (!ofd_object_exists(fo)) {
 
        ofd_read_lock(env, fo);
        if (!ofd_object_exists(fo)) {
-               CERROR("%s: BRW to missing obj "LPU64"/"LPU64"\n",
-                      exp->exp_obd->obd_name, obj->ioo_id, obj->ioo_seq);
+               CERROR("%s: BRW to missing obj "DOSTID"\n",
+                      exp->exp_obd->obd_name, POSTID(&obj->ioo_oid));
                ofd_read_unlock(env, fo);
                ofd_object_put(env, fo);
                GOTO(out, rc = -ENOENT);
                ofd_read_unlock(env, fo);
                ofd_object_put(env, fo);
                GOTO(out, rc = -ENOENT);
@@ -222,11 +222,11 @@ int ofd_preprw(const struct lu_env* env, int cmd, struct obd_export *exp,
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
                struct ofd_seq          *oseq;
 
        if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
                struct ofd_seq          *oseq;
-               oseq = ofd_seq_load(env, ofd, oa->o_seq);
+               oseq = ofd_seq_load(env, ofd, ostid_seq(&oa->o_oi));
                if (IS_ERR(oseq)) {
                if (IS_ERR(oseq)) {
-                       CERROR("%s: Can not find seq for "LPU64":"LPU64
-                              ": rc = %ld\n", ofd_name(ofd), oa->o_seq,
-                              oa->o_id, PTR_ERR(oseq));
+                       CERROR("%s: Can not find seq for "DOSTID
+                              ": rc = %ld\n", ofd_name(ofd), POSTID(&oa->o_oi),
+                              PTR_ERR(oseq));
                        RETURN(-EINVAL);
                }
 
                        RETURN(-EINVAL);
                }
 
@@ -243,9 +243,9 @@ int ofd_preprw(const struct lu_env* env, int cmd, struct obd_export *exp,
        LASSERT(objcount == 1);
        LASSERT(obj->ioo_bufcnt > 0);
 
        LASSERT(objcount == 1);
        LASSERT(obj->ioo_bufcnt > 0);
 
-       fid_ostid_unpack(&info->fti_fid, &oa->o_oi, 0);
+       ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
        if (cmd == OBD_BRW_WRITE) {
        if (cmd == OBD_BRW_WRITE) {
-               rc = ofd_auth_capa(exp, &info->fti_fid, oa->o_seq,
+               rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
                                   capa, CAPA_OPC_OSS_WRITE);
                if (rc == 0) {
                        la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
                                   capa, CAPA_OPC_OSS_WRITE);
                if (rc == 0) {
                        la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
@@ -254,7 +254,7 @@ int ofd_preprw(const struct lu_env* env, int cmd, struct obd_export *exp,
                                              obj, rnb, nr_local, lnb, oti);
                }
        } else if (cmd == OBD_BRW_READ) {
                                              obj, rnb, nr_local, lnb, oti);
                }
        } else if (cmd == OBD_BRW_READ) {
-               rc = ofd_auth_capa(exp, &info->fti_fid, oa->o_seq,
+               rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
                                   capa, CAPA_OPC_OSS_READ);
                if (rc == 0) {
                        ofd_grant_prepare_read(env, exp, oa);
                                   capa, CAPA_OPC_OSS_READ);
                if (rc == 0) {
                        ofd_grant_prepare_read(env, exp, oa);
@@ -502,7 +502,7 @@ int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
 
        LASSERT(npages > 0);
 
 
        LASSERT(npages > 0);
 
-       fid_ostid_unpack(&info->fti_fid, &oa->o_oi, 0);
+       ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
        if (cmd == OBD_BRW_WRITE) {
                /* Don't update timestamps if this write is older than a
                 * setattr which modifies the timestamps. b=10150 */
        if (cmd == OBD_BRW_WRITE) {
                /* Don't update timestamps if this write is older than a
                 * setattr which modifies the timestamps. b=10150 */
@@ -563,7 +563,7 @@ int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
                if (oa && ns && ns->ns_lvbo && ns->ns_lvbo->lvbo_update) {
                         struct ldlm_resource *rs = NULL;
 
                if (oa && ns && ns->ns_lvbo && ns->ns_lvbo->lvbo_update) {
                         struct ldlm_resource *rs = NULL;
 
-                       ofd_build_resid(&info->fti_fid, &info->fti_resid);
+                       ost_fid_build_resid(&info->fti_fid, &info->fti_resid);
                        rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
                                               LDLM_EXTENT, 0);
                        if (rs != NULL) {
                        rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
                                               LDLM_EXTENT, 0);
                        if (rs != NULL) {
index fa1e6f4..7d6408f 100644 (file)
@@ -87,7 +87,7 @@ static int ofd_lvbo_init(struct ldlm_resource *res)
        res->lr_lvb_len = sizeof(*lvb);
 
        info = ofd_info_init(&env, NULL);
        res->lr_lvb_len = sizeof(*lvb);
 
        info = ofd_info_init(&env, NULL);
-       ofd_fid_from_resid(&info->fti_fid, &res->lr_name);
+       ost_fid_from_resid(&info->fti_fid, &res->lr_name);
        fo = ofd_object_find(&env, ofd, &info->fti_fid);
        if (IS_ERR(fo))
                GOTO(out, rc = PTR_ERR(fo));
        fo = ofd_object_find(&env, ofd, &info->fti_fid);
        if (IS_ERR(fo))
                GOTO(out, rc = PTR_ERR(fo));
@@ -221,7 +221,7 @@ static int ofd_lvbo_update(struct ldlm_resource *res,
 
 disk_update:
        /* Update the LVB from the disk inode */
 
 disk_update:
        /* Update the LVB from the disk inode */
-       ofd_fid_from_resid(&info->fti_fid, &res->lr_name);
+       ost_fid_from_resid(&info->fti_fid, &res->lr_name);
        fo = ofd_object_find(&env, ofd, &info->fti_fid);
        if (IS_ERR(fo))
                GOTO(out_env, rc = PTR_ERR(fo));
        fo = ofd_object_find(&env, ofd, &info->fti_fid);
        if (IS_ERR(fo))
                GOTO(out_env, rc = PTR_ERR(fo));
index 3bc97a0..1bc3ccd 100644 (file)
@@ -589,9 +589,7 @@ static int ofd_get_info(const struct lu_env *env, struct obd_export *exp,
                }
 
                info = ofd_info_init(env, exp);
                }
 
                info = ofd_info_init(env, exp);
-
-               fid_ostid_unpack(&info->fti_fid, &fm_key->oa.o_oi, 0);
-
+               ostid_to_fid(&info->fti_fid, &fm_key->oa.o_oi, 0);
                CDEBUG(D_INODE, "get FIEMAP of object "DFID"\n",
                       PFID(&info->fti_fid));
 
                CDEBUG(D_INODE, "get FIEMAP of object "DFID"\n",
                       PFID(&info->fti_fid));
 
@@ -622,15 +620,15 @@ static int ofd_get_info(const struct lu_env *env, struct obd_export *exp,
                struct lu_env           env;
                struct ofd_device       *ofd = ofd_exp(exp);
                struct ofd_seq          *oseq;
                struct lu_env           env;
                struct ofd_device       *ofd = ofd_exp(exp);
                struct ofd_seq          *oseq;
-               struct ost_id           *oid = val;
+               struct lu_fid           *fid = val;
                int                     rc;
 
                int                     rc;
 
-               if (oid == NULL) {
-                       *vallen = sizeof(struct ost_id);
+               if (fid == NULL) {
+                       *vallen = sizeof(struct lu_fid);
                        RETURN(0);
                }
 
                        RETURN(0);
                }
 
-               if (*vallen < sizeof(*oid))
+               if (*vallen < sizeof(*fid))
                        RETURN(-EOVERFLOW);
 
                rc = lu_env_init(&env, LCT_DT_THREAD);
                        RETURN(-EOVERFLOW);
 
                rc = lu_env_init(&env, LCT_DT_THREAD);
@@ -638,16 +636,18 @@ static int ofd_get_info(const struct lu_env *env, struct obd_export *exp,
                        RETURN(rc);
                ofd_info_init(&env, exp);
 
                        RETURN(rc);
                ofd_info_init(&env, exp);
 
-               ostid_le_to_cpu(oid, oid);
+               fid_le_to_cpu(fid, fid);
 
 
-               oseq = ofd_seq_load(&env, ofd, oid->oi_seq);
+               oseq = ofd_seq_load(&env, ofd, ostid_seq((struct ost_id *)fid));
                if (IS_ERR(oseq))
                        GOTO(out_fini, rc = PTR_ERR(oseq));
 
                if (IS_ERR(oseq))
                        GOTO(out_fini, rc = PTR_ERR(oseq));
 
-               CDEBUG(D_HA, "LAST FID is "DOSTID"\n", POSTID(&oseq->os_oi));
+               ostid_to_fid(fid, &oseq->os_oi,
+                            ofd->ofd_lut.lut_lsd.lsd_osd_index);
 
 
-               *oid = oseq->os_oi;
-               *vallen = sizeof(*oid);
+               CDEBUG(D_HA, "%s: LAST FID is "DFID"\n", ofd_name(ofd),
+                      PFID(fid));
+               *vallen = sizeof(*fid);
                ofd_seq_put(&env, oseq);
 out_fini:
                lu_env_fini(&env);
                ofd_seq_put(&env, oseq);
 out_fini:
                lu_env_fini(&env);
@@ -829,10 +829,10 @@ int ofd_setattr(const struct lu_env *env, struct obd_export *exp,
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
-       fid_ostid_unpack(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
-       ofd_build_resid(&info->fti_fid, &info->fti_resid);
+       ostid_to_fid(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
+       ost_fid_build_resid(&info->fti_fid, &info->fti_resid);
 
 
-       rc = ofd_auth_capa(exp, &info->fti_fid, oa->o_seq,
+       rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oa->o_oi),
                           oinfo_capa(oinfo), CAPA_OPC_META_WRITE);
        if (rc)
                GOTO(out, rc);
                           oinfo_capa(oinfo), CAPA_OPC_META_WRITE);
        if (rc)
                GOTO(out, rc);
@@ -915,15 +915,15 @@ static int ofd_punch(const struct lu_env *env, struct obd_export *exp,
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
-       fid_ostid_unpack(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
-       ofd_build_resid(&info->fti_fid, &info->fti_resid);
+       ostid_to_fid(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
+       ost_fid_build_resid(&info->fti_fid, &info->fti_resid);
 
        CDEBUG(D_INODE, "calling punch for object "DFID", valid = "LPX64
               ", start = "LPD64", end = "LPD64"\n", PFID(&info->fti_fid),
               oinfo->oi_oa->o_valid, oinfo->oi_policy.l_extent.start,
               oinfo->oi_policy.l_extent.end);
 
 
        CDEBUG(D_INODE, "calling punch for object "DFID", valid = "LPX64
               ", start = "LPD64", end = "LPD64"\n", PFID(&info->fti_fid),
               oinfo->oi_oa->o_valid, oinfo->oi_policy.l_extent.start,
               oinfo->oi_policy.l_extent.end);
 
-       rc = ofd_auth_capa(exp, &info->fti_fid, oinfo->oi_oa->o_seq,
+       rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oinfo->oi_oa->o_oi),
                           oinfo_capa(oinfo), CAPA_OPC_OSS_TRUNC);
        if (rc)
                GOTO(out_env, rc);
                           oinfo_capa(oinfo), CAPA_OPC_OSS_TRUNC);
        if (rc)
                GOTO(out_env, rc);
@@ -1002,7 +1002,7 @@ static int ofd_destroy_by_fid(const struct lu_env *env,
 
        /* Tell the clients that the object is gone now and that they should
         * throw away any cached pages. */
 
        /* Tell the clients that the object is gone now and that they should
         * throw away any cached pages. */
-       ofd_build_resid(fid, &info->fti_resid);
+       ost_fid_build_resid(fid, &info->fti_resid);
        rc = ldlm_cli_enqueue_local(ofd->ofd_namespace, &info->fti_resid,
                                    LDLM_EXTENT, &policy, LCK_PW, &flags,
                                    ldlm_blocking_ast, ldlm_completion_ast,
        rc = ldlm_cli_enqueue_local(ofd->ofd_namespace, &info->fti_resid,
                                    LDLM_EXTENT, &policy, LCK_PW, &flags,
                                    ldlm_blocking_ast, ldlm_completion_ast,
@@ -1036,7 +1036,7 @@ int ofd_destroy(const struct lu_env *env, struct obd_export *exp,
        ofd_oti2info(info, oti);
 
        if (!(oa->o_valid & OBD_MD_FLGROUP))
        ofd_oti2info(info, oti);
 
        if (!(oa->o_valid & OBD_MD_FLGROUP))
-               oa->o_seq = 0;
+               ostid_set_seq_mdt0(&oa->o_oi);
 
        /* check that o_misc makes sense */
        if (oa->o_valid & OBD_MD_FLOBJCOUNT)
 
        /* check that o_misc makes sense */
        if (oa->o_valid & OBD_MD_FLOBJCOUNT)
@@ -1052,10 +1052,13 @@ int ofd_destroy(const struct lu_env *env, struct obd_export *exp,
         */
        if (info->fti_transno == 0) /* not replay */
                info->fti_mult_trans = 1;
         */
        if (info->fti_transno == 0) /* not replay */
                info->fti_mult_trans = 1;
+
+       CDEBUG(D_HA, "%s: Destroy object "DOSTID" count %d\n", ofd_name(ofd),
+              POSTID(&oa->o_oi), count);
        while (count > 0) {
                int lrc;
 
        while (count > 0) {
                int lrc;
 
-               fid_ostid_unpack(&info->fti_fid, &oa->o_oi, 0);
+               ostid_to_fid(&info->fti_fid, &oa->o_oi, 0);
                lrc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 0);
                if (lrc == -ENOENT) {
                        CDEBUG(D_INODE,
                lrc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 0);
                if (lrc == -ENOENT) {
                        CDEBUG(D_INODE,
@@ -1071,7 +1074,7 @@ int ofd_destroy(const struct lu_env *env, struct obd_export *exp,
                        rc = lrc;
                }
                count--;
                        rc = lrc;
                }
                count--;
-               oa->o_id++;
+               ostid_inc_id(&oa->o_oi);
        }
 
        /* if we have transaction then there were some deletions, we don't
        }
 
        /* if we have transaction then there were some deletions, we don't
@@ -1103,14 +1106,15 @@ static int ofd_orphans_destroy(const struct lu_env *env,
        int                      skip_orphan;
        int                      rc = 0;
        struct ost_id            oi = oa->o_oi;
        int                      skip_orphan;
        int                      rc = 0;
        struct ost_id            oi = oa->o_oi;
+       __u64                    end_id = ostid_id(&oa->o_oi);
        struct ofd_seq          *oseq;
 
        ENTRY;
 
        struct ofd_seq          *oseq;
 
        ENTRY;
 
-       oseq = ofd_seq_get(ofd, oa->o_seq);
+       oseq = ofd_seq_get(ofd, ostid_seq(&oa->o_oi));
        if (oseq == NULL) {
        if (oseq == NULL) {
-               CERROR("%s: Can not find seq for "LPU64":"LPU64"\n",
-                      ofd_name(ofd), oa->o_seq, oa->o_id);
+               CERROR("%s: Can not find seq for "DOSTID"\n",
+                      ofd_name(ofd), POSTID(&oa->o_oi));
                RETURN(-EINVAL);
        }
 
                RETURN(-EINVAL);
        }
 
@@ -1119,31 +1123,32 @@ static int ofd_orphans_destroy(const struct lu_env *env,
 
        last = ofd_seq_last_oid(oseq);
        LCONSOLE_INFO("%s: deleting orphan objects from "LPX64":"LPU64
 
        last = ofd_seq_last_oid(oseq);
        LCONSOLE_INFO("%s: deleting orphan objects from "LPX64":"LPU64
-                     " to "LPU64"\n", ofd_name(ofd), oa->o_seq,
-                     oa->o_id + 1, last);
+                     " to "LPU64"\n", ofd_name(ofd), ostid_seq(&oa->o_oi),
+                     end_id + 1, last);
 
 
-       for (oi.oi_id = last; oi.oi_id > oa->o_id; oi.oi_id--) {
-               fid_ostid_unpack(&info->fti_fid, &oi, 0);
+       for (ostid_set_id(&oi, last); ostid_id(&oi) > end_id;
+                         ostid_dec_id(&oi)) {
+               ostid_to_fid(&info->fti_fid, &oi, 0);
                rc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 1);
                if (rc && rc != -ENOENT) /* this is pretty fatal... */
                rc = ofd_destroy_by_fid(env, ofd, &info->fti_fid, 1);
                if (rc && rc != -ENOENT) /* this is pretty fatal... */
-                       CEMERG("error destroying precreated id "LPU64": %d\n",
-                              oi.oi_id, rc);
+                       CEMERG("error destroying precreated id "DOSTID": %d\n",
+                              POSTID(&oi), rc);
                if (!skip_orphan) {
                if (!skip_orphan) {
-                       ofd_seq_last_oid_set(oseq, oi.oi_id - 1);
+                       ofd_seq_last_oid_set(oseq, ostid_id(&oi) - 1);
                        /* update last_id on disk periodically so that if we
                         * restart * we don't need to re-scan all of the just
                         * deleted objects. */
                        /* update last_id on disk periodically so that if we
                         * restart * we don't need to re-scan all of the just
                         * deleted objects. */
-                       if ((oi.oi_id & 511) == 0)
+                       if ((ostid_id(&oi) & 511) == 0)
                                ofd_seq_last_oid_write(env, ofd, oseq);
                }
        }
                                ofd_seq_last_oid_write(env, ofd, oseq);
                }
        }
-       CDEBUG(D_HA, "%s: after destroy: set last_objids["LPU64"] = "LPU64"\n",
-              ofd_obd(ofd)->obd_name, oa->o_seq, oa->o_id);
+       CDEBUG(D_HA, "%s: after destroy: set last_objids"DOSTID"\n",
+              ofd_obd(ofd)->obd_name, POSTID(&oa->o_oi));
        if (!skip_orphan) {
                rc = ofd_seq_last_oid_write(env, ofd, oseq);
        } else {
                /* don't reuse orphan object, return last used objid */
        if (!skip_orphan) {
                rc = ofd_seq_last_oid_write(env, ofd, oseq);
        } else {
                /* don't reuse orphan object, return last used objid */
-               oa->o_id = last;
+               ostid_set_id(&oa->o_oi, last);
                rc = 0;
        }
        ofd_seq_put(env, oseq);
                rc = 0;
        }
        ofd_seq_put(env, oseq);
@@ -1156,7 +1161,7 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
 {
        struct ofd_device       *ofd = ofd_exp(exp);
        struct ofd_thread_info  *info;
 {
        struct ofd_device       *ofd = ofd_exp(exp);
        struct ofd_thread_info  *info;
-       obd_seq                 seq = oa->o_seq;
+       obd_seq                 seq = ostid_seq(&oa->o_oi);
        struct ofd_seq          *oseq;
        int                     rc = 0, diff;
        int                     sync_trans = 0;
        struct ofd_seq          *oseq;
        int                     rc = 0, diff;
        int                     sync_trans = 0;
@@ -1166,11 +1171,10 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
        info = ofd_info_init(env, exp);
        ofd_oti2info(info, oti);
 
-       LASSERT(oa->o_seq >= FID_SEQ_OST_MDT0);
+       LASSERT(ostid_seq(&oa->o_oi) >= FID_SEQ_OST_MDT0);
        LASSERT(oa->o_valid & OBD_MD_FLGROUP);
 
        LASSERT(oa->o_valid & OBD_MD_FLGROUP);
 
-       CDEBUG(D_INFO, "ofd_create(oa->o_seq="LPU64",oa->o_id="LPU64")\n",
-              seq, oa->o_id);
+       CDEBUG(D_INFO, "ofd_create("DOSTID")\n", POSTID(&oa->o_oi));
 
        oseq = ofd_seq_load(env, ofd, seq);
        if (IS_ERR(oseq)) {
 
        oseq = ofd_seq_load(env, ofd, seq);
        if (IS_ERR(oseq)) {
@@ -1182,9 +1186,9 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
        if ((oa->o_valid & OBD_MD_FLFLAGS) &&
            (oa->o_flags & OBD_FL_RECREATE_OBJS)) {
                if (!ofd_obd(ofd)->obd_recovering ||
        if ((oa->o_valid & OBD_MD_FLFLAGS) &&
            (oa->o_flags & OBD_FL_RECREATE_OBJS)) {
                if (!ofd_obd(ofd)->obd_recovering ||
-                   oa->o_id > ofd_seq_last_oid(oseq)) {
-                       CERROR("recreate objid "LPU64" > last id "LPU64"\n",
-                                       oa->o_id, ofd_seq_last_oid(oseq));
+                   ostid_id(&oa->o_oi) > ofd_seq_last_oid(oseq)) {
+                       CERROR("recreate objid "DOSTID" > last id "LPU64"\n",
+                              POSTID(&oa->o_oi), ofd_seq_last_oid(oseq));
                        GOTO(out_nolock, rc = -EINVAL);
                }
                /* do nothing because we create objects during first write */
                        GOTO(out_nolock, rc = -EINVAL);
                }
                /* do nothing because we create objects during first write */
@@ -1203,11 +1207,12 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
                oseq->os_destroys_in_progress = 1;
                mutex_lock(&oseq->os_create_lock);
                if (!oseq->os_destroys_in_progress) {
                oseq->os_destroys_in_progress = 1;
                mutex_lock(&oseq->os_create_lock);
                if (!oseq->os_destroys_in_progress) {
-                       CERROR("%s:["LPU64"] destroys_in_progress already cleared\n",
-                              exp->exp_obd->obd_name, oa->o_seq);
+                       CERROR("%s:["LPU64"] destroys_in_progress already"
+                              " cleared\n", exp->exp_obd->obd_name,
+                              ostid_seq(&oa->o_oi));
                        GOTO(out, rc = 0);
                }
                        GOTO(out, rc = 0);
                }
-               diff = oa->o_id - ofd_seq_last_oid(oseq);
+               diff = ostid_id(&oa->o_oi) - ofd_seq_last_oid(oseq);
                CDEBUG(D_HA, "ofd_last_id() = "LPU64" -> diff = %d\n",
                        ofd_seq_last_oid(oseq), diff);
                if (-diff > OST_MAX_PRECREATE) {
                CDEBUG(D_HA, "ofd_last_id() = "LPU64" -> diff = %d\n",
                        ofd_seq_last_oid(oseq), diff);
                if (-diff > OST_MAX_PRECREATE) {
@@ -1229,24 +1234,25 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
                }
                /* only precreate if seq is 0, IDIF or normal and also o_id
                 * must be specfied */
                }
                /* only precreate if seq is 0, IDIF or normal and also o_id
                 * must be specfied */
-               if ((!fid_seq_is_mdt(oa->o_seq) &&
-                    !fid_seq_is_norm(oa->o_seq) &&
-                    !fid_seq_is_idif(oa->o_seq)) || oa->o_id == 0) {
+               if ((!fid_seq_is_mdt(ostid_seq(&oa->o_oi)) &&
+                    !fid_seq_is_norm(ostid_seq(&oa->o_oi)) &&
+                    !fid_seq_is_idif(ostid_seq(&oa->o_oi))) ||
+                               ostid_id(&oa->o_oi) == 0) {
                        diff = 1; /* shouldn't we create this right now? */
                } else {
                        diff = 1; /* shouldn't we create this right now? */
                } else {
-                       diff = oa->o_id - ofd_seq_last_oid(oseq);
+                       diff = ostid_id(&oa->o_oi) - ofd_seq_last_oid(oseq);
                        /* Do sync create if the seq is about to used up */
                        /* Do sync create if the seq is about to used up */
-                       if (fid_seq_is_idif(oa->o_seq) ||
-                           fid_seq_is_mdt0(oa->o_seq)) {
-                               if (unlikely(oa->o_id >= IDIF_MAX_OID - 1))
+                       if (fid_seq_is_idif(ostid_seq(&oa->o_oi)) ||
+                           fid_seq_is_mdt0(ostid_seq(&oa->o_oi))) {
+                               if (unlikely(ostid_id(&oa->o_oi) >= IDIF_MAX_OID - 1))
                                        sync_trans = 1;
                                        sync_trans = 1;
-                       } else if (fid_seq_is_norm(oa->o_seq)) {
-                               if (unlikely(oa->o_id >=
+                       } else if (fid_seq_is_norm(ostid_seq(&oa->o_oi))) {
+                               if (unlikely(ostid_id(&oa->o_oi) >=
                                             LUSTRE_DATA_SEQ_MAX_WIDTH - 1))
                                        sync_trans = 1;
                        } else {
                                             LUSTRE_DATA_SEQ_MAX_WIDTH - 1))
                                        sync_trans = 1;
                        } else {
-                               CERROR("%s : invalid o_seq "LPX64": rc = %d\n",
-                                      ofd_name(ofd), oa->o_seq, -EINVAL);
+                               CERROR("%s : invalid o_seq "DOSTID": rc = %d\n",
+                                      ofd_name(ofd), POSTID(&oa->o_oi), -EINVAL);
                                GOTO(out, rc = -EINVAL);
                        }
                }
                                GOTO(out, rc = -EINVAL);
                        }
                }
@@ -1275,9 +1281,9 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
                        next_id = ofd_seq_last_oid(oseq) + 1;
                        count = ofd_precreate_batch(ofd, diff);
 
                        next_id = ofd_seq_last_oid(oseq) + 1;
                        count = ofd_precreate_batch(ofd, diff);
 
-                       CDEBUG(D_HA, "%s: reserve %d objects in group "LPU64
+                       CDEBUG(D_HA, "%s: reserve %d objects in group "LPX64
                               " at "LPU64"\n", ofd_obd(ofd)->obd_name,
                               " at "LPU64"\n", ofd_obd(ofd)->obd_name,
-                              count, oa->o_seq, next_id);
+                              count, ostid_seq(&oa->o_oi), next_id);
 
                        if (cfs_time_after(jiffies, enough_time)) {
                                LCONSOLE_WARN("%s: Slow creates, %d/%d objects"
 
                        if (cfs_time_after(jiffies, enough_time)) {
                                LCONSOLE_WARN("%s: Slow creates, %d/%d objects"
@@ -1305,7 +1311,7 @@ int ofd_create(const struct lu_env *env, struct obd_export *exp,
                        CERROR("%s: unable to precreate: rc = %d\n",
                               ofd_name(ofd), rc);
 
                        CERROR("%s: unable to precreate: rc = %d\n",
                               ofd_name(ofd), rc);
 
-               oa->o_id = ofd_seq_last_oid(oseq);
+               ostid_set_id(&oa->o_oi, ofd_seq_last_oid(oseq));
                oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
 
                if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
                oa->o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
 
                if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
@@ -1340,8 +1346,8 @@ int ofd_getattr(const struct lu_env *env, struct obd_export *exp,
 
        info = ofd_info_init(env, exp);
 
 
        info = ofd_info_init(env, exp);
 
-       fid_ostid_unpack(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
-       rc = ofd_auth_capa(exp, &info->fti_fid, oinfo->oi_oa->o_seq,
+       ostid_to_fid(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
+       rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oinfo->oi_oa->o_oi),
                           oinfo_capa(oinfo), CAPA_OPC_META_READ);
        if (rc)
                GOTO(out, rc);
                           oinfo_capa(oinfo), CAPA_OPC_META_READ);
        if (rc)
                GOTO(out, rc);
@@ -1385,9 +1391,9 @@ static int ofd_sync(const struct lu_env *env, struct obd_export *exp,
        }
 
        info = ofd_info_init(env, exp);
        }
 
        info = ofd_info_init(env, exp);
-       fid_ostid_unpack(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
+       ostid_to_fid(&info->fti_fid, &oinfo->oi_oa->o_oi, 0);
 
 
-       rc = ofd_auth_capa(exp, &info->fti_fid, oinfo->oi_oa->o_seq,
+       rc = ofd_auth_capa(exp, &info->fti_fid, ostid_seq(&oinfo->oi_oa->o_oi),
                           oinfo_capa(oinfo), CAPA_OPC_OSS_TRUNC);
        if (rc)
                GOTO(out, rc);
                           oinfo_capa(oinfo), CAPA_OPC_OSS_TRUNC);
        if (rc)
                GOTO(out, rc);
@@ -1444,9 +1450,9 @@ static int ofd_ioc_get_obj_version(const struct lu_env *env,
                   data->ioc_inllen4 == sizeof(__u64)) {
                struct ost_id ostid;
 
                   data->ioc_inllen4 == sizeof(__u64)) {
                struct ost_id ostid;
 
-               ostid.oi_id = *(__u64 *)data->ioc_inlbuf3;
-               ostid.oi_seq = *(__u64 *)data->ioc_inlbuf4;
-               rc = fid_ostid_unpack(&fid, &ostid, 0);
+               ostid_set_seq(&ostid, *(__u64 *)data->ioc_inlbuf4);
+               ostid_set_id(&ostid, *(__u64 *)data->ioc_inlbuf3);
+               rc = ostid_to_fid(&fid, &ostid, 0);
                if (rc != 0)
                        GOTO(out, rc);
        } else {
                if (rc != 0)
                        GOTO(out, rc);
        } else {
index b05972d..1c11679 100644 (file)
@@ -160,14 +160,15 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
        ENTRY;
 
        /* Don't create objects beyond the valid range for this SEQ */
        ENTRY;
 
        /* Don't create objects beyond the valid range for this SEQ */
-       if (unlikely(fid_seq_is_mdt0(oseq->os_seq) && (id + nr) >= IDIF_MAX_OID)) {
+       if (unlikely(fid_seq_is_mdt0(ostid_seq(&oseq->os_oi)) &&
+                    (id + nr) >= IDIF_MAX_OID)) {
                CERROR("%s:"DOSTID" hit the IDIF_MAX_OID (1<<48)!\n",
                CERROR("%s:"DOSTID" hit the IDIF_MAX_OID (1<<48)!\n",
-                      ofd_name(ofd), id, oseq->os_seq);
+                      ofd_name(ofd), id, ostid_seq(&oseq->os_oi));
                RETURN(rc = -ENOSPC);
                RETURN(rc = -ENOSPC);
-       } else if (unlikely(!fid_seq_is_mdt0(oseq->os_seq) &&
+       } else if (unlikely(!fid_seq_is_mdt0(ostid_seq(&oseq->os_oi)) &&
                            (id + nr) >= OBIF_MAX_OID)) {
                CERROR("%s:"DOSTID" hit the OBIF_MAX_OID (1<<32)!\n",
                            (id + nr) >= OBIF_MAX_OID)) {
                CERROR("%s:"DOSTID" hit the OBIF_MAX_OID (1<<32)!\n",
-                      ofd_name(ofd), id, oseq->os_seq);
+                      ofd_name(ofd), id, ostid_seq(&oseq->os_oi));
                RETURN(rc = -ENOSPC);
        }
 
                RETURN(rc = -ENOSPC);
        }
 
@@ -193,11 +194,10 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
        info->fti_attr.la_ctime = 0;
 
        /* prepare objects */
        info->fti_attr.la_ctime = 0;
 
        /* prepare objects */
+       ostid_set_seq(&info->fti_ostid, ostid_seq(&oseq->os_oi));
        for (i = 0; i < nr; i++) {
        for (i = 0; i < nr; i++) {
-               info->fti_ostid.oi_id = id + i;
-               info->fti_ostid.oi_seq = oseq->os_seq;
-
-               rc = fid_ostid_unpack(&info->fti_fid, &info->fti_ostid, 0);
+               ostid_set_id(&info->fti_ostid, id + i);
+               rc = ostid_to_fid(&info->fti_fid, &info->fti_ostid, 0);
                if (rc) {
                        if (i == 0)
                                GOTO(out, rc = PTR_ERR(fo));
                if (rc) {
                        if (i == 0)
                                GOTO(out, rc = PTR_ERR(fo));
@@ -240,7 +240,7 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
                if (unlikely(ofd_object_exists(fo))) {
                        /* object may exist being re-created by write replay */
                        CDEBUG(D_INODE, "object "LPX64"/"LPX64" exists: "
                if (unlikely(ofd_object_exists(fo))) {
                        /* object may exist being re-created by write replay */
                        CDEBUG(D_INODE, "object "LPX64"/"LPX64" exists: "
-                              DFID"\n", oseq->os_seq, id,
+                              DFID"\n", ostid_seq(&oseq->os_oi), id,
                               PFID(&info->fti_fid));
                        continue;
                }
                               PFID(&info->fti_fid));
                        continue;
                }
@@ -260,7 +260,8 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
        if (rc)
                GOTO(trans_stop, rc);
 
        if (rc)
                GOTO(trans_stop, rc);
 
-       CDEBUG(D_OTHER, "create new object "DFID"\n", PFID(&info->fti_fid));
+       CDEBUG(D_OTHER, "%s: create new object "DFID" nr %d\n",
+              ofd_name(ofd), PFID(&info->fti_fid), nr);
 
        for (i = 0; i < nr; i++) {
                fo = batch[i];
 
        for (i = 0; i < nr; i++) {
                fo = batch[i];
index 81ea610..9410d35 100644 (file)
@@ -449,13 +449,12 @@ static int osc_io_setattr_start(const struct lu_env *env,
         }
         memset(oa, 0, sizeof(*oa));
         if (result == 0) {
         }
         memset(oa, 0, sizeof(*oa));
         if (result == 0) {
-                oa->o_id = loi->loi_id;
-                oa->o_seq = loi->loi_seq;
-                oa->o_mtime = attr->cat_mtime;
-                oa->o_atime = attr->cat_atime;
-                oa->o_ctime = attr->cat_ctime;
-                oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLATIME |
-                        OBD_MD_FLCTIME | OBD_MD_FLMTIME;
+               oa->o_oi = loi->loi_oi;
+               oa->o_mtime = attr->cat_mtime;
+               oa->o_atime = attr->cat_atime;
+               oa->o_ctime = attr->cat_ctime;
+               oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP | OBD_MD_FLATIME |
+                       OBD_MD_FLCTIME | OBD_MD_FLMTIME;
                 if (ia_valid & ATTR_SIZE) {
                         oa->o_size = size;
                         oa->o_blocks = OBD_OBJECT_EOF;
                 if (ia_valid & ATTR_SIZE) {
                         oa->o_size = size;
                         oa->o_blocks = OBD_OBJECT_EOF;
@@ -579,8 +578,7 @@ static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
        ENTRY;
 
        memset(oa, 0, sizeof(*oa));
        ENTRY;
 
        memset(oa, 0, sizeof(*oa));
-       oa->o_id = loi->loi_id;
-       oa->o_seq = loi->loi_seq;
+       oa->o_oi = loi->loi_oi;
        oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
 
        /* reload size abd blocks for start and end of sync range */
        oa->o_valid = OBD_MD_FLID | OBD_MD_FLGROUP;
 
        /* reload size abd blocks for start and end of sync range */
@@ -770,15 +768,15 @@ static void osc_req_attr_set(const struct lu_env *env,
                oa->o_ctime = lvb->lvb_ctime;
                oa->o_valid |= OBD_MD_FLCTIME;
        }
                oa->o_ctime = lvb->lvb_ctime;
                oa->o_valid |= OBD_MD_FLCTIME;
        }
-        if (flags & OBD_MD_FLID) {
-                oa->o_id = oinfo->loi_id;
-                oa->o_valid |= OBD_MD_FLID;
-        }
-        if (flags & OBD_MD_FLGROUP) {
-                oa->o_seq = oinfo->loi_seq;
-                oa->o_valid |= OBD_MD_FLGROUP;
-        }
-        if (flags & OBD_MD_FLHANDLE) {
+       if (flags & OBD_MD_FLGROUP) {
+               ostid_set_seq(&oa->o_oi, ostid_seq(&oinfo->loi_oi));
+               oa->o_valid |= OBD_MD_FLGROUP;
+       }
+       if (flags & OBD_MD_FLID) {
+               ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi));
+               oa->o_valid |= OBD_MD_FLID;
+       }
+       if (flags & OBD_MD_FLHANDLE) {
                 clerq = slice->crs_req;
                 LASSERT(!cfs_list_empty(&clerq->crq_pages));
                 apage = container_of(clerq->crq_pages.next,
                 clerq = slice->crs_req;
                 LASSERT(!cfs_list_empty(&clerq->crq_pages));
                 apage = container_of(clerq->crq_pages.next,
index 2bf87db..64412b5 100644 (file)
@@ -140,18 +140,18 @@ int osc_lvb_print(const struct lu_env *env, void *cookie,
 static int osc_object_print(const struct lu_env *env, void *cookie,
                             lu_printer_t p, const struct lu_object *obj)
 {
 static int osc_object_print(const struct lu_env *env, void *cookie,
                             lu_printer_t p, const struct lu_object *obj)
 {
-        struct osc_object   *osc   = lu2osc(obj);
-        struct lov_oinfo    *oinfo = osc->oo_oinfo;
-        struct osc_async_rc *ar    = &oinfo->loi_ar;
-
-        (*p)(env, cookie, "id: "LPU64" gr: "LPU64" "
-             "idx: %d gen: %d kms_valid: %u kms "LPU64" "
-             "rc: %d force_sync: %d min_xid: "LPU64" ",
-             oinfo->loi_id, oinfo->loi_seq, oinfo->loi_ost_idx,
-             oinfo->loi_ost_gen, oinfo->loi_kms_valid, oinfo->loi_kms,
-             ar->ar_rc, ar->ar_force_sync, ar->ar_min_xid);
-        osc_lvb_print(env, cookie, p, &oinfo->loi_lvb);
-        return 0;
+       struct osc_object   *osc   = lu2osc(obj);
+       struct lov_oinfo    *oinfo = osc->oo_oinfo;
+       struct osc_async_rc *ar    = &oinfo->loi_ar;
+
+       (*p)(env, cookie, "id: "DOSTID" "
+            "idx: %d gen: %d kms_valid: %u kms "LPU64" "
+            "rc: %d force_sync: %d min_xid: "LPU64" ",
+            POSTID(&oinfo->loi_oi), oinfo->loi_ost_idx,
+            oinfo->loi_ost_gen, oinfo->loi_kms_valid, oinfo->loi_kms,
+            ar->ar_rc, ar->ar_force_sync, ar->ar_min_xid);
+       osc_lvb_print(env, cookie, p, &oinfo->loi_lvb);
+       return 0;
 }
 
 
 }
 
 
index ad912ec..4422249 100644 (file)
@@ -725,7 +725,7 @@ int osc_create(const struct lu_env *env, struct obd_export *exp,
                RETURN(osc_real_create(exp, oa, ea, oti));
        }
 
                RETURN(osc_real_create(exp, oa, ea, oti));
        }
 
-       if (!fid_seq_is_mdt(oa->o_seq))
+       if (!fid_seq_is_mdt(ostid_seq(&oa->o_oi)))
                RETURN(osc_real_create(exp, oa, ea, oti));
 
        /* we should not get here anymore */
                RETURN(osc_real_create(exp, oa, ea, oti));
 
        /* we should not get here anymore */
@@ -1472,20 +1472,18 @@ static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
                 msg = "changed in transit AND doesn't match the original - "
                       "likely false positive due to mmap IO (bug 11742)";
 
                 msg = "changed in transit AND doesn't match the original - "
                       "likely false positive due to mmap IO (bug 11742)";
 
-        LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode "DFID
-                           " object "LPU64"/"LPU64" extent ["LPU64"-"LPU64"]\n",
-                           msg, libcfs_nid2str(peer->nid),
-                           oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
-                           oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
-                           oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
-                           oa->o_id,
-                           oa->o_valid & OBD_MD_FLGROUP ? oa->o_seq : (__u64)0,
-                           pga[0]->off,
-                           pga[page_count-1]->off + pga[page_count-1]->count - 1);
-        CERROR("original client csum %x (type %x), server csum %x (type %x), "
-               "client csum now %x\n", client_cksum, client_cksum_type,
-               server_cksum, cksum_type, new_cksum);
-        return 1;
+       LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inode "DFID
+                          " object "DOSTID" extent ["LPU64"-"LPU64"]\n",
+                          msg, libcfs_nid2str(peer->nid),
+                          oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0,
+                          oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
+                          oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
+                          POSTID(&oa->o_oi), pga[0]->off,
+                          pga[page_count-1]->off + pga[page_count-1]->count - 1);
+       CERROR("original client csum %x (type %x), server csum %x (type %x), "
+              "client csum now %x\n", client_cksum, client_cksum_type,
+              server_cksum, cksum_type, new_cksum);
+       return 1;
 }
 
 /* Note rc enters this function as number of bytes transferred */
 }
 
 /* Note rc enters this function as number of bytes transferred */
@@ -1594,42 +1592,39 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                         router = libcfs_nid2str(req->rq_bulk->bd_sender);
                 }
 
                         router = libcfs_nid2str(req->rq_bulk->bd_sender);
                 }
 
-                if (server_cksum == ~0 && rc > 0) {
-                        CERROR("Protocol error: server %s set the 'checksum' "
-                               "bit, but didn't send a checksum.  Not fatal, "
-                               "but please notify on http://bugs.whamcloud.com/\n",
-                               libcfs_nid2str(peer->nid));
-                } else if (server_cksum != client_cksum) {
-                        LCONSOLE_ERROR_MSG(0x133, "%s: BAD READ CHECKSUM: from "
-                                           "%s%s%s inode "DFID" object "
-                                           LPU64"/"LPU64" extent "
-                                           "["LPU64"-"LPU64"]\n",
-                                           req->rq_import->imp_obd->obd_name,
-                                           libcfs_nid2str(peer->nid),
-                                           via, router,
-                                           body->oa.o_valid & OBD_MD_FLFID ?
-                                                body->oa.o_parent_seq : (__u64)0,
-                                           body->oa.o_valid & OBD_MD_FLFID ?
-                                                body->oa.o_parent_oid : 0,
-                                           body->oa.o_valid & OBD_MD_FLFID ?
-                                                body->oa.o_parent_ver : 0,
-                                           body->oa.o_id,
-                                           body->oa.o_valid & OBD_MD_FLGROUP ?
-                                                body->oa.o_seq : (__u64)0,
-                                           aa->aa_ppga[0]->off,
-                                           aa->aa_ppga[aa->aa_page_count-1]->off +
-                                           aa->aa_ppga[aa->aa_page_count-1]->count -
-                                                                        1);
-                        CERROR("client %x, server %x, cksum_type %x\n",
-                               client_cksum, server_cksum, cksum_type);
-                        cksum_counter = 0;
-                        aa->aa_oa->o_cksum = client_cksum;
-                        rc = -EAGAIN;
-                } else {
-                        cksum_counter++;
-                        CDEBUG(D_PAGE, "checksum %x confirmed\n", client_cksum);
-                        rc = 0;
-                }
+               if (server_cksum == ~0 && rc > 0) {
+                       CERROR("Protocol error: server %s set the 'checksum' "
+                              "bit, but didn't send a checksum.  Not fatal, "
+                              "but please notify on http://bugs.whamcloud.com/\n",
+                              libcfs_nid2str(peer->nid));
+               } else if (server_cksum != client_cksum) {
+                       LCONSOLE_ERROR_MSG(0x133, "%s: BAD READ CHECKSUM: from "
+                                          "%s%s%s inode "DFID" object "DOSTID
+                                          " extent ["LPU64"-"LPU64"]\n",
+                                          req->rq_import->imp_obd->obd_name,
+                                          libcfs_nid2str(peer->nid),
+                                          via, router,
+                                          body->oa.o_valid & OBD_MD_FLFID ?
+                                               body->oa.o_parent_seq : (__u64)0,
+                                          body->oa.o_valid & OBD_MD_FLFID ?
+                                               body->oa.o_parent_oid : 0,
+                                          body->oa.o_valid & OBD_MD_FLFID ?
+                                               body->oa.o_parent_ver : 0,
+                                          POSTID(&body->oa.o_oi),
+                                          aa->aa_ppga[0]->off,
+                                          aa->aa_ppga[aa->aa_page_count-1]->off +
+                                          aa->aa_ppga[aa->aa_page_count-1]->count -
+                                                                       1);
+                       CERROR("client %x, server %x, cksum_type %x\n",
+                              client_cksum, server_cksum, cksum_type);
+                       cksum_counter = 0;
+                       aa->aa_oa->o_cksum = client_cksum;
+                       rc = -EAGAIN;
+               } else {
+                       cksum_counter++;
+                       CDEBUG(D_PAGE, "checksum %x confirmed\n", client_cksum);
+                       rc = 0;
+               }
         } else if (unlikely(client_cksum)) {
                 static int cksum_missed;
 
         } else if (unlikely(client_cksum)) {
                 static int cksum_missed;
 
@@ -1693,17 +1688,17 @@ restart_bulk:
                 if (rc != -EINPROGRESS &&
                     !client_should_resend(resends, &exp->exp_obd->u.cli)) {
                         CERROR("%s: too many resend retries for object: "
                 if (rc != -EINPROGRESS &&
                     !client_should_resend(resends, &exp->exp_obd->u.cli)) {
                         CERROR("%s: too many resend retries for object: "
-                               ""LPU64":"LPU64", rc = %d.\n",
-                               exp->exp_obd->obd_name, oa->o_id, oa->o_seq, rc);
-                        goto out;
-                }
-                if (generation !=
-                    exp->exp_obd->u.cli.cl_import->imp_generation) {
-                        CDEBUG(D_HA, "%s: resend cross eviction for object: "
-                               ""LPU64":"LPU64", rc = %d.\n",
-                               exp->exp_obd->obd_name, oa->o_id, oa->o_seq, rc);
+                               ""DOSTID", rc = %d.\n", exp->exp_obd->obd_name,
+                              POSTID(&oa->o_oi), rc);
                         goto out;
                 }
                         goto out;
                 }
+               if (generation !=
+                   exp->exp_obd->u.cli.cl_import->imp_generation) {
+                       CDEBUG(D_HA, "%s: resend cross eviction for object: "
+                              ""DOSTID", rc = %d.\n", exp->exp_obd->obd_name,
+                              POSTID(&oa->o_oi), rc);
+                       goto out;
+               }
 
                 lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL,
                                        NULL);
 
                 lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL,
                                        NULL);
@@ -1955,28 +1950,28 @@ static int brw_interpret(const struct lu_env *env,
         CDEBUG(D_INODE, "request %p aa %p rc %d\n", req, aa, rc);
         /* When server return -EINPROGRESS, client should always retry
          * regardless of the number of times the bulk was resent already. */
         CDEBUG(D_INODE, "request %p aa %p rc %d\n", req, aa, rc);
         /* When server return -EINPROGRESS, client should always retry
          * regardless of the number of times the bulk was resent already. */
-        if (osc_recoverable_error(rc)) {
-                if (req->rq_import_generation !=
-                    req->rq_import->imp_generation) {
-                        CDEBUG(D_HA, "%s: resend cross eviction for object: "
-                               ""LPU64":"LPU64", rc = %d.\n",
-                               req->rq_import->imp_obd->obd_name,
-                               aa->aa_oa->o_id, aa->aa_oa->o_seq, rc);
-                } else if (rc == -EINPROGRESS ||
-                    client_should_resend(aa->aa_resends, aa->aa_cli)) {
-                        rc = osc_brw_redo_request(req, aa, rc);
-                } else {
-                        CERROR("%s: too many resent retries for object: "
-                               ""LPU64":"LPU64", rc = %d.\n",
-                               req->rq_import->imp_obd->obd_name,
-                               aa->aa_oa->o_id, aa->aa_oa->o_seq, rc);
-                }
+       if (osc_recoverable_error(rc)) {
+               if (req->rq_import_generation !=
+                   req->rq_import->imp_generation) {
+                       CDEBUG(D_HA, "%s: resend cross eviction for object: "
+                              ""DOSTID", rc = %d.\n",
+                              req->rq_import->imp_obd->obd_name,
+                              POSTID(&aa->aa_oa->o_oi), rc);
+               } else if (rc == -EINPROGRESS ||
+                   client_should_resend(aa->aa_resends, aa->aa_cli)) {
+                       rc = osc_brw_redo_request(req, aa, rc);
+               } else {
+                       CERROR("%s: too many resent retries for object: "
+                              ""LPU64":"LPU64", rc = %d.\n",
+                              req->rq_import->imp_obd->obd_name,
+                              POSTID(&aa->aa_oa->o_oi), rc);
+               }
 
 
-                if (rc == 0)
-                        RETURN(0);
-                else if (rc == -EAGAIN || rc == -EINPROGRESS)
-                        rc = -EIO;
-        }
+               if (rc == 0)
+                       RETURN(0);
+               else if (rc == -EAGAIN || rc == -EINPROGRESS)
+                       rc = -EIO;
+       }
 
         if (aa->aa_ocapa) {
                 capa_put(aa->aa_ocapa);
 
         if (aa->aa_ocapa) {
                 capa_put(aa->aa_ocapa);
index 8965c31..c558fd1 100644 (file)
@@ -701,16 +701,16 @@ int osd_obj_map_lookup(struct osd_thread_info *info, struct osd_device *dev,
         LASSERT(map);
        LASSERT(map->om_root);
 
         LASSERT(map);
        LASSERT(map->om_root);
 
-        fid_ostid_pack(fid, ostid);
-       osd_seq = osd_seq_load(dev, ostid->oi_seq);
+        fid_to_ostid(fid, ostid);
+       osd_seq = osd_seq_load(dev, ostid_seq(ostid));
        if (IS_ERR(osd_seq))
                RETURN(PTR_ERR(osd_seq));
 
        if (IS_ERR(osd_seq))
                RETURN(PTR_ERR(osd_seq));
 
-       dirn = ostid->oi_id & (osd_seq->oos_subdir_count - 1);
+       dirn = ostid_id(ostid) & (osd_seq->oos_subdir_count - 1);
        d_seq = osd_seq->oos_dirs[dirn];
        LASSERT(d_seq);
 
        d_seq = osd_seq->oos_dirs[dirn];
        LASSERT(d_seq);
 
-       osd_oid_name(name, fid, ostid->oi_id);
+       osd_oid_name(name, fid, ostid_id(ostid));
 
        child = &info->oti_child_dentry;
        child->d_parent = d_seq;
 
        child = &info->oti_child_dentry;
        child->d_parent = d_seq;
@@ -756,17 +756,17 @@ int osd_obj_map_insert(struct osd_thread_info *info,
         LASSERT(map);
 
        /* map fid to seq:objid */
         LASSERT(map);
 
        /* map fid to seq:objid */
-        fid_ostid_pack(fid, ostid);
+        fid_to_ostid(fid, ostid);
 
 
-       osd_seq = osd_seq_load(osd, ostid->oi_seq);
+       osd_seq = osd_seq_load(osd, ostid_seq(ostid));
        if (IS_ERR(osd_seq))
                RETURN(PTR_ERR(osd_seq));
 
        if (IS_ERR(osd_seq))
                RETURN(PTR_ERR(osd_seq));
 
-       dirn = ostid->oi_id & (osd_seq->oos_subdir_count - 1);
+       dirn = ostid_id(ostid) & (osd_seq->oos_subdir_count - 1);
        d = osd_seq->oos_dirs[dirn];
         LASSERT(d);
 
        d = osd_seq->oos_dirs[dirn];
         LASSERT(d);
 
-       osd_oid_name(name, fid, ostid->oi_id);
+       osd_oid_name(name, fid, ostid_id(ostid));
        rc = osd_obj_add_entry(info, osd, d, name, id, th);
 
         RETURN(rc);
        rc = osd_obj_add_entry(info, osd, d, name, id, th);
 
         RETURN(rc);
@@ -787,17 +787,17 @@ int osd_obj_map_delete(struct osd_thread_info *info, struct osd_device *osd,
         LASSERT(map);
 
        /* map fid to seq:objid */
         LASSERT(map);
 
        /* map fid to seq:objid */
-        fid_ostid_pack(fid, ostid);
+        fid_to_ostid(fid, ostid);
 
 
-       osd_seq = osd_seq_load(osd, ostid->oi_seq);
+       osd_seq = osd_seq_load(osd, ostid_seq(ostid));
        if (IS_ERR(osd_seq))
                GOTO(cleanup, rc = PTR_ERR(osd_seq));
 
        if (IS_ERR(osd_seq))
                GOTO(cleanup, rc = PTR_ERR(osd_seq));
 
-       dirn = ostid->oi_id & (osd_seq->oos_subdir_count - 1);
+       dirn = ostid_id(ostid) & (osd_seq->oos_subdir_count - 1);
        d = osd_seq->oos_dirs[dirn];
        LASSERT(d);
 
        d = osd_seq->oos_dirs[dirn];
        LASSERT(d);
 
-       osd_oid_name(name, fid, ostid->oi_id);
+       osd_oid_name(name, fid, ostid_id(ostid));
        rc = osd_obj_del_entry(info, osd, d, name, th);
 cleanup:
         RETURN(rc);
        rc = osd_obj_del_entry(info, osd, d, name, th);
 cleanup:
         RETURN(rc);
index 8b780fc..ad6a125 100644 (file)
@@ -396,12 +396,13 @@ osd_get_idx_for_ost_obj(const struct lu_env *env, struct osd_device *osd,
                       PFID(fid));
                return PTR_ERR(osd_seq);
        }
                       PFID(fid));
                return PTR_ERR(osd_seq);
        }
-       rc = fid_ostid_pack(fid, &osd_oti_get(env)->oti_ostid);
+
+       rc = fid_to_ostid(fid, &osd_oti_get(env)->oti_ostid);
        LASSERT(rc == 0); /* we should not get here with IGIF */
        LASSERT(rc == 0); /* we should not get here with IGIF */
-       b = osd_oti_get(env)->oti_ostid.oi_id % OSD_OST_MAP_SIZE;
+       b = ostid_id(&osd_oti_get(env)->oti_ostid) % OSD_OST_MAP_SIZE;
        LASSERT(osd_seq->os_compat_dirs[b]);
 
        LASSERT(osd_seq->os_compat_dirs[b]);
 
-       sprintf(buf, LPU64, osd_oti_get(env)->oti_ostid.oi_id);
+       sprintf(buf, LPU64, ostid_id(&osd_oti_get(env)->oti_ostid));
 
        return osd_seq->os_compat_dirs[b];
 }
 
        return osd_seq->os_compat_dirs[b];
 }
index 4b4f849..c89316b 100644 (file)
@@ -353,8 +353,8 @@ static int osp_fid_end_seq(const struct lu_env *env, struct lu_fid *fid)
                struct osp_thread_info *info = osp_env_info(env);
                struct ost_id *oi = &info->osi_oi;
 
                struct osp_thread_info *info = osp_env_info(env);
                struct ost_id *oi = &info->osi_oi;
 
-               fid_ostid_pack(fid, oi);
-               return oi->oi_id == IDIF_MAX_OID;
+               fid_to_ostid(fid, oi);
+               return ostid_id(oi) == IDIF_MAX_OID;
        } else {
                return fid_oid(fid) == LUSTRE_DATA_SEQ_MAX_WIDTH;
        }
        } else {
                return fid_oid(fid) == LUSTRE_DATA_SEQ_MAX_WIDTH;
        }
index 1f44a87..c9dcc80 100644 (file)
@@ -273,7 +273,9 @@ static int osp_object_create(const struct lu_env *env, struct dt_object *dt,
                spin_lock(&d->opd_pre_lock);
                if (d->opd_gap_count > 0) {
                        int count = d->opd_gap_count;
                spin_lock(&d->opd_pre_lock);
                if (d->opd_gap_count > 0) {
                        int count = d->opd_gap_count;
-                       osi->osi_oi.oi_id = fid_oid(&d->opd_gap_start_fid);
+
+                       ostid_set_id(&osi->osi_oi,
+                                    fid_oid(&d->opd_gap_start_fid));
                        d->opd_gap_count = 0;
                        spin_unlock(&d->opd_pre_lock);
 
                        d->opd_gap_count = 0;
                        spin_unlock(&d->opd_pre_lock);
 
index 9b3febc..914f988 100644 (file)
@@ -212,11 +212,11 @@ static inline int osp_objs_precreated(const struct lu_env *env,
                struct ost_id *oi2 = &osp_env_info(env)->osi_oi2;
 
                LASSERT(fid_is_idif(fid1) && fid_is_idif(fid2));
                struct ost_id *oi2 = &osp_env_info(env)->osi_oi2;
 
                LASSERT(fid_is_idif(fid1) && fid_is_idif(fid2));
-               ostid_idif_pack(fid1, oi1);
-               ostid_idif_pack(fid2, oi2);
-               LASSERT(oi1->oi_id >= oi2->oi_id);
+               fid_to_ostid(fid1, oi1);
+               fid_to_ostid(fid2, oi2);
+               LASSERT(ostid_id(oi1) >= ostid_id(oi2));
 
 
-               return oi1->oi_id - oi2->oi_id;
+               return ostid_id(oi1) - ostid_id(oi2);
        }
 
        return fid_oid(fid1) - fid_oid(fid2);
        }
 
        return fid_oid(fid1) - fid_oid(fid2);
@@ -381,16 +381,16 @@ static int osp_precreate_fids(const struct lu_env *env, struct osp_device *osp,
 
                spin_lock(&osp->opd_pre_lock);
                last_fid = &osp->opd_pre_last_created_fid;
 
                spin_lock(&osp->opd_pre_lock);
                last_fid = &osp->opd_pre_last_created_fid;
-               ostid_idif_pack(last_fid, oi);
-               end = min(oi->oi_id + *grow, IDIF_MAX_OID);
-               *grow = end - oi->oi_id;
-               oi->oi_id += *grow;
+               fid_to_ostid(last_fid, oi);
+               end = min(ostid_id(oi) + *grow, IDIF_MAX_OID);
+               *grow = end - ostid_id(oi);
+               ostid_set_id(oi, ostid_id(oi) + *grow);
                spin_unlock(&osp->opd_pre_lock);
 
                if (*grow == 0)
                        return 1;
 
                spin_unlock(&osp->opd_pre_lock);
 
                if (*grow == 0)
                        return 1;
 
-               ostid_idif_unpack(oi, fid, osp->opd_index);
+               ostid_to_fid(fid, oi, osp->opd_index);
                return 0;
        }
 
                return 0;
        }
 
@@ -473,7 +473,7 @@ static int osp_precreate_send(const struct lu_env *env, struct osp_device *d)
                fid->f_seq = 0;
        }
 
                fid->f_seq = 0;
        }
 
-       fid_ostid_pack(fid, &body->oa.o_oi);
+       fid_to_ostid(fid, &body->oa.o_oi);
        body->oa.o_valid = OBD_MD_FLGROUP;
 
        ptlrpc_request_set_replen(req);
        body->oa.o_valid = OBD_MD_FLGROUP;
 
        ptlrpc_request_set_replen(req);
@@ -490,14 +490,11 @@ static int osp_precreate_send(const struct lu_env *env, struct osp_device *d)
        if (body == NULL)
                GOTO(out_req, rc = -EPROTO);
 
        if (body == NULL)
                GOTO(out_req, rc = -EPROTO);
 
-       fid_ostid_unpack(fid, &body->oa.o_oi, d->opd_index);
+       ostid_to_fid(fid, &body->oa.o_oi, d->opd_index);
        LASSERTF(lu_fid_diff(fid, &d->opd_pre_used_fid) > 0,
                 "reply fid "DFID" pre used fid "DFID"\n", PFID(fid),
                 PFID(&d->opd_pre_used_fid));
 
        LASSERTF(lu_fid_diff(fid, &d->opd_pre_used_fid) > 0,
                 "reply fid "DFID" pre used fid "DFID"\n", PFID(fid),
                 PFID(&d->opd_pre_used_fid));
 
-       CDEBUG(D_HA, "%s: new last_created "DFID"\n", d->opd_obd->obd_name,
-              PFID(fid));
-
        diff = lu_fid_diff(fid, &d->opd_pre_last_created_fid);
 
        spin_lock(&d->opd_pre_lock);
        diff = lu_fid_diff(fid, &d->opd_pre_last_created_fid);
 
        spin_lock(&d->opd_pre_lock);
@@ -516,8 +513,9 @@ static int osp_precreate_send(const struct lu_env *env, struct osp_device *d)
        d->opd_pre_last_created_fid = *fid;
        spin_unlock(&d->opd_pre_lock);
 
        d->opd_pre_last_created_fid = *fid;
        spin_unlock(&d->opd_pre_lock);
 
-       CDEBUG(D_OTHER, "current precreated pool: "DFID"-"DFID"\n",
-              PFID(&d->opd_pre_used_fid), PFID(&d->opd_pre_last_created_fid));
+       CDEBUG(D_HA, "%s: current precreated pool: "DFID"-"DFID"\n",
+              d->opd_obd->obd_name, PFID(&d->opd_pre_used_fid),
+              PFID(&d->opd_pre_last_created_fid));
 out_req:
        /* now we can wakeup all users awaiting for objects */
        osp_pre_update_status(d, rc);
 out_req:
        /* now we can wakeup all users awaiting for objects */
        osp_pre_update_status(d, rc);
@@ -530,10 +528,9 @@ out_req:
 static int osp_get_lastfid_from_ost(const struct lu_env *env,
                                    struct osp_device *d)
 {
 static int osp_get_lastfid_from_ost(const struct lu_env *env,
                                    struct osp_device *d)
 {
-       struct ost_id           *oi = &osp_env_info(env)->osi_oi;
        struct ptlrpc_request   *req = NULL;
        struct obd_import       *imp;
        struct ptlrpc_request   *req = NULL;
        struct obd_import       *imp;
-       struct lu_fid           *last_fid = &d->opd_last_used_fid;
+       struct lu_fid           *last_fid;
        char                    *tmp;
        int                     rc;
        ENTRY;
        char                    *tmp;
        int                     rc;
        ENTRY;
@@ -549,7 +546,7 @@ static int osp_get_lastfid_from_ost(const struct lu_env *env,
                             sizeof(KEY_LAST_FID));
 
        req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_VAL, RCL_CLIENT,
                             sizeof(KEY_LAST_FID));
 
        req_capsule_set_size(&req->rq_pill, &RMF_SETINFO_VAL, RCL_CLIENT,
-                            sizeof(*oi));
+                            sizeof(struct lu_fid));
 
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GET_INFO);
        if (rc) {
 
        rc = ptlrpc_request_pack(req, LUSTRE_OST_VERSION, OST_GET_INFO);
        if (rc) {
@@ -561,10 +558,8 @@ static int osp_get_lastfid_from_ost(const struct lu_env *env,
        memcpy(tmp, KEY_LAST_FID, sizeof(KEY_LAST_FID));
 
        req->rq_no_delay = req->rq_no_resend = 1;
        memcpy(tmp, KEY_LAST_FID, sizeof(KEY_LAST_FID));
 
        req->rq_no_delay = req->rq_no_resend = 1;
-       fid_ostid_pack(last_fid, oi);
-       ostid_cpu_to_le(oi, oi);
        tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
        tmp = req_capsule_client_get(&req->rq_pill, &RMF_SETINFO_VAL);
-       memcpy(tmp, oi, sizeof(*oi));
+       fid_cpu_to_le((struct lu_fid *)tmp, &d->opd_last_used_fid);
        ptlrpc_request_set_replen(req);
 
        rc = ptlrpc_queue_wait(req);
        ptlrpc_request_set_replen(req);
 
        rc = ptlrpc_queue_wait(req);
@@ -578,14 +573,13 @@ static int osp_get_lastfid_from_ost(const struct lu_env *env,
                GOTO(out, rc);
        }
 
                GOTO(out, rc);
        }
 
-       oi = req_capsule_server_get(&req->rq_pill, &RMF_OST_ID);
-       if (oi == NULL) {
+       last_fid = req_capsule_server_get(&req->rq_pill, &RMF_FID);
+       if (last_fid == NULL) {
                CERROR("%s: Got last_fid failed.\n", d->opd_obd->obd_name);
                GOTO(out, rc = -EPROTO);
        }
 
                CERROR("%s: Got last_fid failed.\n", d->opd_obd->obd_name);
                GOTO(out, rc = -EPROTO);
        }
 
-       rc = fid_ostid_unpack(last_fid, oi, d->opd_index);
-       if (rc != 0 || !fid_is_sane(last_fid)) {
+       if (!fid_is_sane(last_fid)) {
                CERROR("%s: Got insane last_fid "DFID"\n",
                       d->opd_obd->obd_name, PFID(last_fid));
                GOTO(out, rc = -EPROTO);
                CERROR("%s: Got insane last_fid "DFID"\n",
                       d->opd_obd->obd_name, PFID(last_fid));
                GOTO(out, rc = -EPROTO);
@@ -682,7 +676,7 @@ static int osp_precreate_cleanup_orphans(struct lu_env *env,
        body->oa.o_flags = OBD_FL_DELORPHAN;
        body->oa.o_valid = OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
 
        body->oa.o_flags = OBD_FL_DELORPHAN;
        body->oa.o_valid = OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
 
-       fid_ostid_pack(&d->opd_last_used_fid, &body->oa.o_oi);
+       fid_to_ostid(&d->opd_last_used_fid, &body->oa.o_oi);
 
        ptlrpc_request_set_replen(req);
 
 
        ptlrpc_request_set_replen(req);
 
@@ -702,10 +696,7 @@ static int osp_precreate_cleanup_orphans(struct lu_env *env,
        /*
         * OST provides us with id new pool starts from in body->oa.o_id
         */
        /*
         * OST provides us with id new pool starts from in body->oa.o_id
         */
-       fid_ostid_unpack(last_fid, &body->oa.o_oi, d->opd_index);
-       CDEBUG(D_INFO, "%s: last_fid "DFID" server last fid "DFID"\n",
-              d->opd_obd->obd_name, PFID(&d->opd_last_used_fid),
-              PFID(last_fid));
+       ostid_to_fid(last_fid, &body->oa.o_oi, d->opd_index);
 
        spin_lock(&d->opd_pre_lock);
        diff = lu_fid_diff(&d->opd_last_used_fid, last_fid);
 
        spin_lock(&d->opd_pre_lock);
        diff = lu_fid_diff(&d->opd_last_used_fid, last_fid);
@@ -1231,7 +1222,7 @@ int osp_object_truncate(const struct lu_env *env, struct dt_object *dt,
        if (oa == NULL)
                GOTO(out, rc = -ENOMEM);
 
        if (oa == NULL)
                GOTO(out, rc = -ENOMEM);
 
-       rc = fid_ostid_pack(lu_object_fid(&dt->do_lu), &oa->o_oi);
+       rc = fid_to_ostid(lu_object_fid(&dt->do_lu), &oa->o_oi);
        LASSERT(rc == 0);
        oa->o_size = size;
        oa->o_blocks = OBD_OBJECT_EOF;
        LASSERT(rc == 0);
        oa->o_size = size;
        oa->o_blocks = OBD_OBJECT_EOF;
index dfa263e..4bc9d58 100644 (file)
@@ -230,12 +230,11 @@ static int osp_sync_add_rec(const struct lu_env *env, struct osp_device *d,
                osi->osi_unlink.lur_count = count;
                break;
        case MDS_SETATTR64_REC:
                osi->osi_unlink.lur_count = count;
                break;
        case MDS_SETATTR64_REC:
-               rc = fid_ostid_pack(fid, &osi->osi_oi);
+               rc = fid_to_ostid(fid, &osi->osi_oi);
                LASSERT(rc == 0);
                osi->osi_hdr.lrh_len = sizeof(osi->osi_setattr);
                osi->osi_hdr.lrh_type = MDS_SETATTR64_REC;
                LASSERT(rc == 0);
                osi->osi_hdr.lrh_len = sizeof(osi->osi_setattr);
                osi->osi_hdr.lrh_type = MDS_SETATTR64_REC;
-               osi->osi_setattr.lsr_oid  = osi->osi_oi.oi_id;
-               osi->osi_setattr.lsr_oseq = osi->osi_oi.oi_seq;
+               osi->osi_setattr.lsr_oi  = osi->osi_oi;
                LASSERT(attr);
                osi->osi_setattr.lsr_uid = attr->la_uid;
                osi->osi_setattr.lsr_gid = attr->la_gid;
                LASSERT(attr);
                osi->osi_setattr.lsr_uid = attr->la_uid;
                osi->osi_setattr.lsr_gid = attr->la_gid;
@@ -257,10 +256,8 @@ static int osp_sync_add_rec(const struct lu_env *env, struct osp_device *d,
                      NULL, th);
        llog_ctxt_put(ctxt);
 
                      NULL, th);
        llog_ctxt_put(ctxt);
 
-       CDEBUG(D_OTHER, "%s: new record %lu:%lu:%lu/%lu: %d\n",
-              d->opd_obd->obd_name,
-              (unsigned long) osi->osi_cookie.lgc_lgl.lgl_oid,
-              (unsigned long) osi->osi_cookie.lgc_lgl.lgl_oseq,
+       CDEBUG(D_OTHER, "%s: new record "DOSTID":%lu/%lu: %d\n",
+              d->opd_obd->obd_name, POSTID(&osi->osi_cookie.lgc_lgl.lgl_oi),
               (unsigned long) osi->osi_cookie.lgc_lgl.lgl_ogen,
               (unsigned long) osi->osi_cookie.lgc_index, rc);
 
               (unsigned long) osi->osi_cookie.lgc_lgl.lgl_ogen,
               (unsigned long) osi->osi_cookie.lgc_index, rc);
 
@@ -489,8 +486,7 @@ static int osp_sync_new_setattr_job(struct osp_device *d,
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
-       body->oa.o_id  = rec->lsr_oid;
-       body->oa.o_seq = rec->lsr_oseq;
+       body->oa.o_oi = rec->lsr_oi;
        body->oa.o_uid = rec->lsr_uid;
        body->oa.o_gid = rec->lsr_gid;
        body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID |
        body->oa.o_uid = rec->lsr_uid;
        body->oa.o_gid = rec->lsr_gid;
        body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID |
@@ -518,8 +514,8 @@ static int osp_sync_new_unlink_job(struct osp_device *d,
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
 
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        LASSERT(body);
-       body->oa.o_id  = rec->lur_oid;
-       body->oa.o_seq = rec->lur_oseq;
+       ostid_set_seq(&body->oa.o_oi, rec->lur_oseq);
+       ostid_set_id(&body->oa.o_oi, rec->lur_oid);
        body->oa.o_misc = rec->lur_count;
        body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID;
        if (rec->lur_count)
        body->oa.o_misc = rec->lur_count;
        body->oa.o_valid = OBD_MD_FLGROUP | OBD_MD_FLID;
        if (rec->lur_count)
@@ -548,7 +544,7 @@ static int osp_sync_new_unlink64_job(struct osp_device *d,
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        if (body == NULL)
                RETURN(-EFAULT);
        body = req_capsule_client_get(&req->rq_pill, &RMF_OST_BODY);
        if (body == NULL)
                RETURN(-EFAULT);
-       rc = fid_ostid_pack(&rec->lur_fid, &body->oa.o_oi);
+       rc = fid_to_ostid(&rec->lur_fid, &body->oa.o_oi);
        if (rc < 0)
                RETURN(rc);
        body->oa.o_misc = rec->lur_count;
        if (rc < 0)
                RETURN(rc);
        body->oa.o_misc = rec->lur_count;
@@ -911,7 +907,7 @@ out:
 static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
 {
        struct osp_thread_info *osi = osp_env_info(env);
 static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
 {
        struct osp_thread_info *osi = osp_env_info(env);
-       struct llog_handle     *lgh;
+       struct llog_handle     *lgh = NULL;
        struct obd_device      *obd = d->opd_obd;
        struct llog_ctxt       *ctxt;
        int                     rc;
        struct obd_device      *obd = d->opd_obd;
        struct llog_ctxt       *ctxt;
        int                     rc;
@@ -934,9 +930,9 @@ static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
                RETURN(rc);
        }
 
                RETURN(rc);
        }
 
-       CDEBUG(D_INFO, "%s: Init llog for %d - catid "LPX64"/"LPX64":%x\n",
-              obd->obd_name, d->opd_index, osi->osi_cid.lci_logid.lgl_oid,
-              osi->osi_cid.lci_logid.lgl_oseq,
+       CDEBUG(D_INFO, "%s: Init llog for %d - catid "DOSTID":%x\n",
+              obd->obd_name, d->opd_index,
+              POSTID(&osi->osi_cid.lci_logid.lgl_oi),
               osi->osi_cid.lci_logid.lgl_ogen);
 
        rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, obd,
               osi->osi_cid.lci_logid.lgl_ogen);
 
        rc = llog_setup(env, obd, &obd->obd_olg, LLOG_MDS_OST_ORIG_CTXT, obd,
@@ -947,23 +943,24 @@ static int osp_sync_llog_init(const struct lu_env *env, struct osp_device *d)
        ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
        LASSERT(ctxt);
 
        ctxt = llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT);
        LASSERT(ctxt);
 
-       if (likely(osi->osi_cid.lci_logid.lgl_oid != 0)) {
+       if (likely(ostid_id(&osi->osi_cid.lci_logid.lgl_oi) != 0)) {
                rc = llog_open(env, ctxt, &lgh, &osi->osi_cid.lci_logid, NULL,
                               LLOG_OPEN_EXISTS);
                /* re-create llog if it is missing */
                if (rc == -ENOENT)
                rc = llog_open(env, ctxt, &lgh, &osi->osi_cid.lci_logid, NULL,
                               LLOG_OPEN_EXISTS);
                /* re-create llog if it is missing */
                if (rc == -ENOENT)
-                       osi->osi_cid.lci_logid.lgl_oid = 0;
+                       logid_set_id(&osi->osi_cid.lci_logid, 0);
                else if (rc < 0)
                        GOTO(out_cleanup, rc);
        }
 
                else if (rc < 0)
                        GOTO(out_cleanup, rc);
        }
 
-       if (unlikely(osi->osi_cid.lci_logid.lgl_oid == 0)) {
+       if (unlikely(logid_id(&osi->osi_cid.lci_logid) == 0)) {
                rc = llog_open_create(env, ctxt, &lgh, NULL, NULL);
                if (rc < 0)
                        GOTO(out_cleanup, rc);
                osi->osi_cid.lci_logid = lgh->lgh_id;
        }
 
                rc = llog_open_create(env, ctxt, &lgh, NULL, NULL);
                if (rc < 0)
                        GOTO(out_cleanup, rc);
                osi->osi_cid.lci_logid = lgh->lgh_id;
        }
 
+       LASSERT(lgh != NULL);
        ctxt->loc_handle = lgh;
 
        rc = llog_cat_init_and_process(env, lgh);
        ctxt->loc_handle = lgh;
 
        rc = llog_cat_init_and_process(env, lgh);
index b8a3aa8..bea262e 100644 (file)
@@ -110,19 +110,20 @@ static int ost_validate_obdo(struct obd_export *exp, struct obdo *oa,
                             struct obd_ioobj *ioobj)
 {
        if (unlikely(oa != NULL && !(oa->o_valid & OBD_MD_FLGROUP))) {
                             struct obd_ioobj *ioobj)
 {
        if (unlikely(oa != NULL && !(oa->o_valid & OBD_MD_FLGROUP))) {
-               oa->o_seq = FID_SEQ_OST_MDT0;
+               ostid_set_seq_mdt0(&oa->o_oi);
                if (ioobj)
                if (ioobj)
-                       ioobj->ioo_seq = FID_SEQ_OST_MDT0;
-       } else if (unlikely(oa == NULL || !(fid_seq_is_idif(oa->o_seq) ||
-                                           fid_seq_is_mdt(oa->o_seq) ||
-                                           fid_seq_is_echo(oa->o_seq)))) {
+                       ostid_set_seq_mdt0(&ioobj->ioo_oid);
+       } else if (unlikely(oa == NULL ||
+                           !(fid_seq_is_idif(ostid_seq(&oa->o_oi)) ||
+                             fid_seq_is_mdt(ostid_seq(&oa->o_oi)) ||
+                             fid_seq_is_echo(ostid_seq(&oa->o_oi))))) {
                CERROR("%s: client %s sent bad object "DOSTID": rc = -EPROTO\n",
                       exp->exp_obd->obd_name, obd_export_nid2str(exp),
                CERROR("%s: client %s sent bad object "DOSTID": rc = -EPROTO\n",
                       exp->exp_obd->obd_name, obd_export_nid2str(exp),
-                      oa ? oa->o_id : -1, oa ? oa->o_seq : -1);
+                      oa ? ostid_seq(&oa->o_oi) : -1,
+                      oa ? ostid_id(&oa->o_oi) : -1);
                return -EPROTO;
        }
 
                return -EPROTO;
        }
 
-       obdo_from_ostid(oa, &oa->o_oi);
        if (ioobj != NULL) {
                unsigned max_brw = ioobj_max_brw_get(ioobj);
 
        if (ioobj != NULL) {
                unsigned max_brw = ioobj_max_brw_get(ioobj);
 
@@ -133,7 +134,7 @@ static int ost_validate_obdo(struct obd_export *exp, struct obdo *oa,
                               POSTID(&oa->o_oi));
                        return -EPROTO;
                }
                               POSTID(&oa->o_oi));
                        return -EPROTO;
                }
-               ioobj_from_obdo(ioobj, oa);
+               ioobj->ioo_oid = oa->o_oi;
        }
        return 0;
 }
        }
        return 0;
 }
@@ -176,8 +177,8 @@ static int ost_destroy(struct obd_export *exp, struct ptlrpc_request *req,
         if (body == NULL)
                 RETURN(-EFAULT);
 
         if (body == NULL)
                 RETURN(-EFAULT);
 
-        if (body->oa.o_id == 0)
-                RETURN(-EPROTO);
+       if (ostid_id(&body->oa.o_oi) == 0)
+               RETURN(-EPROTO);
 
         rc = ost_validate_obdo(exp, &body->oa, NULL);
         if (rc)
 
         rc = ost_validate_obdo(exp, &body->oa, NULL);
         if (rc)
@@ -792,20 +793,20 @@ static int ost_brw_read(struct ptlrpc_request *req, struct obd_trans_info *oti)
         if (rc != 0)
                 GOTO(out_tls, rc);
 
         if (rc != 0)
                 GOTO(out_tls, rc);
 
-        /*
-         * If getting the lock took more time than
-         * client was willing to wait, drop it. b=11330
-         */
-        if (cfs_time_current_sec() > req->rq_deadline ||
-            OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
-                no_reply = 1;
-                CERROR("Dropping timed-out read from %s because locking"
-                       "object "LPX64" took %ld seconds (limit was %ld).\n",
-                       libcfs_id2str(req->rq_peer), ioo->ioo_id,
-                       cfs_time_current_sec() - req->rq_arrival_time.tv_sec,
-                       req->rq_deadline - req->rq_arrival_time.tv_sec);
-                GOTO(out_lock, rc = -ETIMEDOUT);
-        }
+       /*
+        * If getting the lock took more time than
+        * client was willing to wait, drop it. b=11330
+        */
+       if (cfs_time_current_sec() > req->rq_deadline ||
+           OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
+               no_reply = 1;
+               CERROR("Dropping timed-out read from %s because locking"
+                      "object "DOSTID" took %ld seconds (limit was %ld).\n",
+                      libcfs_id2str(req->rq_peer), POSTID(&ioo->ioo_oid),
+                      cfs_time_current_sec() - req->rq_arrival_time.tv_sec,
+                      req->rq_deadline - req->rq_arrival_time.tv_sec);
+               GOTO(out_lock, rc = -ETIMEDOUT);
+       }
 
         repbody = req_capsule_server_get(&req->rq_pill, &RMF_OST_BODY);
         memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
 
         repbody = req_capsule_server_get(&req->rq_pill, &RMF_OST_BODY);
         memcpy(&repbody->oa, &body->oa, sizeof(repbody->oa));
@@ -952,7 +953,7 @@ static void ost_warn_on_cksum(struct ptlrpc_request *req,
        }
 
        LCONSOLE_ERROR_MSG(0x168, "BAD WRITE CHECKSUM: %s from %s%s%s inode "
        }
 
        LCONSOLE_ERROR_MSG(0x168, "BAD WRITE CHECKSUM: %s from %s%s%s inode "
-                          DFID" object "LPU64"/"LPU64" extent ["LPU64"-"LPU64
+                          DFID" object "DOSTID" extent ["LPU64"-"LPU64
                           "]: client csum %x, server csum %x\n",
                           exp->exp_obd->obd_name, libcfs_id2str(req->rq_peer),
                           via, router,
                           "]: client csum %x, server csum %x\n",
                           exp->exp_obd->obd_name, libcfs_id2str(req->rq_peer),
                           via, router,
@@ -962,9 +963,7 @@ static void ost_warn_on_cksum(struct ptlrpc_request *req,
                           body->oa.o_parent_oid : 0,
                           body->oa.o_valid & OBD_MD_FLFID ?
                           body->oa.o_parent_ver : 0,
                           body->oa.o_parent_oid : 0,
                           body->oa.o_valid & OBD_MD_FLFID ?
                           body->oa.o_parent_ver : 0,
-                          body->oa.o_id,
-                          body->oa.o_valid & OBD_MD_FLGROUP ?
-                          body->oa.o_seq : (__u64)0,
+                          POSTID(&body->oa.o_oi),
                           local_nb[0].lnb_file_offset,
                           local_nb[npages-1].lnb_file_offset +
                           local_nb[npages-1].len - 1,
                           local_nb[0].lnb_file_offset,
                           local_nb[npages-1].lnb_file_offset +
                           local_nb[npages-1].len - 1,
@@ -1060,20 +1059,20 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
         if (rc != 0)
                 GOTO(out_tls, rc);
 
         if (rc != 0)
                 GOTO(out_tls, rc);
 
-        /*
-         * If getting the lock took more time than
-         * client was willing to wait, drop it. b=11330
-         */
-        if (cfs_time_current_sec() > req->rq_deadline ||
-            OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
-                no_reply = 1;
-                CERROR("Dropping timed-out write from %s because locking "
-                       "object "LPX64" took %ld seconds (limit was %ld).\n",
-                       libcfs_id2str(req->rq_peer), ioo->ioo_id,
-                       cfs_time_current_sec() - req->rq_arrival_time.tv_sec,
-                       req->rq_deadline - req->rq_arrival_time.tv_sec);
-                GOTO(out_lock, rc = -ETIMEDOUT);
-        }
+       /*
+        * If getting the lock took more time than
+        * client was willing to wait, drop it. b=11330
+        */
+       if (cfs_time_current_sec() > req->rq_deadline ||
+           OBD_FAIL_CHECK(OBD_FAIL_OST_DROP_REQ)) {
+               no_reply = 1;
+               CERROR("Dropping timed-out write from %s because locking "
+                      "object "DOSTID" took %ld seconds (limit was %ld).\n",
+                      libcfs_id2str(req->rq_peer), POSTID(&ioo->ioo_oid),
+                      cfs_time_current_sec() - req->rq_arrival_time.tv_sec,
+                      req->rq_deadline - req->rq_arrival_time.tv_sec);
+               GOTO(out_lock, rc = -ETIMEDOUT);
+       }
 
         /* obd_preprw clobbers oa->valid, so save what we need */
         if (body->oa.o_valid & OBD_MD_FLCKSUM) {
 
         /* obd_preprw clobbers oa->valid, so save what we need */
         if (body->oa.o_valid & OBD_MD_FLCKSUM) {
index 9aa76d3..f8c84d2 100644 (file)
@@ -73,20 +73,4 @@ static void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars)
 }
 #endif
 
 }
 #endif
 
-/* Here "ostid" maybe part of "oa", the return value of "ostid_id()" depends on
- * the original "ostid->oi_seq", which maybe changed by the assignment of
- * "oa->o_seq = ostid_seq(ostid)", so keep the order of setting "oa->o_id" and
- * "oa->o_seq". */
-static inline void obdo_from_ostid(struct obdo *oa, struct ost_id *ostid)
-{
-        oa->o_id  = ostid_id(ostid);
-        oa->o_seq = ostid_seq(ostid);
-}
-
-static inline void ioobj_from_obdo(struct obd_ioobj *ioobj, struct obdo *oa)
-{
-        ioobj->ioo_id  = oa->o_id;
-        ioobj->ioo_seq = oa->o_seq;
-}
-
 #endif /* OST_INTERNAL_H */
 #endif /* OST_INTERNAL_H */
index 52c06bc..ecbad5f 100644 (file)
@@ -592,7 +592,7 @@ static const struct req_msg_field *ost_get_last_id_server[] = {
 
 static const struct req_msg_field *ost_get_last_fid_server[] = {
        &RMF_PTLRPC_BODY,
 
 static const struct req_msg_field *ost_get_last_fid_server[] = {
        &RMF_PTLRPC_BODY,
-       &RMF_OST_ID
+       &RMF_FID,
 };
 
 static const struct req_msg_field *ost_get_fiemap_client[] = {
 };
 
 static const struct req_msg_field *ost_get_fiemap_client[] = {
index c63e447..edc5928 100644 (file)
@@ -80,8 +80,8 @@ int llog_origin_handle_open(struct ptlrpc_request *req)
         if (body == NULL)
                 RETURN(-EFAULT);
 
         if (body == NULL)
                 RETURN(-EFAULT);
 
-        if (body->lgd_logid.lgl_oid > 0)
-                logid = &body->lgd_logid;
+       if (ostid_id(&body->lgd_logid.lgl_oi) > 0)
+               logid = &body->lgd_logid;
 
         if (req_capsule_field_present(&req->rq_pill, &RMF_NAME, RCL_CLIENT)) {
                 name = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
 
         if (req_capsule_field_present(&req->rq_pill, &RMF_NAME, RCL_CLIENT)) {
                 name = req_capsule_client_get(&req->rq_pill, &RMF_NAME);
@@ -136,8 +136,8 @@ int llog_origin_handle_destroy(struct ptlrpc_request *req)
         if (body == NULL)
                 RETURN(-EFAULT);
 
         if (body == NULL)
                 RETURN(-EFAULT);
 
-        if (body->lgd_logid.lgl_oid > 0)
-                logid = &body->lgd_logid;
+       if (ostid_id(&body->lgd_logid.lgl_oi) > 0)
+               logid = &body->lgd_logid;
 
        if (!(body->lgd_llh_flags & LLOG_F_IS_PLAIN))
                CERROR("%s: wrong llog flags %x\n",
 
        if (!(body->lgd_llh_flags & LLOG_F_IS_PLAIN))
                CERROR("%s: wrong llog flags %x\n",
index 8269d5a..1182531 100644 (file)
@@ -1726,13 +1726,6 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
         CLASSERT(offsetof(typeof(*ocd), paddingF) != 0);
 }
 
         CLASSERT(offsetof(typeof(*ocd), paddingF) != 0);
 }
 
-void lustre_swab_ost_id(struct ost_id *oid)
-{
-       __swab64s(&oid->oi_id);
-       __swab64s(&oid->oi_seq);
-}
-EXPORT_SYMBOL(lustre_swab_ost_id);
-
 void lustre_swab_obdo (struct obdo  *o)
 {
         __swab64s (&o->o_valid);
 void lustre_swab_obdo (struct obdo  *o)
 {
         __swab64s (&o->o_valid);
@@ -1794,8 +1787,7 @@ EXPORT_SYMBOL(lustre_swab_obd_statfs);
 
 void lustre_swab_obd_ioobj(struct obd_ioobj *ioo)
 {
 
 void lustre_swab_obd_ioobj(struct obd_ioobj *ioo)
 {
-       __swab64s(&ioo->ioo_id);
-       __swab64s(&ioo->ioo_seq);
+       lustre_swab_ost_id(&ioo->ioo_oid);
        __swab32s(&ioo->ioo_max_brw);
        __swab32s(&ioo->ioo_bufcnt);
 }
        __swab32s(&ioo->ioo_max_brw);
        __swab32s(&ioo->ioo_bufcnt);
 }
@@ -2218,8 +2210,7 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod,
         int i;
         ENTRY;
         for (i = 0; i < stripe_count; i++) {
         int i;
         ENTRY;
         for (i = 0; i < stripe_count; i++) {
-                __swab64s(&(lod[i].l_object_id));
-                __swab64s(&(lod[i].l_object_seq));
+                lustre_swab_ost_id(&(lod[i].l_ost_oi));
                 __swab32s(&(lod[i].l_ost_gen));
                 __swab32s(&(lod[i].l_ost_idx));
         }
                 __swab32s(&(lod[i].l_ost_gen));
                 __swab32s(&(lod[i].l_ost_idx));
         }
@@ -2306,8 +2297,8 @@ void lustre_swab_quota_body(struct quota_body *b)
 void dump_ioo(struct obd_ioobj *ioo)
 {
        CDEBUG(D_RPCTRACE,
 void dump_ioo(struct obd_ioobj *ioo)
 {
        CDEBUG(D_RPCTRACE,
-              "obd_ioobj: ioo_id="LPD64", ioo_seq="LPD64", ioo_max_brw=%#x, "
-              "ioo_bufct=%d\n", ioo->ioo_id, ioo->ioo_seq, ioo->ioo_max_brw,
+              "obd_ioobj: ioo_oid="DOSTID", ioo_max_brw=%#x, "
+              "ioo_bufct=%d\n", POSTID(&ioo->ioo_oid), ioo->ioo_max_brw,
               ioo->ioo_bufcnt);
 }
 EXPORT_SYMBOL(dump_ioo);
               ioo->ioo_bufcnt);
 }
 EXPORT_SYMBOL(dump_ioo);
@@ -2321,16 +2312,14 @@ EXPORT_SYMBOL(dump_rniobuf);
 
 void dump_obdo(struct obdo *oa)
 {
 
 void dump_obdo(struct obdo *oa)
 {
-        __u32 valid = oa->o_valid;
+       __u32 valid = oa->o_valid;
 
 
-        CDEBUG(D_RPCTRACE, "obdo: o_valid = %08x\n", valid);
-        if (valid & OBD_MD_FLID)
-                CDEBUG(D_RPCTRACE, "obdo: o_id = "LPD64"\n", oa->o_id);
-        if (valid & OBD_MD_FLGROUP)
-                CDEBUG(D_RPCTRACE, "obdo: o_seq = "LPD64"\n", oa->o_seq);
-        if (valid & OBD_MD_FLFID)
-                CDEBUG(D_RPCTRACE, "obdo: o_parent_seq = "LPX64"\n",
-                       oa->o_parent_seq);
+       CDEBUG(D_RPCTRACE, "obdo: o_valid = %08x\n", valid);
+       if (valid & OBD_MD_FLID)
+               CDEBUG(D_RPCTRACE, "obdo: id = "DOSTID"\n", POSTID(&oa->o_oi));
+       if (valid & OBD_MD_FLFID)
+               CDEBUG(D_RPCTRACE, "obdo: o_parent_seq = "LPX64"\n",
+                      oa->o_parent_seq);
         if (valid & OBD_MD_FLSIZE)
                 CDEBUG(D_RPCTRACE, "obdo: o_size = "LPD64"\n", oa->o_size);
         if (valid & OBD_MD_FLMTIME)
         if (valid & OBD_MD_FLSIZE)
                 CDEBUG(D_RPCTRACE, "obdo: o_size = "LPD64"\n", oa->o_size);
         if (valid & OBD_MD_FLMTIME)
index 9d43a95..d5b4386 100644 (file)
@@ -513,14 +513,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct ost_id */
        LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ost_id));
        /* Checks for struct ost_id */
        LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ost_id));
-       LASSERTF((int)offsetof(struct ost_id, oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct ost_id, oi_id));
-       LASSERTF((int)sizeof(((struct ost_id *)0)->oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ost_id *)0)->oi_id));
-       LASSERTF((int)offsetof(struct ost_id, oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct ost_id, oi_seq));
-       LASSERTF((int)sizeof(((struct ost_id *)0)->oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ost_id *)0)->oi_seq));
+       LASSERTF((int)offsetof(struct ost_id, oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct ost_id, oi));
+       LASSERTF((int)sizeof(((struct ost_id *)0)->oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct ost_id *)0)->oi));
        LASSERTF(LUSTRE_FID_INIT_OID == 1, "found %lld\n",
                 (long long)LUSTRE_FID_INIT_OID);
        LASSERTF(FID_SEQ_OST_MDT0 == 0, "found %lld\n",
        LASSERTF(LUSTRE_FID_INIT_OID == 1, "found %lld\n",
                 (long long)LUSTRE_FID_INIT_OID);
        LASSERTF(FID_SEQ_OST_MDT0 == 0, "found %lld\n",
@@ -555,6 +551,8 @@ void lustre_assert_wire_constants(void)
                        (long long)FID_SEQ_QUOTA);
        LASSERTF(FID_SEQ_QUOTA_GLB == 0x0000000200000006ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_QUOTA_GLB);
                        (long long)FID_SEQ_QUOTA);
        LASSERTF(FID_SEQ_QUOTA_GLB == 0x0000000200000006ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_QUOTA_GLB);
+       LASSERTF(FID_SEQ_ROOT == 0x0000000200000007ULL, "found 0x%.16llxULL\n",
+                       (long long)FID_SEQ_ROOT);
        LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_NORMAL);
        LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
        LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_NORMAL);
        LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
@@ -1170,14 +1168,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obdo, o_valid));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obdo *)0)->o_valid));
                 (long long)(int)offsetof(struct obdo, o_valid));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obdo *)0)->o_valid));
-       LASSERTF((int)offsetof(struct obdo, o_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct obdo, o_oi.oi_id));
-       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obdo *)0)->o_oi.oi_id));
-       LASSERTF((int)offsetof(struct obdo, o_oi.oi_seq) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct obdo, o_oi.oi_seq));
-       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obdo *)0)->o_oi.oi_seq));
+       LASSERTF((int)offsetof(struct obdo, o_oi) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct obdo, o_oi));
+       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct obdo *)0)->o_oi));
        LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, "found %lld\n",
                 (long long)(int)offsetof(struct obdo, o_parent_seq));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, "found %lld\n",
        LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, "found %lld\n",
                 (long long)(int)offsetof(struct obdo, o_parent_seq));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, "found %lld\n",
@@ -1401,14 +1395,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct lov_ost_data_v1 */
        LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct lov_ost_data_v1));
        /* Checks for struct lov_ost_data_v1 */
        LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct lov_ost_data_v1));
-       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_id));
-       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_id));
-       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_seq));
-       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_seq));
+       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi));
+       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi));
        LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
        LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
        LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, "found %lld\n",
@@ -1576,14 +1566,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct obd_ioobj));
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct obd_ioobj));
-       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid.oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct obd_ioobj, ioo_oid.oi_id));
-       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_id));
-       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid.oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct obd_ioobj, ioo_oid.oi_seq));
-       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_seq));
+       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct obd_ioobj, ioo_oid));
+       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid));
        LASSERTF((int)offsetof(struct obd_ioobj, ioo_max_brw) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct obd_ioobj, ioo_max_brw));
        LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct obd_ioobj, ioo_max_brw) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct obd_ioobj, ioo_max_brw));
        LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw) == 4, "found %lld\n",
@@ -3289,14 +3275,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct llog_logid */
        LASSERTF((int)sizeof(struct llog_logid) == 20, "found %lld\n",
                 (long long)(int)sizeof(struct llog_logid));
        /* Checks for struct llog_logid */
        LASSERTF((int)sizeof(struct llog_logid) == 20, "found %lld\n",
                 (long long)(int)sizeof(struct llog_logid));
-       LASSERTF((int)offsetof(struct llog_logid, lgl_oid) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct llog_logid, lgl_oid));
-       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
-       LASSERTF((int)offsetof(struct llog_logid, lgl_oseq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct llog_logid, lgl_oseq));
-       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oseq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oseq));
+       LASSERTF((int)offsetof(struct llog_logid, lgl_oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct llog_logid, lgl_oi));
+       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oi));
        LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct llog_logid, lgl_ogen));
        LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct llog_logid, lgl_ogen));
        LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
@@ -3454,14 +3436,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_hdr));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr));
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_hdr));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr));
-       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oid) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oid));
-       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid));
-       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oseq) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oseq));
-       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oi) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oi));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi));
        LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == 4, "found %lld\n",
index db695a2..f1f8bff 100644 (file)
@@ -3776,7 +3776,8 @@ test_53() {
                ostnum=$(index_from_ostuuid ${ostname}_UUID)
                node=$(facet_active_host ost$((ostnum+1)))
                param="obdfilter.$ostname.last_id"
                ostnum=$(index_from_ostuuid ${ostname}_UUID)
                node=$(facet_active_host ost$((ostnum+1)))
                param="obdfilter.$ostname.last_id"
-               ost_last=$(do_node $node lctl get_param -n $param | head -n 1)
+               ost_last=$(do_node $node lctl get_param -n $param | head -n 1 |
+                          awk -F':' '{print $2}')
                 echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
                 if [ $ost_last != $mds_last ]; then
                     error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
                 echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
                 if [ $ost_last != $mds_last ]; then
                     error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
index b2842c8..7204833 100644 (file)
@@ -2022,7 +2022,7 @@ static void lov_dump_user_lmm_header(struct lov_user_md *lum, char *path,
         int rc;
 
        if (is_dir && ostid_seq(&lum->lmm_oi) == FID_SEQ_LOV_DEFAULT) {
         int rc;
 
        if (is_dir && ostid_seq(&lum->lmm_oi) == FID_SEQ_LOV_DEFAULT) {
-               lum->lmm_oi.oi_seq = FID_SEQ_OST_MDT0;
+               ostid_set_seq_mdt0(&lum->lmm_oi);
                if (verbose & VERBOSE_DETAIL)
                        llapi_printf(LLAPI_MSG_NORMAL, "(Default) ");
        }
                if (verbose & VERBOSE_DETAIL)
                        llapi_printf(LLAPI_MSG_NORMAL, "(Default) ");
        }
@@ -2154,8 +2154,8 @@ void lov_dump_user_lmm_v1v3(struct lov_user_md *lum, char *pool_name,
 
                 for (i = 0; i < lum->lmm_stripe_count; i++) {
                         int idx = objects[i].l_ost_idx;
 
                 for (i = 0; i < lum->lmm_stripe_count; i++) {
                         int idx = objects[i].l_ost_idx;
-                        long long oid = objects[i].l_object_id;
-                        long long gr = objects[i].l_object_seq;
+                        long long oid = ostid_id(&objects[i].l_ost_oi);
+                        long long gr = ostid_seq(&objects[i].l_ost_oi);
                        if ((obdindex == OBD_NOT_FOUND) || (obdindex == idx)) {
                                char fmt[48];
                                sprintf(fmt, "%s%s%s\n",
                        if ((obdindex == OBD_NOT_FOUND) || (obdindex == idx)) {
                                char fmt[48];
                                sprintf(fmt, "%s%s%s\n",
@@ -3002,7 +3002,8 @@ 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_oi.oi_seq = FID_SEQ_LOV_DEFAULT;
+                               ostid_set_seq(&lmm->lmm_oi,
+                                             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;
index 19072a5..49d2425 100644 (file)
@@ -471,18 +471,18 @@ out:
 /* See jt_obd_create */
 static int obj_create(struct kid_t *kid)
 {
 /* See jt_obd_create */
 static int obj_create(struct kid_t *kid)
 {
-        struct obd_ioctl_data data;
-        int rc;
-
-        memset(&data, 0, sizeof(data));
-        data.ioc_dev = kid->k_dev;
-        data.ioc_obdo1.o_mode = 0100644;
-        data.ioc_obdo1.o_id = 0;
-        data.ioc_obdo1.o_seq = FID_SEQ_ECHO;
-        data.ioc_obdo1.o_uid = 0;
-        data.ioc_obdo1.o_gid = 0;
-        data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
-                OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID;
+       struct obd_ioctl_data data;
+       int rc;
+
+       memset(&data, 0, sizeof(data));
+       data.ioc_dev = kid->k_dev;
+       data.ioc_obdo1.o_mode = 0100644;
+       ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
+       ostid_set_id(&data.ioc_obdo1.o_oi, 1);
+       data.ioc_obdo1.o_uid = 0;
+       data.ioc_obdo1.o_gid = 0;
+       data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
+                       OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID;
 
         rc = obj_ioctl(OBD_IOC_CREATE, &data, 1);
         if (rc) {
 
         rc = obj_ioctl(OBD_IOC_CREATE, &data, 1);
         if (rc) {
@@ -497,7 +497,7 @@ static int obj_create(struct kid_t *kid)
                 return rc;
         }
 
                 return rc;
         }
 
-        kid->k_objid = data.ioc_obdo1.o_id;
+       kid->k_objid = ostid_id(&data.ioc_obdo1.o_oi);
 
         if (o_verbose > 4)
                 printf("%d: cr "LPX64"\n", kid->k_id, kid->k_objid);
 
         if (o_verbose > 4)
                 printf("%d: cr "LPX64"\n", kid->k_id, kid->k_objid);
@@ -516,7 +516,7 @@ static int obj_delete(struct kid_t *kid)
 
         memset(&data, 0, sizeof(data));
         data.ioc_dev = kid->k_dev;
 
         memset(&data, 0, sizeof(data));
         data.ioc_dev = kid->k_dev;
-        data.ioc_obdo1.o_id = kid->k_objid;
+       ostid_set_id(&data.ioc_obdo1.o_oi, kid->k_objid);
         data.ioc_obdo1.o_mode = S_IFREG | 0644;
         data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLMODE;
 
         data.ioc_obdo1.o_mode = S_IFREG | 0644;
         data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLMODE;
 
@@ -556,13 +556,14 @@ static int obj_write(struct kid_t *kid)
         data.ioc_pbuf1 = (void *)1;
         data.ioc_plen1 = 1;
 
         data.ioc_pbuf1 = (void *)1;
         data.ioc_plen1 = 1;
 
-        data.ioc_obdo1.o_id = kid->k_objid;
-        data.ioc_obdo1.o_mode = S_IFREG;
-        data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE |
-                OBD_MD_FLFLAGS;
-        data.ioc_obdo1.o_flags = OBD_FL_DEBUG_CHECK;
-        data.ioc_count = len;
-        data.ioc_offset = 0;
+       ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
+       ostid_set_id(&data.ioc_obdo1.o_oi, kid->k_objid);
+       data.ioc_obdo1.o_mode = S_IFREG;
+       data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE |
+                                OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
+       data.ioc_obdo1.o_flags = OBD_FL_DEBUG_CHECK;
+       data.ioc_count = len;
+       data.ioc_offset = 0;
 
         gettimeofday(&start, NULL);
 
 
         gettimeofday(&start, NULL);
 
index e675d23..6cb9d30 100644 (file)
@@ -202,17 +202,18 @@ out:
 
 char *obdo_print(struct obdo *obd)
 {
 
 char *obdo_print(struct obdo *obd)
 {
-        char buf[1024];
+       char buf[1024];
 
 
-        sprintf(buf, "id: "LPX64"\ngrp: "LPX64"\natime: "LPU64"\nmtime: "LPU64
-                "\nctime: "LPU64"\nsize: "LPU64"\nblocks: "LPU64
-                "\nblksize: %u\nmode: %o\nuid: %d\ngid: %d\nflags: %x\n"
-                "misc: %x\nnlink: %d,\nvalid "LPX64"\n",
-                obd->o_id, obd->o_seq, obd->o_atime, obd->o_mtime, obd->o_ctime,
-                obd->o_size, obd->o_blocks, obd->o_blksize, obd->o_mode,
-                obd->o_uid, obd->o_gid, obd->o_flags, obd->o_misc,
-                obd->o_nlink, obd->o_valid);
-        return strdup(buf);
+       sprintf(buf, "id: "LPX64"\ngrp: "LPX64"\natime: "LPU64"\nmtime: "LPU64
+               "\nctime: "LPU64"\nsize: "LPU64"\nblocks: "LPU64
+               "\nblksize: %u\nmode: %o\nuid: %d\ngid: %d\nflags: %x\n"
+               "misc: %x\nnlink: %d,\nvalid "LPX64"\n",
+               ostid_id(&obd->o_oi), ostid_seq(&obd->o_oi), obd->o_atime,
+               obd->o_mtime, obd->o_ctime,
+               obd->o_size, obd->o_blocks, obd->o_blksize, obd->o_mode,
+               obd->o_uid, obd->o_gid, obd->o_flags, obd->o_misc,
+               obd->o_nlink, obd->o_valid);
+       return strdup(buf);
 }
 
 
 }
 
 
@@ -300,7 +301,7 @@ parse_lsm (struct lsm_buffer *lsmb, char *string)
 
         reset_lsmb (lsmb);
 
 
         reset_lsmb (lsmb);
 
-       lsm->lsm_oi.oi_id = strtoull(string, &end, 0);
+       ostid_set_id(&lsm->lsm_oi, strtoull(string, &end, 0));
        if (end == string)
                return -1;
        string = end;
        if (end == string)
                return -1;
        string = end;
@@ -329,17 +330,18 @@ parse_lsm (struct lsm_buffer *lsmb, char *string)
         if (*string == 0)               /* don't have to specify obj ids */
                 return (0);
 
         if (*string == 0)               /* don't have to specify obj ids */
                 return (0);
 
-        for (i = 0; i < lsm->lsm_stripe_count; i++) {
-                if (*string != '@')
-                        return (-1);
-                string++;
-                lsm->lsm_oinfo[i]->loi_ost_idx = strtoul(string, &end, 0);
-                if (*end != ':')
-                        return (-1);
-                string = end + 1;
-                lsm->lsm_oinfo[i]->loi_id = strtoull(string, &end, 0);
-                string = end;
-        }
+       for (i = 0; i < lsm->lsm_stripe_count; i++) {
+               if (*string != '@')
+                       return (-1);
+               string++;
+               lsm->lsm_oinfo[i]->loi_ost_idx = strtoul(string, &end, 0);
+               if (*end != ':')
+                       return (-1);
+               string = end + 1;
+               ostid_set_id(&lsm->lsm_oinfo[i]->loi_oi,
+                            strtoull(string, &end, 0));
+               string = end;
+       }
 
         if (*string != 0)
                 return (-1);
 
         if (*string != 0)
                 return (-1);
@@ -1411,9 +1413,9 @@ int jt_obd_md_common(int argc, char **argv, int cmd)
 
         gettimeofday(&start, NULL);
         while (shmem_running()) {
 
         gettimeofday(&start, NULL);
         while (shmem_running()) {
-                struct lu_fid fid;
+                struct lu_fid fid = { 0 };
 
 
-                data.ioc_obdo2.o_id = child_base_id;
+               ostid_set_id(&data.ioc_obdo2.o_oi, child_base_id);
                 data.ioc_obdo2.o_mode = mode | create_mode;
                 data.ioc_obdo2.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
                                          OBD_MD_FLMODE | OBD_MD_FLFLAGS |
                 data.ioc_obdo2.o_mode = mode | create_mode;
                 data.ioc_obdo2.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE |
                                          OBD_MD_FLMODE | OBD_MD_FLFLAGS |
@@ -1438,8 +1440,7 @@ int jt_obd_md_common(int argc, char **argv, int cmd)
                                 fprintf(stderr, "Allocate fids error %d.\n",rc);
                                 return rc;
                         }
                                 fprintf(stderr, "Allocate fids error %d.\n",rc);
                                 return rc;
                         }
-                        data.ioc_obdo1.o_seq = fid.f_seq;
-                        data.ioc_obdo1.o_id = fid.f_oid;
+                       fid_to_ostid(&fid, &data.ioc_obdo1.o_oi);
                 }
 
                 child_base_id += data.ioc_count;
                 }
 
                 child_base_id += data.ioc_count;
@@ -1534,7 +1535,7 @@ int jt_obd_create(int argc, char **argv)
         char rawbuf[MAX_IOC_BUFLEN], *buf = rawbuf;
         struct obd_ioctl_data data;
         struct timeval next_time;
         char rawbuf[MAX_IOC_BUFLEN], *buf = rawbuf;
         struct obd_ioctl_data data;
         struct timeval next_time;
-        __u64 count = 1, next_count, base_id = 0;
+        __u64 count = 1, next_count, base_id = 1;
         int verbose = 1, mode = 0100644, rc = 0, i, valid_lsm = 0;
         char *end;
 
         int verbose = 1, mode = 0100644, rc = 0, i, valid_lsm = 0;
         char *end;
 
@@ -1585,17 +1586,18 @@ int jt_obd_create(int argc, char **argv)
         next_time.tv_sec -= verbose;
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
         next_time.tv_sec -= verbose;
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
-                data.ioc_obdo1.o_mode = mode;
-                data.ioc_obdo1.o_id = base_id;
-                data.ioc_obdo1.o_uid = 0;
-                data.ioc_obdo1.o_gid = 0;
-                data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
-                        OBD_MD_FLID | OBD_MD_FLUID | OBD_MD_FLGID;
-
-                if (valid_lsm) {
-                        data.ioc_plen1 = sizeof lsm_buffer;
-                        data.ioc_pbuf1 = (char *)&lsm_buffer;
-                }
+               data.ioc_obdo1.o_mode = mode;
+               ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
+               ostid_set_id(&data.ioc_obdo1.o_oi, base_id);
+               data.ioc_obdo1.o_uid = 0;
+               data.ioc_obdo1.o_gid = 0;
+               data.ioc_obdo1.o_valid = OBD_MD_FLTYPE | OBD_MD_FLMODE |
+                                        OBD_MD_FLID | OBD_MD_FLUID |
+                                        OBD_MD_FLGID | OBD_MD_FLGROUP;
+               if (valid_lsm) {
+                       data.ioc_plen1 = sizeof lsm_buffer;
+                       data.ioc_pbuf1 = (char *)&lsm_buffer;
+               }
 
                 memset(buf, 0, sizeof(rawbuf));
                 rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
 
                 memset(buf, 0, sizeof(rawbuf));
                 rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
@@ -1619,9 +1621,10 @@ int jt_obd_create(int argc, char **argv)
                         break;
                 }
 
                         break;
                 }
 
-                if (be_verbose(verbose, &next_time, i, &next_count, count))
-                        printf("%s: #%d is object id "LPX64"\n",
-                                jt_cmdname(argv[0]), i, data.ioc_obdo1.o_id);
+               if (be_verbose(verbose, &next_time, i, &next_count, count))
+                       printf("%s: #%d is object id "LPX64"\n",
+                              jt_cmdname(argv[0]), i,
+                              ostid_id(&data.ioc_obdo1.o_oi));
         }
         return rc;
 }
         }
         return rc;
 }
@@ -1638,7 +1641,7 @@ int jt_obd_setattr(int argc, char **argv)
         if (argc != 2)
                 return CMD_HELP;
 
         if (argc != 2)
                 return CMD_HELP;
 
-        data.ioc_obdo1.o_id = strtoull(argv[1], &end, 0);
+       ostid_set_id(&data.ioc_obdo1.o_oi, strtoull(argv[1], &end, 0));
         if (*end) {
                 fprintf(stderr, "error: %s: invalid objid '%s'\n",
                         jt_cmdname(argv[0]), argv[1]);
         if (*end) {
                 fprintf(stderr, "error: %s: invalid objid '%s'\n",
                         jt_cmdname(argv[0]), argv[1]);
@@ -1718,7 +1721,7 @@ int jt_obd_test_setattr(int argc, char **argv)
                        jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
                        jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
-                data.ioc_obdo1.o_id = objid;
+               ostid_set_id(&data.ioc_obdo1.o_oi, objid);
                 data.ioc_obdo1.o_mode = S_IFREG;
                 data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
                 memset(buf, 0, sizeof(rawbuf));
                 data.ioc_obdo1.o_mode = S_IFREG;
                 data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
                 memset(buf, 0, sizeof(rawbuf));
@@ -1802,9 +1805,9 @@ int jt_obd_destroy(int argc, char **argv)
         next_time.tv_sec -= verbose;
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++, id++) {
         next_time.tv_sec -= verbose;
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++, id++) {
-                data.ioc_obdo1.o_id = id;
-                data.ioc_obdo1.o_mode = S_IFREG | 0644;
-                data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLMODE;
+               ostid_set_id(&data.ioc_obdo1.o_oi, id);
+               data.ioc_obdo1.o_mode = S_IFREG | 0644;
+               data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLMODE;
 
                 memset(buf, 0, sizeof(rawbuf));
                 rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
 
                 memset(buf, 0, sizeof(rawbuf));
                 rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
@@ -1840,18 +1843,19 @@ int jt_obd_getattr(int argc, char **argv)
         if (argc != 2)
                 return CMD_HELP;
 
         if (argc != 2)
                 return CMD_HELP;
 
-        memset(&data, 0, sizeof(data));
-        data.ioc_dev = cur_device;
-        data.ioc_obdo1.o_id = strtoull(argv[1], &end, 0);
-        if (*end) {
-                fprintf(stderr, "error: %s: invalid objid '%s'\n",
-                        jt_cmdname(argv[0]), argv[1]);
-                return CMD_HELP;
-        }
-        /* to help obd filter */
-        data.ioc_obdo1.o_mode = 0100644;
-        data.ioc_obdo1.o_valid = 0xffffffff;
-        printf("%s: object id "LPX64"\n", jt_cmdname(argv[0]),data.ioc_obdo1.o_id);
+       memset(&data, 0, sizeof(data));
+       data.ioc_dev = cur_device;
+       ostid_set_id(&data.ioc_obdo1.o_oi, strtoull(argv[1], &end, 0));
+       if (*end) {
+               fprintf(stderr, "error: %s: invalid objid '%s'\n",
+                       jt_cmdname(argv[0]), argv[1]);
+               return CMD_HELP;
+       }
+       /* to help obd filter */
+       data.ioc_obdo1.o_mode = 0100644;
+       data.ioc_obdo1.o_valid = 0xffffffff;
+       printf("%s: object id "LPX64"\n", jt_cmdname(argv[0]),
+              ostid_id(&data.ioc_obdo1.o_oi));
 
         memset(buf, 0, sizeof(rawbuf));
         rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
 
         memset(buf, 0, sizeof(rawbuf));
         rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
@@ -1866,8 +1870,8 @@ int jt_obd_getattr(int argc, char **argv)
                 fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
                         strerror(rc = errno));
         } else {
                 fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
                         strerror(rc = errno));
         } else {
-                printf("%s: object id "LPX64", mode %o\n", jt_cmdname(argv[0]),
-                       data.ioc_obdo1.o_id, data.ioc_obdo1.o_mode);
+               printf("%s: object id "LPU64", mode %o\n", jt_cmdname(argv[0]),
+                      ostid_id(&data.ioc_obdo1.o_oi), data.ioc_obdo1.o_mode);
         }
         return rc;
 }
         }
         return rc;
 }
@@ -1923,16 +1927,16 @@ int jt_obd_test_getattr(int argc, char **argv)
                        jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
                        jt_cmdname(argv[0]), count, objid, ctime(&start.tv_sec));
 
         for (i = 1, next_count = verbose; i <= count && shmem_running(); i++) {
-                data.ioc_obdo1.o_id = objid;
-                data.ioc_obdo1.o_mode = S_IFREG;
-                data.ioc_obdo1.o_valid = 0xffffffff;
-                memset(buf, 0, sizeof(rawbuf));
-                rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
-                if (rc) {
-                        fprintf(stderr, "error: %s: invalid ioctl\n",
-                                jt_cmdname(argv[0]));
-                        return rc;
-                }
+               ostid_set_id(&data.ioc_obdo1.o_oi, objid);
+               data.ioc_obdo1.o_mode = S_IFREG;
+               data.ioc_obdo1.o_valid = 0xffffffff;
+               memset(buf, 0, sizeof(rawbuf));
+               rc = obd_ioctl_pack(&data, &buf, sizeof(rawbuf));
+               if (rc) {
+                       fprintf(stderr, "error: %s: invalid ioctl\n",
+                               jt_cmdname(argv[0]));
+                       return rc;
+               }
                 rc = l2_ioctl(OBD_DEV_ID, OBD_IOC_GETATTR, &data);
                 shmem_bump(1);
                 if (rc < 0) {
                 rc = l2_ioctl(OBD_DEV_ID, OBD_IOC_GETATTR, &data);
                 shmem_bump(1);
                 if (rc < 0) {
@@ -2128,12 +2132,14 @@ int jt_obd_test_brw(int argc, char **argv)
         }
 #endif
 
         }
 #endif
 
-        data.ioc_obdo1.o_id = objid;
-        data.ioc_obdo1.o_mode = S_IFREG;
-        data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE | OBD_MD_FLFLAGS;
-        data.ioc_obdo1.o_flags = (verify ? OBD_FL_DEBUG_CHECK : 0);
-        data.ioc_count = len;
-        data.ioc_offset = (repeat_offset ? 0 : thr_offset);
+       ostid_set_seq_echo(&data.ioc_obdo1.o_oi);
+       ostid_set_id(&data.ioc_obdo1.o_oi, objid);
+       data.ioc_obdo1.o_mode = S_IFREG;
+       data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE |
+                                OBD_MD_FLFLAGS | OBD_MD_FLGROUP;
+       data.ioc_obdo1.o_flags = (verify ? OBD_FL_DEBUG_CHECK : 0);
+       data.ioc_count = len;
+       data.ioc_offset = (repeat_offset ? 0 : thr_offset);
 
         gettimeofday(&start, NULL);
         next_time.tv_sec = start.tv_sec - verbose;
 
         gettimeofday(&start, NULL);
         next_time.tv_sec = start.tv_sec - verbose;
@@ -2162,12 +2168,12 @@ int jt_obd_test_brw(int argc, char **argv)
                                 write ? "write" : "read");
                         break;
                 } else if (be_verbose(verbose, &next_time,i, &next_count,count)) {
                                 write ? "write" : "read");
                         break;
                 } else if (be_verbose(verbose, &next_time,i, &next_count,count)) {
-                        shmem_lock ();
-                        printf("%s: %s number %d @ "LPD64":"LPU64" for %d\n",
-                               jt_cmdname(argv[0]), write ? "write" : "read", i,
-                               data.ioc_obdo1.o_id, data.ioc_offset,
-                               (int)(pages * getpagesize()));
-                        shmem_unlock ();
+                       shmem_lock ();
+                       printf("%s: %s number %d @ "LPD64":"LPU64" for %d\n",
+                              jt_cmdname(argv[0]), write ? "write" : "read", i,
+                              ostid_id(&data.ioc_obdo1.o_oi), data.ioc_offset,
+                              (int)(pages * getpagesize()));
+                       shmem_unlock ();
                 }
 
                 if (!repeat_offset) {
                 }
 
                 if (!repeat_offset) {
index bec0278..093a4cd 100644 (file)
@@ -126,10 +126,10 @@ obdio_pread (struct obdio_conn *conn, __u64 oid,
 {
         obdio_iocinit (conn);
 
 {
         obdio_iocinit (conn);
 
-        conn->oc_data.ioc_obdo1.o_id = oid;
-        conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
-        conn->oc_data.ioc_obdo1.o_valid =
-                OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
+       ostid_set_id(&conn->oc_data.ioc_obdo1.o_oi, oid);
+       conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
+       conn->oc_data.ioc_obdo1.o_valid =
+               OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
 
         conn->oc_data.ioc_pbuf2 = buffer;
         conn->oc_data.ioc_plen2 = count;
 
         conn->oc_data.ioc_pbuf2 = buffer;
         conn->oc_data.ioc_plen2 = count;
@@ -145,10 +145,10 @@ obdio_pwrite (struct obdio_conn *conn, __u64 oid,
 {
         obdio_iocinit (conn);
 
 {
         obdio_iocinit (conn);
 
-        conn->oc_data.ioc_obdo1.o_id = oid;
-        conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
-        conn->oc_data.ioc_obdo1.o_valid =
-                OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
+       ostid_set_id(&conn->oc_data.ioc_obdo1.o_oi, oid);
+       conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
+       conn->oc_data.ioc_obdo1.o_valid =
+               OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
 
         conn->oc_data.ioc_pbuf1 = (void*)1;
         conn->oc_data.ioc_plen1 = 1;
 
         conn->oc_data.ioc_pbuf1 = (void*)1;
         conn->oc_data.ioc_plen1 = 1;
@@ -169,9 +169,10 @@ obdio_enqueue (struct obdio_conn *conn, __u64 oid,
 
         obdio_iocinit (conn);
 
 
         obdio_iocinit (conn);
 
-        conn->oc_data.ioc_obdo1.o_id = oid;
-        conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
-        conn->oc_data.ioc_obdo1.o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
+       ostid_set_id(&conn->oc_data.ioc_obdo1.o_oi, oid);
+       conn->oc_data.ioc_obdo1.o_mode = S_IFREG;
+       conn->oc_data.ioc_obdo1.o_valid =
+               OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLMODE;
 
         conn->oc_data.ioc_conn1 = mode;
         conn->oc_data.ioc_count = count;
 
         conn->oc_data.ioc_conn1 = mode;
         conn->oc_data.ioc_count = count;
index 2211b0f..f1a75cd 100644 (file)
@@ -241,8 +241,7 @@ check_ost_id(void)
 {
        BLANK_LINE();
        CHECK_STRUCT(ost_id);
 {
        BLANK_LINE();
        CHECK_STRUCT(ost_id);
-       CHECK_MEMBER(ost_id, oi_id);
-       CHECK_MEMBER(ost_id, oi_seq);
+       CHECK_MEMBER(ost_id, oi);
 
        CHECK_VALUE(LUSTRE_FID_INIT_OID);
 
 
        CHECK_VALUE(LUSTRE_FID_INIT_OID);
 
@@ -262,6 +261,7 @@ check_ost_id(void)
        CHECK_VALUE_64X(FID_SEQ_SPECIAL);
        CHECK_VALUE_64X(FID_SEQ_QUOTA);
        CHECK_VALUE_64X(FID_SEQ_QUOTA_GLB);
        CHECK_VALUE_64X(FID_SEQ_SPECIAL);
        CHECK_VALUE_64X(FID_SEQ_QUOTA);
        CHECK_VALUE_64X(FID_SEQ_QUOTA_GLB);
+       CHECK_VALUE_64X(FID_SEQ_ROOT);
        CHECK_VALUE_64X(FID_SEQ_NORMAL);
        CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
 
        CHECK_VALUE_64X(FID_SEQ_NORMAL);
        CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
 
@@ -532,8 +532,7 @@ check_obdo(void)
        BLANK_LINE();
        CHECK_STRUCT(obdo);
        CHECK_MEMBER(obdo, o_valid);
        BLANK_LINE();
        CHECK_STRUCT(obdo);
        CHECK_MEMBER(obdo, o_valid);
-       CHECK_MEMBER(obdo, o_id);
-       CHECK_MEMBER(obdo, o_seq);
+       CHECK_MEMBER(obdo, o_oi);
        CHECK_MEMBER(obdo, o_parent_seq);
        CHECK_MEMBER(obdo, o_size);
        CHECK_MEMBER(obdo, o_mtime);
        CHECK_MEMBER(obdo, o_parent_seq);
        CHECK_MEMBER(obdo, o_size);
        CHECK_MEMBER(obdo, o_mtime);
@@ -637,8 +636,7 @@ check_lov_ost_data_v1(void)
 {
        BLANK_LINE();
        CHECK_STRUCT(lov_ost_data_v1);
 {
        BLANK_LINE();
        CHECK_STRUCT(lov_ost_data_v1);
-       CHECK_MEMBER(lov_ost_data_v1, l_object_id);
-       CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
+       CHECK_MEMBER(lov_ost_data_v1, l_ost_oi);
        CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
        CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
 }
        CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
        CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
 }
@@ -712,8 +710,7 @@ check_obd_ioobj(void)
 {
        BLANK_LINE();
        CHECK_STRUCT(obd_ioobj);
 {
        BLANK_LINE();
        CHECK_STRUCT(obd_ioobj);
-       CHECK_MEMBER(obd_ioobj, ioo_id);
-       CHECK_MEMBER(obd_ioobj, ioo_seq);
+       CHECK_MEMBER(obd_ioobj, ioo_oid);
        CHECK_MEMBER(obd_ioobj, ioo_max_brw);
        CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
 }
        CHECK_MEMBER(obd_ioobj, ioo_max_brw);
        CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
 }
@@ -1410,8 +1407,7 @@ check_llog_logid(void)
 {
        BLANK_LINE();
        CHECK_STRUCT(llog_logid);
 {
        BLANK_LINE();
        CHECK_STRUCT(llog_logid);
-       CHECK_MEMBER(llog_logid, lgl_oid);
-       CHECK_MEMBER(llog_logid, lgl_oseq);
+       CHECK_MEMBER(llog_logid, lgl_oi);
        CHECK_MEMBER(llog_logid, lgl_ogen);
 
        CHECK_CVALUE(OST_SZ_REC);
        CHECK_MEMBER(llog_logid, lgl_ogen);
 
        CHECK_CVALUE(OST_SZ_REC);
@@ -1501,8 +1497,7 @@ check_llog_setattr64_rec(void)
        BLANK_LINE();
        CHECK_STRUCT(llog_setattr64_rec);
        CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
        BLANK_LINE();
        CHECK_STRUCT(llog_setattr64_rec);
        CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
-       CHECK_MEMBER(llog_setattr64_rec, lsr_oid);
-       CHECK_MEMBER(llog_setattr64_rec, lsr_oseq);
+       CHECK_MEMBER(llog_setattr64_rec, lsr_oi);
        CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
        CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
        CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
        CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
        CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
        CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
index 3758f30..87dc49b 100644 (file)
@@ -521,14 +521,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct ost_id */
        LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ost_id));
        /* Checks for struct ost_id */
        LASSERTF((int)sizeof(struct ost_id) == 16, "found %lld\n",
                 (long long)(int)sizeof(struct ost_id));
-       LASSERTF((int)offsetof(struct ost_id, oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct ost_id, oi_id));
-       LASSERTF((int)sizeof(((struct ost_id *)0)->oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ost_id *)0)->oi_id));
-       LASSERTF((int)offsetof(struct ost_id, oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct ost_id, oi_seq));
-       LASSERTF((int)sizeof(((struct ost_id *)0)->oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct ost_id *)0)->oi_seq));
+       LASSERTF((int)offsetof(struct ost_id, oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct ost_id, oi));
+       LASSERTF((int)sizeof(((struct ost_id *)0)->oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct ost_id *)0)->oi));
        LASSERTF(LUSTRE_FID_INIT_OID == 1, "found %lld\n",
                 (long long)LUSTRE_FID_INIT_OID);
        LASSERTF(FID_SEQ_OST_MDT0 == 0, "found %lld\n",
        LASSERTF(LUSTRE_FID_INIT_OID == 1, "found %lld\n",
                 (long long)LUSTRE_FID_INIT_OID);
        LASSERTF(FID_SEQ_OST_MDT0 == 0, "found %lld\n",
@@ -563,6 +559,8 @@ void lustre_assert_wire_constants(void)
                        (long long)FID_SEQ_QUOTA);
        LASSERTF(FID_SEQ_QUOTA_GLB == 0x0000000200000006ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_QUOTA_GLB);
                        (long long)FID_SEQ_QUOTA);
        LASSERTF(FID_SEQ_QUOTA_GLB == 0x0000000200000006ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_QUOTA_GLB);
+       LASSERTF(FID_SEQ_ROOT == 0x0000000200000007ULL, "found 0x%.16llxULL\n",
+                       (long long)FID_SEQ_ROOT);
        LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_NORMAL);
        LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
        LASSERTF(FID_SEQ_NORMAL == 0x0000000200000400ULL, "found 0x%.16llxULL\n",
                        (long long)FID_SEQ_NORMAL);
        LASSERTF(FID_SEQ_LOV_DEFAULT == 0xffffffffffffffffULL, "found 0x%.16llxULL\n",
@@ -1178,14 +1176,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct obdo, o_valid));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obdo *)0)->o_valid));
                 (long long)(int)offsetof(struct obdo, o_valid));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 8, "found %lld\n",
                 (long long)(int)sizeof(((struct obdo *)0)->o_valid));
-       LASSERTF((int)offsetof(struct obdo, o_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct obdo, o_oi.oi_id));
-       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obdo *)0)->o_oi.oi_id));
-       LASSERTF((int)offsetof(struct obdo, o_oi.oi_seq) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct obdo, o_oi.oi_seq));
-       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obdo *)0)->o_oi.oi_seq));
+       LASSERTF((int)offsetof(struct obdo, o_oi) == 8, "found %lld\n",
+                (long long)(int)offsetof(struct obdo, o_oi));
+       LASSERTF((int)sizeof(((struct obdo *)0)->o_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct obdo *)0)->o_oi));
        LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, "found %lld\n",
                 (long long)(int)offsetof(struct obdo, o_parent_seq));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, "found %lld\n",
        LASSERTF((int)offsetof(struct obdo, o_parent_seq) == 24, "found %lld\n",
                 (long long)(int)offsetof(struct obdo, o_parent_seq));
        LASSERTF((int)sizeof(((struct obdo *)0)->o_parent_seq) == 8, "found %lld\n",
@@ -1409,14 +1403,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct lov_ost_data_v1 */
        LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct lov_ost_data_v1));
        /* Checks for struct lov_ost_data_v1 */
        LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct lov_ost_data_v1));
-       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_id));
-       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_id));
-       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi.oi_seq));
-       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi.oi_seq));
+       LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_oi));
+       LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_oi));
        LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
        LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
        LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, "found %lld\n",
@@ -1584,14 +1574,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct obd_ioobj));
        /* Checks for struct obd_ioobj */
        LASSERTF((int)sizeof(struct obd_ioobj) == 24, "found %lld\n",
                 (long long)(int)sizeof(struct obd_ioobj));
-       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid.oi_id) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct obd_ioobj, ioo_oid.oi_id));
-       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_id) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_id));
-       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid.oi_seq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct obd_ioobj, ioo_oid.oi_seq));
-       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_seq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid.oi_seq));
+       LASSERTF((int)offsetof(struct obd_ioobj, ioo_oid) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct obd_ioobj, ioo_oid));
+       LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_oid) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_oid));
        LASSERTF((int)offsetof(struct obd_ioobj, ioo_max_brw) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct obd_ioobj, ioo_max_brw));
        LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct obd_ioobj, ioo_max_brw) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct obd_ioobj, ioo_max_brw));
        LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_max_brw) == 4, "found %lld\n",
@@ -3297,14 +3283,10 @@ void lustre_assert_wire_constants(void)
        /* Checks for struct llog_logid */
        LASSERTF((int)sizeof(struct llog_logid) == 20, "found %lld\n",
                 (long long)(int)sizeof(struct llog_logid));
        /* Checks for struct llog_logid */
        LASSERTF((int)sizeof(struct llog_logid) == 20, "found %lld\n",
                 (long long)(int)sizeof(struct llog_logid));
-       LASSERTF((int)offsetof(struct llog_logid, lgl_oid) == 0, "found %lld\n",
-                (long long)(int)offsetof(struct llog_logid, lgl_oid));
-       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
-       LASSERTF((int)offsetof(struct llog_logid, lgl_oseq) == 8, "found %lld\n",
-                (long long)(int)offsetof(struct llog_logid, lgl_oseq));
-       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oseq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oseq));
+       LASSERTF((int)offsetof(struct llog_logid, lgl_oi) == 0, "found %lld\n",
+                (long long)(int)offsetof(struct llog_logid, lgl_oi));
+       LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oi));
        LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct llog_logid, lgl_ogen));
        LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, "found %lld\n",
                 (long long)(int)offsetof(struct llog_logid, lgl_ogen));
        LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, "found %lld\n",
@@ -3462,14 +3444,10 @@ void lustre_assert_wire_constants(void)
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_hdr));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr));
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_hdr));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr) == 16, "found %lld\n",
                 (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_hdr));
-       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oid) == 16, "found %lld\n",
-                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oid));
-       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oid));
-       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oseq) == 24, "found %lld\n",
-                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oseq));
-       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq) == 8, "found %lld\n",
-                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oseq));
+       LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_oi) == 16, "found %lld\n",
+                (long long)(int)offsetof(struct llog_setattr64_rec, lsr_oi));
+       LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi) == 16, "found %lld\n",
+                (long long)(int)sizeof(((struct llog_setattr64_rec *)0)->lsr_oi));
        LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == 4, "found %lld\n",
        LASSERTF((int)offsetof(struct llog_setattr64_rec, lsr_uid) == 32, "found %lld\n",
                 (long long)(int)offsetof(struct llog_setattr64_rec, lsr_uid));
        LASSERTF((int)sizeof(((struct llog_setattr64_rec *)0)->lsr_uid) == 4, "found %lld\n",