Whamcloud - gitweb
LU-3190 mdd: not return linkEA for dead obj
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_oi.c
index 118359a..9194672 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2012, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -467,7 +467,8 @@ int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
        int rc;
        ENTRY;
 
-       if (unlikely(fid_is_local_file(fid) || fid_is_igif(fid)))
+       if (unlikely(fid_is_local_file(fid) || fid_is_igif(fid) ||
+                    fid_is_llog(fid)))
                RETURN(0);
 
        if (fid_is_idif(fid) || fid_is_last_id(fid))
@@ -476,14 +477,14 @@ int fid_is_on_ost(struct osd_thread_info *info, struct osd_device *osd,
        rc = osd_fld_lookup(info->oti_env, osd, fid, range);
        if (rc != 0) {
                CERROR("%s: Can not lookup fld for "DFID"\n",
-                      osd2lu_dev(osd)->ld_obd->obd_name, PFID(fid));
+                      osd_name(osd), PFID(fid));
                RETURN(rc);
        }
 
        CDEBUG(D_INFO, "fid "DFID" range "DRANGE"\n", PFID(fid),
               PRANGE(range));
 
-       if (range->lsr_flags == LU_SEQ_RANGE_OST)
+       if (fld_range_is_ost(range))
                RETURN(1);
 
        RETURN(0);
@@ -526,6 +527,11 @@ int osd_oi_lookup(struct osd_thread_info *info, struct osd_device *osd,
        if (unlikely(fid_is_acct(fid)))
                return osd_acct_obj_lookup(info, osd, fid, id);
 
+       if (!osd->od_igif_inoi && fid_is_igif(fid)) {
+               osd_id_gen(id, lu_igif_ino(fid), lu_igif_gen(fid));
+               return 0;
+       }
+
        return __osd_oi_lookup(info, osd, fid, id);
 }
 
@@ -673,6 +679,10 @@ int osd_oi_delete(struct osd_thread_info *info,
 {
        struct lu_fid *oi_fid = &info->oti_fid2;
 
+       /* clear idmap cache */
+       if (lu_fid_eq(fid, &info->oti_cache.oic_fid))
+               fid_zero(&info->oti_cache.oic_fid);
+
        if (fid_is_last_id(fid))
                return 0;