+ __u32 oii_ino; /* inode number */
+ __u32 oii_gen; /* inode generation */
+};
+
+struct osd_idmap_cache {
+ struct lu_fid oic_fid;
+ struct osd_inode_id oic_lid;
+ struct osd_device *oic_dev;
+};
+
+static inline void osd_id_pack(struct osd_inode_id *tgt,
+ const struct osd_inode_id *src)
+{
+ tgt->oii_ino = cpu_to_be32(src->oii_ino);
+ tgt->oii_gen = cpu_to_be32(src->oii_gen);
+}
+
+static inline void osd_id_unpack(struct osd_inode_id *tgt,
+ struct osd_inode_id *src)
+{
+ tgt->oii_ino = be32_to_cpu(src->oii_ino);
+ tgt->oii_gen = be32_to_cpu(src->oii_gen);
+}
+
+static inline void osd_id_gen(struct osd_inode_id *id, __u32 ino, __u32 gen)
+{
+ id->oii_ino = ino;
+ id->oii_gen = gen;
+}
+
+static inline void osd_id_to_inode(struct inode *inode,
+ const struct osd_inode_id *id)
+{
+ inode->i_ino = id->oii_ino;
+ inode->i_generation = id->oii_gen;
+}
+
+static inline int osd_id_eq(const struct osd_inode_id *id0,
+ const struct osd_inode_id *id1)
+{
+ return (id0->oii_ino == id1->oii_ino) &&
+ (id0->oii_gen == id1->oii_gen ||
+ id0->oii_gen == OSD_OII_NOGEN ||
+ id1->oii_gen == OSD_OII_NOGEN);
+}
+
+static inline int osd_id_eq_strict(const struct osd_inode_id *id0,
+ const struct osd_inode_id *id1)
+{
+ return (id0->oii_ino == id1->oii_ino && id0->oii_gen == id1->oii_gen);
+}
+
+enum oi_check_flags {
+ OI_CHECK_FLD = 0x00000001,
+ OI_KNOWN_ON_OST = 0x00000002,