+/**
+ * Is object in scrub inconsistent/stale list.
+ *
+ * \a scrub has two lists, os_inconsistent_items contains mappings to fix, while
+ * os_stale_items contains mappings failed to fix.
+ */
+static bool fid_in_scrub_list(struct lustre_scrub *scrub,
+ const struct list_head *list,
+ const struct lu_fid *fid)
+{
+ struct osd_inconsistent_item *oii;
+
+ if (list_empty(list))
+ return false;
+
+ spin_lock(&scrub->os_lock);
+ list_for_each_entry(oii, list, oii_list) {
+ if (lu_fid_eq(fid, &oii->oii_cache.oic_fid)) {
+ spin_unlock(&scrub->os_lock);
+ return true;
+ }
+ }
+ spin_unlock(&scrub->os_lock);
+
+ return false;
+}
+