[OSD_OT_WRITE] = OSD_OT_WRITE,
[OSD_OT_INSERT] = OSD_OT_DELETE,
[OSD_OT_DELETE] = OSD_OT_INSERT,
- [OSD_OT_UPDATE] = OSD_OT_MAX,
[OSD_OT_QUOTA] = OSD_OT_MAX,
};
oh->ot_credits = 0;
atomic_set(&th->th_refc, 1);
th->th_alloc_size = sizeof(*oh);
- oti->oti_dev = osd_dt_dev(d);
INIT_LIST_HEAD(&oh->ot_dcb_list);
osd_th_alloced(oh);
struct osd_thandle *oh;
struct osd_thread_info *oti = osd_oti_get(env);
struct osd_iobuf *iobuf = &oti->oti_iobuf;
- struct qsd_instance *qsd = oti->oti_dev->od_quota_slave;
+ struct osd_device *osd = osd_dt_dev(th->th_dev);
+ struct qsd_instance *qsd = osd->od_quota_slave;
struct lquota_trans *qtrans;
ENTRY;
oti->oti_txns--;
rc = dt_txn_hook_stop(env, th);
if (rc != 0)
- CERROR("Failure in transaction hook: %d\n", rc);
+ CERROR("%s: failed in transaction hook: rc = %d\n",
+ osd_name(osd), rc);
/* hook functions might modify th_sync */
hdl->h_sync = th->th_sync;
- oh->ot_handle = NULL;
- OSD_CHECK_SLOW_TH(oh, oti->oti_dev,
- rc = ldiskfs_journal_stop(hdl));
- if (rc != 0)
- CERROR("Failure to stop transaction: %d\n", rc);
- } else {
+ oh->ot_handle = NULL;
+ OSD_CHECK_SLOW_TH(oh, osd, rc = ldiskfs_journal_stop(hdl));
+ if (rc != 0)
+ CERROR("%s: failed to stop transaction: rc = %d\n",
+ osd_name(osd), rc);
+ } else {
thandle_put(&oh->ot_super);
- }
+ }
/* inform the quota slave device that the transaction is stopping */
qsd_op_end(env, qsd, qtrans);
*/
wait_event(iobuf->dr_wait,
atomic_read(&iobuf->dr_numreqs) == 0);
- osd_fini_iobuf(oti->oti_dev, iobuf);
+ osd_fini_iobuf(osd, iobuf);
if (!rc)
rc = iobuf->dr_error;
{
struct osd_thread_info *info = data;
+ if (info->oti_inode != NULL)
+ OBD_FREE_PTR(info->oti_inode);
if (info->oti_hlock != NULL)
ldiskfs_htree_lock_free(info->oti_hlock);
OBD_FREE(info->oti_it_ea_buf, OSD_IT_EA_BUFSIZE);
{
int rc;
+ /* please, try to keep osd_thread_info smaller than a page */
+ CLASSERT(sizeof(struct osd_thread_info) <= PAGE_SIZE);
+
osd_oi_mod_init();
rc = lu_kmem_init(ldiskfs_caches);
OSD_OT_WRITE = 7,
OSD_OT_INSERT = 8,
OSD_OT_DELETE = 9,
- OSD_OT_UPDATE = 10,
- OSD_OT_QUOTA = 11,
- OSD_OT_MAX = 12
+ OSD_OT_QUOTA = 10,
+ OSD_OT_MAX = 11
};
struct osd_thandle {
};
struct osd_thread_info {
- const struct lu_env *oti_env;
- /**
- * used for index operations.
- */
- struct dentry oti_obj_dentry;
- struct dentry oti_child_dentry;
+ const struct lu_env *oti_env;
+ /**
+ * used for index operations.
+ */
+ struct dentry oti_obj_dentry;
+ struct dentry oti_child_dentry;
+
+ /** dentry for Iterator context. */
+ struct dentry oti_it_dentry;
- /** dentry for Iterator context. */
- struct dentry oti_it_dentry;
- struct htree_lock *oti_hlock;
+ union {
+ /* fake struct file for osd_object_sync */
+ struct file oti_file;
+ /* osd_statfs() */
+ struct kstatfs oti_ksfs;
+ };
- struct lu_fid oti_fid;
+ struct htree_lock *oti_hlock;
+
+ struct lu_fid oti_fid;
struct lu_fid oti_fid2;
struct lu_fid oti_fid3;
struct osd_inode_id oti_id;
* XXX temporary: for ->i_op calls.
*/
struct timespec oti_time;
- /*
- * XXX temporary: fake struct file for osd_object_sync
- */
- struct file oti_file;
/*
* XXX temporary: for capa operations.
*/
void *oti_it_ea_buf;
unsigned int oti_it_ea_buf_used:1;
- struct kstatfs oti_ksfs;
-
- /** IAM iterator for index operation. */
- struct iam_iterator oti_idx_it;
+ /* IAM iterator for index operation. */
+ struct iam_iterator oti_idx_it;
/** union to guarantee that ->oti_ipd[] has proper alignment. */
union {
+ char oti_name[48];
char oti_it_ipd[DX_IPD_MAX_SIZE];
long long oti_alignment_lieutenant;
};
struct lustre_mdt_attrs oti_mdt_attrs;
/* old LMA for compatibility */
char oti_mdt_attrs_old[LMA_OLD_SIZE];
+ struct filter_fid_old oti_ff;
+ struct filter_fid oti_ff_new;
};
/** 0-copy IO */
struct osd_iobuf oti_iobuf;
- struct inode oti_inode;
+ /* used to access objects in /O */
+ struct inode *oti_inode;
#define OSD_FID_REC_SZ 32
char oti_ldp[OSD_FID_REC_SZ];
char oti_ldp2[OSD_FID_REC_SZ];
unsigned short oti_declare_ops_rb[OSD_OT_MAX];
unsigned short oti_declare_ops_cred[OSD_OT_MAX];
bool oti_rollback;
-
- char oti_name[48];
- union {
- struct filter_fid_old oti_ff;
- struct filter_fid oti_ff_new;
- };
};
extern int ldiskfs_pdo;
LASSERT(op < OSD_OT_MAX);
} else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(oh->ot_super.th_dev)), op);
libcfs_debug_dumpstack(NULL);
}
} else {
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(oh->ot_super.th_dev)), op);
libcfs_debug_dumpstack(NULL);
return;
}
LASSERTF(rb < OSD_OT_MAX, "rb = %u\n", rb);
else {
CWARN("%s: Invalid rollback index %d\n",
- osd_name(oti->oti_dev), rb);
+ osd_name(osd_dt_dev(th->th_dev)), rb);
libcfs_debug_dumpstack(NULL);
return;
}
else {
CWARN("%s: Overflow in tracking declares for "
"index, rb = %d\n",
- osd_name(oti->oti_dev), rb);
+ osd_name(osd_dt_dev(th->th_dev)), rb);
libcfs_debug_dumpstack(NULL);
return;
}
LASSERT(op < OSD_OT_MAX);
else {
CWARN("%s: Invalid operation index %d\n",
- osd_name(oti->oti_dev), op);
+ osd_name(osd_dt_dev(th->th_dev)), op);
libcfs_debug_dumpstack(NULL);
}