+ struct dentry *child;
+ int rc;
+
+ child = ll_lookup_one_len(name, parent, namelen);
+ if (IS_ERR(child)) {
+ rc = PTR_ERR(child);
+ } else {
+ rc = ll_vfs_unlink(parent->d_inode, child);
+ dput(child);
+ }
+
+ return rc == -ENOENT ? 0 : rc;
+}
+
+static int osd_remove_ois(struct osd_thread_info *info, struct osd_device *osd)
+{
+ char name[16];
+ int namelen;
+ int rc;
+ int i;
+
+ if (osd->od_dt_dev.dd_rdonly)
+ RETURN(-EROFS);
+
+ for (i = 0; i < OSD_OI_FID_NR_MAX; i++) {
+ namelen = snprintf(name, sizeof(name), "%s.%d",
+ OSD_OI_NAME_BASE, i);
+ rc = osd_remove_oi_one(osd_sb(osd)->s_root, name, namelen);
+ if (rc != 0) {
+ CERROR("%s: fail to remove the stale OI file %s: "
+ "rc = %d\n", osd_dev2name(osd), name, rc);
+ return rc;
+ }
+ }
+
+ namelen = snprintf(name, sizeof(name), "%s", OSD_OI_NAME_BASE);
+ rc = osd_remove_oi_one(osd_sb(osd)->s_root, name, namelen);
+ if (rc != 0)
+ CERROR("%s: fail to remove the stale OI file %s: rc = %d\n",
+ osd_dev2name(osd), name, rc);
+
+ return rc;
+}
+
+int osd_oi_init(struct osd_thread_info *info, struct osd_device *osd,
+ bool restored)
+{
+ struct lustre_scrub *scrub = &osd->od_scrub.os_scrub;