Whamcloud - gitweb
LU-2684 fid: unify ostid and FID
[fs/lustre-release.git] / lustre / ofd / ofd_internal.h
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  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;
@@ -115,9 +115,6 @@ struct ofd_seq {
        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;
@@ -531,34 +528,6 @@ static inline struct ofd_thread_info * ofd_info_init(const struct lu_env *env,
        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)
 {
@@ -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))
-               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. */