X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_internal.h;h=abb5c4941395622cc994894ef90f323a2fceb2bb;hb=b4b479dace076bed6210f78b498309038aeeb4a2;hp=662f7a167bcf83aa5d38acc2c80f4abfa6082f99;hpb=8e858671be59ed53fad2d340cf841b026943cc8a;p=fs%2Flustre-release.git diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 662f7a1..abb5c49 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -155,14 +155,15 @@ struct osd_device { struct dt_device od_dt_dev; /* information about underlying file system */ struct lustre_mount_info *od_mount; - /* object index */ - struct osd_oi od_oi; /* * XXX temporary stuff for object index: directory where every object * is named by its fid. */ struct dt_object *od_obj_area; - + /* object index */ + struct osd_oi *od_oi_table; + /* total number of OI containers */ + int od_oi_count; /* * Fid Capability */ @@ -275,7 +276,6 @@ struct osd_thread_info { /* * XXX temporary: for ->i_op calls. */ - struct txn_param oti_txn; struct timespec oti_time; /* * XXX temporary: fake struct file for osd_object_sync @@ -395,5 +395,17 @@ static inline int osd_fid_is_igif(const struct lu_fid *fid) return fid_is_igif(fid) || osd_fid_is_root(fid); } +static inline struct osd_oi * +osd_fid2oi(struct osd_device *osd, const struct lu_fid *fid) +{ + if (!fid_is_norm(fid)) + return NULL; + + LASSERT(osd->od_oi_table != NULL && osd->od_oi_count >= 1); + /* It can work even od_oi_count equals to 1 although it's unexpected, + * the only reason we set it to 1 is for performance measurement */ + return &osd->od_oi_table[fid->f_seq & (osd->od_oi_count - 1)]; +} + #endif /* __KERNEL__ */ #endif /* _OSD_INTERNAL_H */