OSD_TXN_INODE_DELETE_CREDITS;
th = osd_trans_start(env, &osd->od_dt_dev, prm);
if (!IS_ERR(th)) {
- osd_oi_write_lock(&osd->od_oi);
result = osd_oi_delete(oti, &osd->od_oi, fid, th);
- osd_oi_write_unlock(&osd->od_oi);
osd_trans_stop(env, th);
} else
result = PTR_ERR(th);
id->oii_ino = obj->oo_inode->i_ino;
id->oii_gen = obj->oo_inode->i_generation;
- osd_oi_write_lock(&osd->od_oi);
result = osd_oi_insert(info, &osd->od_oi, fid, id, th);
- osd_oi_write_unlock(&osd->od_oi);
}
LASSERT(ergo(result == 0, dt_object_exists(dt)));
if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT))
RETURN(-ENOENT);
- osd_oi_read_lock(oi);
result = osd_oi_lookup(info, oi, fid, id);
if (result == 0) {
inode = osd_iget(info, dev, id);
result = PTR_ERR(inode);
} else if (result == -ENOENT)
result = 0;
- osd_oi_read_unlock(oi);
LASSERT(osd_invariant(obj));
RETURN(result);
}
const struct lu_env *env;
env = info->oti_env;
- /*
- * Initialize ->oi_lock first, because of possible oi re-entrance in
- * dt_store_open().
- */
- init_rwsem(&oi->oi_lock);
obj = dt_store_open(env, dev, oi_dirname, &info->oti_fid);
if (!IS_ERR(obj)) {
}
}
-void osd_oi_read_lock(struct osd_oi *oi)
-{
- down_read(&oi->oi_lock);
-}
-
-void osd_oi_read_unlock(struct osd_oi *oi)
-{
- up_read(&oi->oi_lock);
-}
-
-void osd_oi_write_lock(struct osd_oi *oi)
-{
- down_write(&oi->oi_lock);
-}
-
-void osd_oi_write_unlock(struct osd_oi *oi)
-{
- up_write(&oi->oi_lock);
-}
-
static const struct dt_key *oi_fid_key(struct osd_thread_info *info,
const struct lu_fid *fid)
{
id->oii_ino = cpu_to_be64(ino);
id->oii_gen = cpu_to_be32(gen);
}
-/*
- * Locking: requires at least read lock on oi.
- */
+
int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
const struct lu_fid *fid, struct osd_inode_id *id)
{
return rc;
}
-/*
- * Locking: requires write lock on oi.
- */
int osd_oi_insert(struct osd_thread_info *info, struct osd_oi *oi,
const struct lu_fid *fid, const struct osd_inode_id *id0,
struct thandle *th)
BYPASS_CAPA);
}
-/*
- * Locking: requires write lock on oi.
- */
int osd_oi_delete(struct osd_thread_info *info,
struct osd_oi *oi, const struct lu_fid *fid,
struct thandle *th)
* underlying index object, where fid->id mapping in stored.
*/
struct dt_object *oi_dir;
- /*
- * semaphore, synchronizing access to oi.
- */
- struct rw_semaphore oi_lock;
};
/*
struct osd_oi *oi, struct dt_device *dev);
void osd_oi_fini(struct osd_thread_info *info, struct osd_oi *oi);
-void osd_oi_read_lock(struct osd_oi *oi);
-void osd_oi_read_unlock(struct osd_oi *oi);
-void osd_oi_write_lock(struct osd_oi *oi);
-void osd_oi_write_unlock(struct osd_oi *oi);
-
int osd_oi_lookup(struct osd_thread_info *info, struct osd_oi *oi,
const struct lu_fid *fid, struct osd_inode_id *id);
int osd_oi_insert(struct osd_thread_info *info, struct osd_oi *oi,