X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_oi.c;h=0918c75be6b09ca69ab9074ccdbeb2935a1fe6c7;hp=c1ce0a6fb1875f50bec8d3f7df0996249acc2894;hb=4980567857699c7f902ebda336ea98fdc4b83100;hpb=f2f09b6ecd85ceb05cd64907a71f87bbc49bfc21 diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index c1ce0a6..0918c75 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -444,17 +444,28 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd, { struct lu_fid *oi_fid = &info->oti_fid; const struct dt_key *key; - int rc = 0; + int rc = 0; - if (osd_fid_is_igif(fid)) { + if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG) { + /* old OSD obj id */ + rc = osd_compat_objid_lookup(info, osd, fid, id); + } else if (fid_is_igif(fid)) { lu_igif_to_id(fid, id); rc = 0; + } else if (fid_is_fs_root(fid)) { + struct inode *inode = osd_sb(osd)->s_root->d_inode; + + id->oii_ino = inode->i_ino; + id->oii_gen = inode->i_generation; } else { - if (!fid_is_norm(fid)) - return -ENOENT; + if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) { + rc = osd_compat_spec_lookup(info, osd, fid, id); + if (rc == 0 || rc != -ERESTART) + goto out; + } fid_cpu_to_be(oi_fid, fid); - key = (struct dt_key *) oi_fid; + key = (struct dt_key *)oi_fid; rc = osd_oi_iam_lookup(info, osd_fid2oi(osd, fid), (struct dt_rec *)id, key); @@ -467,6 +478,8 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd, rc = -ENOENT; } } + +out: return rc; } @@ -524,9 +537,16 @@ int osd_oi_insert(struct osd_thread_info *info, struct osd_device *osd, struct osd_inode_id *id; const struct dt_key *key; - if (!fid_is_norm(fid)) + if (fid_is_igif(fid)) return 0; + if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG) + return osd_compat_objid_insert(info, osd, fid, id0, th); + + /* notice we don't return immediately, but continue to get into OI */ + if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) + osd_compat_spec_insert(info, osd, fid, id0, th); + fid_cpu_to_be(oi_fid, fid); key = (struct dt_key *)oi_fid; @@ -574,6 +594,11 @@ int osd_oi_delete(struct osd_thread_info *info, if (!fid_is_norm(fid)) return 0; + LASSERT(fid_seq(fid) != FID_SEQ_LOCAL_FILE); + + if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG) + return osd_compat_objid_delete(info, osd, fid, th); + fid_cpu_to_be(oi_fid, fid); key = (struct dt_key *)oi_fid;