}
static int mdt_commitrw_read(const struct lu_env *env, struct mdt_device *mdt,
- struct mdt_object *mo, int objcount, int niocount,
+ struct mdt_object *mo, int objcount, int npages,
struct niobuf_local *lnb)
{
struct dt_object *dob;
dob = mdt_obj2dt(mo);
- if (niocount)
- dt_bufs_put(env, dob, lnb, niocount);
+ if (npages)
+ dt_bufs_put(env, dob, lnb, npages);
mdt_dom_read_unlock(mo);
RETURN(rc);
static int mdt_commitrw_write(const struct lu_env *env, struct obd_export *exp,
struct mdt_device *mdt, struct mdt_object *mo,
struct lu_attr *la, struct obdo *oa, int objcount,
- int niocount, struct niobuf_local *lnb,
+ int npages, struct niobuf_local *lnb,
unsigned long granted, int old_rc)
{
struct dt_device *dt = mdt->mdt_bottom;
if (!dt_object_exists(dob))
GOTO(out, rc = -ENOENT);
- if (niocount == 0) {
+ if (npages == 0) {
rc = -EPROTO;
DEBUG_REQ(D_WARNING, tgt_ses_req(tgt_ses_info(env)),
"%s: commit with no pages for "DFID": rc = %d\n",
if (IS_ERR(th))
GOTO(out, rc = PTR_ERR(th));
- for (i = 0; i < niocount; i++) {
+ for (i = 0; i < npages; i++) {
if (!(lnb[i].lnb_flags & OBD_BRW_ASYNC)) {
th->th_sync = 1;
break;
if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
GOTO(out_stop, rc = -EINPROGRESS);
- rc = dt_declare_write_commit(env, dob, lnb, niocount, th);
+ rc = dt_declare_write_commit(env, dob, lnb, npages, th);
if (rc)
GOTO(out_stop, rc);
PFID(mdt_object_fid(mo)));
GOTO(unlock, rc = 0);
}
- rc = dt_write_commit(env, dob, lnb, niocount, th, oa->o_size);
+ rc = dt_write_commit(env, dob, lnb, npages, th, oa->o_size);
if (rc) {
restart = th->th_restart_tran;
GOTO(unlock, rc);
}
out:
- dt_bufs_put(env, dob, lnb, niocount);
+ dt_bufs_put(env, dob, lnb, npages);
mdt_dom_read_unlock(mo);
if (granted > 0)
tgt_grant_commit(exp, granted, old_rc);
* \param[in] ofd OFD device
* \param[in] fid object FID
* \param[in] objcount always 1
- * \param[in] niocount number of local buffers
+ * \param[in] npages number of local buffers
* \param[in] lnb local buffers
*
* \retval 0 on successful execution
*/
static int
ofd_commitrw_read(const struct lu_env *env, struct ofd_device *ofd,
- const struct lu_fid *fid, int objcount, int niocount,
+ const struct lu_fid *fid, int objcount, int npages,
struct niobuf_local *lnb)
{
struct ofd_object *fo;
ENTRY;
- LASSERT(niocount > 0);
+ LASSERT(npages > 0);
fo = ofd_info(env)->fti_obj;
LASSERT(fo != NULL);
* behind this RPC could have been evicted allowing concurrent
* OST_DESTROY to remove the object.
*/
- dt_bufs_put(env, ofd_object_child(fo), lnb, niocount);
+ dt_bufs_put(env, ofd_object_child(fo), lnb, npages);
ofd_object_put(env, fo);
* \param[in] la object attributes
* \param[in] ff parent FID of object
* \param[in] objcount always 1
- * \param[in] niocount number of local buffers
+ * \param[in] npages number of local pages/buffers
* \param[in] lnb local buffers
* \param[in] granted grant space consumed for the bulk I/O
* \param[in] old_rc result of processing at this point
ofd_commitrw_write(const struct lu_env *env, struct obd_export *exp,
struct ofd_device *ofd, const struct lu_fid *fid,
struct lu_attr *la, struct obdo *oa, int objcount,
- int niocount, struct niobuf_local *lnb,
+ int npages, struct niobuf_local *lnb,
unsigned long granted, int old_rc)
{
struct ofd_thread_info *info = ofd_info(env);
/* do fake write, to simulate the write case for performance testing */
if (OBD_FAIL_CHECK_QUIET(OBD_FAIL_OST_FAKE_RW)) {
- struct niobuf_local *last = &lnb[niocount - 1];
+ struct niobuf_local *last = &lnb[npages - 1];
__u64 file_size = last->lnb_file_offset + last->lnb_len;
bool compressed = last->lnb_flags & OBD_BRW_COMPRESSED;
__u64 user_size = oa->o_size;
th->th_sync |= ofd->ofd_sync_journal;
if (th->th_sync == 0) {
- for (i = 0; i < niocount; i++) {
+ for (i = 0; i < npages; i++) {
if (!(lnb[i].lnb_flags & OBD_BRW_ASYNC)) {
th->th_sync = 1;
break;
GOTO(out_stop, rc = -EINPROGRESS);
if (likely(!fake_write)) {
- rc = dt_declare_write_commit(env, o, lnb, niocount, th);
+ rc = dt_declare_write_commit(env, o, lnb, npages, th);
if (rc)
GOTO(out_stop, rc);
}
if (likely(!fake_write)) {
OBD_FAIL_TIMEOUT_ORSET(OBD_FAIL_OST_WR_ATTR_DELAY,
OBD_FAIL_ONCE, cfs_fail_val);
- rc = dt_write_commit(env, o, lnb, niocount, th, oa->o_size);
+ rc = dt_write_commit(env, o, lnb, npages, th, oa->o_size);
if (rc) {
restart = th->th_restart_tran;
GOTO(out_unlock, rc);
range_unlock(&fo->ofo_write_tree, range);
info->fti_range_locked = 0;
}
- dt_bufs_put(env, o, lnb, niocount);
+ dt_bufs_put(env, o, lnb, npages);
ofd_object_put(env, fo);
if (granted > 0)
tgt_grant_commit(exp, granted, old_rc);