static journal_t *osd_journal (const struct osd_device *dev);
static const struct lu_device_type_operations osd_device_type_ops;
-static struct lu_device_type osd_device_type;
+static struct lu_device_type osd_device_type;
static const struct lu_object_operations osd_lu_obj_ops;
-static struct obd_ops osd_obd_device_ops;
+static struct obd_ops osd_obd_device_ops;
static const struct lu_device_operations osd_lu_ops;
-static struct lu_context_key osd_key;
+static struct lu_context_key osd_key;
static const struct dt_object_operations osd_obj_ops;
static const struct dt_body_operations osd_body_ops;
static const struct dt_index_operations osd_index_ops;
struct thandle *th;
int result;
- txn_param_init(prm, OSD_TXN_OI_DELETE_CREDITS +
+ txn_param_init(prm, OSD_TXN_OI_DELETE_CREDITS +
OSD_TXN_INODE_DELETE_CREDITS);
th = osd_trans_start(env, &osd->od_dt_dev, prm);
if (!IS_ERR(th)) {
}
if (likely(result == 0))
- *sfs = osd->od_kstatfs;
+ *sfs = osd->od_kstatfs;
spin_unlock(&osd->od_osfs_lock);
return result;
static void osd_trans_commit_cb(struct journal_callback *jcb, int error)
{
struct osd_thandle *oh = container_of0(jcb, struct osd_thandle, ot_jcb);
- struct thandle *th = &oh->ot_super;
+ struct thandle *th = &oh->ot_super;
struct dt_device *dev = th->th_dev;
struct lu_device *lud = &dev->dd_lu_dev;
/* creadits for inode change during write */
[DTO_WRITE_BASE] = 3,
/* credits for single block write */
- [DTO_WRITE_BLOCK] = 12
+ [DTO_WRITE_BLOCK] = 12
};
static int osd_credit_get(const struct lu_env *env, struct dt_device *d,
LASSERT(obj->oo_owner != env);
down_read_nested(&obj->oo_sem, role);
- LASSERT(obj->oo_owner == NULL);
- oti->oti_r_locks++;
+ LASSERT(obj->oo_owner == NULL);
+ oti->oti_r_locks++;
}
static void osd_object_write_lock(const struct lu_env *env,
LASSERT(obj->oo_owner != env);
down_write_nested(&obj->oo_sem, role);
- LASSERT(obj->oo_owner == NULL);
- obj->oo_owner = env;
- oti->oti_w_locks++;
+ LASSERT(obj->oo_owner == NULL);
+ obj->oo_owner = env;
+ oti->oti_w_locks++;
}
static void osd_object_read_unlock(const struct lu_env *env,
struct dt_object *dt)
{
struct osd_object *obj = osd_dt_obj(dt);
- struct osd_thread_info *oti = osd_oti_get(env);
+ struct osd_thread_info *oti = osd_oti_get(env);
LINVRNT(osd_invariant(obj));
- LASSERT(oti->oti_r_locks > 0);
- oti->oti_r_locks--;
+ LASSERT(oti->oti_r_locks > 0);
+ oti->oti_r_locks--;
up_read(&obj->oo_sem);
}
struct dt_object *dt)
{
struct osd_object *obj = osd_dt_obj(dt);
- struct osd_thread_info *oti = osd_oti_get(env);
+ struct osd_thread_info *oti = osd_oti_get(env);
LINVRNT(osd_invariant(obj));
- LASSERT(obj->oo_owner == env);
- LASSERT(oti->oti_w_locks > 0);
- oti->oti_w_locks--;
- obj->oo_owner = NULL;
+ LASSERT(obj->oo_owner == env);
+ LASSERT(oti->oti_w_locks > 0);
+ oti->oti_w_locks--;
+ obj->oo_owner = NULL;
up_write(&obj->oo_sem);
}
* Concurrency: @dt is write locked.
*/
static int osd_object_create(const struct lu_env *env, struct dt_object *dt,
- struct lu_attr *attr,
+ struct lu_attr *attr,
struct dt_allocation_hint *hint,
struct thandle *th)
{
const char *name, struct lu_device *next)
{
int rc;
+ struct lu_context *ctx;
+
/* context for commit hooks */
- rc = lu_context_init(&osd_dev(d)->od_env_for_commit.le_ctx,
- LCT_MD_THREAD);
- if (rc == 0)
+ ctx = &osd_dev(d)->od_env_for_commit.le_ctx;
+ rc = lu_context_init(ctx, LCT_MD_THREAD|LCT_REMEMBER|LCT_NOREF);
+ if (rc == 0) {
rc = osd_procfs_init(osd_dev(d), name);
+ ctx->lc_cookie = 0x3;
+ }
return rc;
}