From: pravins Date: Tue, 6 Jan 2009 18:14:49 +0000 (+0000) Subject: b=18108 X-Git-Tag: v1_9_140~36 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9452baf03ec4ed33ad61043a1e16f1706927894c;p=fs%2Flustre-release.git b=18108 i=huanghua i=nathan fix fid_pack() according to new seq allocation. --- diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 01b2d3e..5cae3c1 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1665,8 +1665,13 @@ void fid_pack(struct lu_fid_pack *pack, const struct lu_fid *fid, */ CLASSERT(LUSTRE_SEQ_MAX_WIDTH < 0xffffull); - if (fid_is_igif(fid) || - seq > 0xffffffull || oid > 0xffff || fid_ver(fid) != 0) { + /* fid can be packed in six bytes (first byte as length of packed fid, + * three bytes of seq and two bytes of oid). + * this reduces IO overhead specially for OSD Object Index. */ + + if (seq < FID_SEQ_START || + seq > (0xffffffull + FID_SEQ_START) || + oid > 0xffff || fid_ver(fid) != 0) { fid_cpu_to_be(befider, fid); recsize = sizeof *befider; } else { @@ -1703,6 +1708,7 @@ int fid_unpack(const struct lu_fid_pack *pack, struct lu_fid *fid) area = (unsigned char *)pack->fp_area; fid->f_seq = (area[0] << 16) | (area[1] << 8) | area[2]; + fid->f_seq += FID_SEQ_START; fid->f_oid = (area[3] << 8) | area[4]; fid->f_ver = 0; break;