struct inode *inode;
struct osd_scrub *scrub;
struct scrub_file *sf;
- int result;
+ int result;
int verify = 0;
ENTRY;
}
fid_zero(&oic->oic_fid);
- /* Search order: 3. OI files. */
- result = osd_oi_lookup(info, dev, fid, id);
- if (result != 0 && result != -ENOENT)
- GOTO(out, result);
- /* If fid wasn't found in oi, inode-less object is created,
- * for which lu_object_exists() returns false. This is used
- * in a (frequent) case when objects are created as locking
- * anchors or place holders for objects yet to be created. */
- if (conf != NULL && conf->loc_flags & LOC_F_NEW) {
- if (unlikely(result == 0))
- GOTO(out, result = -EEXIST);
- else
- GOTO(out, result = 0);
- }
+ /*
+ * Objects are created as locking anchors or place holders for objects
+ * yet to be created. No need to osd_oi_lookup() at here because FID
+ * shouldn't never be re-used, if it's really a duplicate FID from
+ * unexpected reason, we should be able to detect it later by calling
+ * do_create->osd_oi_insert()
+ */
+ if (conf != NULL && (conf->loc_flags & LOC_F_NEW) != 0)
+ GOTO(out, result = 0);
+ /* Search order: 3. OI files. */
+ result = osd_oi_lookup(info, dev, fid, id);
if (result == -ENOENT) {
if (!fid_is_norm(fid) ||
!ldiskfs_test_bit(osd_oi_fid2idx(dev,fid),
goto trigger;
}
+ if (result != 0)
+ GOTO(out, result);
+
iget:
if (verify == 0)
inode = osd_iget(info, dev, id);