}
static inline int dt_bufs_get(const struct lu_env *env, struct dt_object *d,
- struct niobuf_remote *rnb,
- struct niobuf_local *lnb, int rw,
- struct lustre_capa *capa)
-{
- LASSERT(d);
- LASSERT(d->do_body_ops);
- LASSERT(d->do_body_ops->dbo_bufs_get);
- return d->do_body_ops->dbo_bufs_get(env, d, rnb->offset,
- rnb->len, lnb, rw, capa);
+ struct niobuf_remote *rnb,
+ struct niobuf_local *lnb, int rw,
+ struct lustre_capa *capa)
+{
+ LASSERT(d);
+ LASSERT(d->do_body_ops);
+ LASSERT(d->do_body_ops->dbo_bufs_get);
+ return d->do_body_ops->dbo_bufs_get(env, d, rnb->rnb_offset,
+ rnb->rnb_len, lnb, rw, capa);
}
static inline int dt_bufs_put(const struct lu_env *env, struct dt_object *d,
/* multiple of 8 bytes => can array */
struct niobuf_remote {
- __u64 offset;
- __u32 len;
- __u32 flags;
+ __u64 rnb_offset;
+ __u32 rnb_len;
+ __u32 rnb_flags;
};
-extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr);
+void lustre_swab_niobuf_remote(struct niobuf_remote *nbr);
/* lock value block communicated between the filter and llite */
(oa->o_valid & OBD_MD_FLFLAGS) != 0 &&
(oa->o_flags & OBD_FL_DEBUG_CHECK) != 0);
struct niobuf_local *res = lb;
- obd_off offset = nb->offset;
- int len = nb->len;
+ obd_off offset = nb->rnb_offset;
+ int len = nb->rnb_len;
while (len > 0) {
int plen = PAGE_CACHE_SIZE - (offset & (PAGE_CACHE_SIZE-1));
struct niobuf_local *lb, int verify)
{
struct niobuf_local *res = lb;
- obd_off start = rb->offset >> PAGE_CACHE_SHIFT;
- obd_off end = (rb->offset + rb->len + PAGE_CACHE_SIZE - 1) >>
+ obd_off start = rb->rnb_offset >> PAGE_CACHE_SHIFT;
+ obd_off end = (rb->rnb_offset + rb->rnb_len + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT;
int count = (int)(end - start);
int rc = 0;
if (rc)
GOTO(preprw_cleanup, rc);
- tot_bytes += nb->len;
+ tot_bytes += nb->rnb_len;
}
}
npages = tot_pages;
for (i = 0; i < npages; i++, off += PAGE_CACHE_SIZE) {
- rnb[i].offset = off;
- rnb[i].len = PAGE_CACHE_SIZE;
- rnb[i].flags = brw_flags;
+ rnb[i].rnb_offset = off;
+ rnb[i].rnb_len = PAGE_CACHE_SIZE;
+ rnb[i].rnb_flags = brw_flags;
}
ioo.ioo_bufcnt = npages;
if (rw == OBD_BRW_WRITE)
echo_client_page_debug_setup(lsm, page, rw,
ostid_id(&oa->o_oi),
- rnb[i].offset,
- rnb[i].len);
+ rnb[i].rnb_offset,
+ rnb[i].rnb_len);
else
echo_client_page_debug_check(lsm, page,
ostid_id(&oa->o_oi),
- rnb[i].offset,
- rnb[i].len);
+ rnb[i].rnb_offset,
+ rnb[i].rnb_len);
}
ret = obd_commitrw(env, rw, exp, oa, 1, &ioo,
rnb = req_capsule_client_get(&req->rq_pill, &RMF_NIOBUF_REMOTE);
LASSERT(rnb != NULL);
- ext.start = rnb->offset;
+ ext.start = rnb->rnb_offset;
rnb += ioo->ioo_bufcnt - 1;
- ext.end = rnb->offset + rnb->len - 1;
+ ext.end = rnb->rnb_offset + rnb->rnb_len - 1;
LASSERT(lock->l_resource != NULL);
if (!ostid_res_name_eq(&ioo->ioo_oid, &lock->l_resource->lr_name))
rnb = req_capsule_client_get(&req->rq_pill, &RMF_NIOBUF_REMOTE);
LASSERT(rnb != NULL);
- LASSERT(!(rnb->flags & OBD_BRW_SRVLOCK));
+ LASSERT(!(rnb->rnb_flags & OBD_BRW_SRVLOCK));
- start = rnb->offset;
+ start = rnb->rnb_offset;
rnb += ioo->ioo_bufcnt - 1;
- end = rnb->offset + rnb->len - 1;
+ end = rnb->rnb_offset + rnb->rnb_len - 1;
DEBUG_REQ(D_RPCTRACE, req, "%s %s: refresh rw locks: "DFID
" ("LPU64"->"LPU64")\n",
LASSERT(rnb != NULL); /* must exist after request preprocessing */
/* no high priority if server lock is needed */
- if (rnb->flags & OBD_BRW_SRVLOCK)
+ if (rnb->rnb_flags & OBD_BRW_SRVLOCK)
return;
}
tgt_ses_req(tsi)->rq_ops = &ofd_hpreq_rw;
ff->ff_parent.f_ver = cpu_to_le32(oa->o_stripe_idx);
}
-/* niobuf_remote has no rnb_ prefix in master */
-#define rnb_offset offset
-#define rnb_flags flags
-#define rnb_len len
-
#endif /* _OFD_INTERNAL_H */
if (i > 0 && can_merge_pages(pg_prev, pg)) {
niobuf--;
- niobuf->len += pg->count;
- } else {
- niobuf->offset = pg->off;
- niobuf->len = pg->count;
- niobuf->flags = pg->flag;
+ niobuf->rnb_len += pg->count;
+ } else {
+ niobuf->rnb_offset = pg->off;
+ niobuf->rnb_len = pg->count;
+ niobuf->rnb_flags = pg->flag;
}
pg_prev = pg;
}
lnb->lnb_file_offset = offset;
lnb->lnb_page_offset = poff;
lnb->lnb_len = plen;
- /* lnb->lnb_flags = rnb->flags; */
+ /* lnb->lnb_flags = rnb->rnb_flags; */
lnb->lnb_flags = 0;
lnb->lnb_page = NULL;
lnb->lnb_rc = 0;
struct nrs_orr_req_range *range)
{
/* Should we do this at page boundaries ? */
- range->or_start = nb[0].offset & CFS_PAGE_MASK;
- range->or_end = (nb[niocount - 1].offset +
- nb[niocount - 1].len - 1) | ~CFS_PAGE_MASK;
+ range->or_start = nb[0].rnb_offset & CFS_PAGE_MASK;
+ range->or_end = (nb[niocount - 1].rnb_offset +
+ nb[niocount - 1].rnb_len - 1) | ~CFS_PAGE_MASK;
}
/**
}
EXPORT_SYMBOL(lustre_swab_obd_ioobj);
-void lustre_swab_niobuf_remote (struct niobuf_remote *nbr)
+void lustre_swab_niobuf_remote(struct niobuf_remote *nbr)
{
- __swab64s (&nbr->offset);
- __swab32s (&nbr->len);
- __swab32s (&nbr->flags);
+ __swab64s(&nbr->rnb_offset);
+ __swab32s(&nbr->rnb_len);
+ __swab32s(&nbr->rnb_flags);
}
EXPORT_SYMBOL(lustre_swab_niobuf_remote);
void dump_rniobuf(struct niobuf_remote *nb)
{
- CDEBUG(D_RPCTRACE, "niobuf_remote: offset="LPU64", len=%d, flags=%x\n",
- nb->offset, nb->len, nb->flags);
+ CDEBUG(D_RPCTRACE, "niobuf_remote: offset="LPU64", len=%d, flags=%x\n",
+ nb->rnb_offset, nb->rnb_len, nb->rnb_flags);
}
EXPORT_SYMBOL(dump_rniobuf);
/* Checks for struct niobuf_remote */
LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n",
(long long)(int)sizeof(struct niobuf_remote));
- LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, offset));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
- LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, len));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->len));
- LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, flags));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_offset) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_offset));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_offset) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_offset));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_len) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_len));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_len) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_len));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_flags) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_flags));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_flags));
LASSERTF(OBD_BRW_READ == 0x01, "found 0x%.8x\n",
OBD_BRW_READ);
LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n",
LASSERT(mode == LCK_PR || mode == LCK_PW);
LASSERT(!lustre_handle_is_used(lh));
- if (nrbufs == 0 || !(nb[0].flags & OBD_BRW_SRVLOCK))
+ if (nrbufs == 0 || !(nb[0].rnb_flags & OBD_BRW_SRVLOCK))
RETURN(0);
for (i = 1; i < nrbufs; i++)
- if (!(nb[i].flags & OBD_BRW_SRVLOCK))
+ if (!(nb[i].rnb_flags & OBD_BRW_SRVLOCK))
RETURN(-EFAULT);
- RETURN(tgt_extent_lock(ns, res_id, nb[0].offset,
- nb[nrbufs - 1].offset + nb[nrbufs - 1].len - 1,
+ RETURN(tgt_extent_lock(ns, res_id, nb[0].rnb_offset,
+ nb[nrbufs - 1].rnb_offset +
+ nb[nrbufs - 1].rnb_len - 1,
lh, mode, &flags));
}
EXPORT_SYMBOL(tgt_brw_lock);
ENTRY;
LASSERT(mode == LCK_PR || mode == LCK_PW);
- LASSERT((obj->ioo_bufcnt > 0 && (niob[0].flags & OBD_BRW_SRVLOCK)) ==
+ LASSERT((obj->ioo_bufcnt > 0 &&
+ (niob[0].rnb_flags & OBD_BRW_SRVLOCK)) ==
lustre_handle_is_used(lh));
+
if (lustre_handle_is_used(lh))
tgt_extent_unlock(lh, mode);
EXIT;
sizeof(*remote_nb))
RETURN(err_serious(-EPROTO));
- if ((remote_nb[0].flags & OBD_BRW_MEMALLOC) &&
+ if ((remote_nb[0].rnb_flags & OBD_BRW_MEMALLOC) &&
(exp->exp_connection->c_peer.nid == exp->exp_connection->c_self))
memory_pressure_set();
/* set per-requested niobuf return codes */
for (i = j = 0; i < niocount; i++) {
- int len = remote_nb[i].len;
+ int len = remote_nb[i].rnb_len;
nob += len;
rcs[i] = 0;
{
BLANK_LINE();
CHECK_STRUCT(niobuf_remote);
- CHECK_MEMBER(niobuf_remote, offset);
- CHECK_MEMBER(niobuf_remote, len);
- CHECK_MEMBER(niobuf_remote, flags);
+ CHECK_MEMBER(niobuf_remote, rnb_offset);
+ CHECK_MEMBER(niobuf_remote, rnb_len);
+ CHECK_MEMBER(niobuf_remote, rnb_flags);
CHECK_DEFINE_X(OBD_BRW_READ);
CHECK_DEFINE_X(OBD_BRW_WRITE);
/* Checks for struct niobuf_remote */
LASSERTF((int)sizeof(struct niobuf_remote) == 16, "found %lld\n",
(long long)(int)sizeof(struct niobuf_remote));
- LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, offset));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
- LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, len));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->len));
- LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, "found %lld\n",
- (long long)(int)offsetof(struct niobuf_remote, flags));
- LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_offset) == 0, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_offset));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_offset) == 8, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_offset));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_len) == 8, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_len));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_len) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_len));
+ LASSERTF((int)offsetof(struct niobuf_remote, rnb_flags) == 12, "found %lld\n",
+ (long long)(int)offsetof(struct niobuf_remote, rnb_flags));
+ LASSERTF((int)sizeof(((struct niobuf_remote *)0)->rnb_flags) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct niobuf_remote *)0)->rnb_flags));
LASSERTF(OBD_BRW_READ == 0x01, "found 0x%.8x\n",
OBD_BRW_READ);
LASSERTF(OBD_BRW_WRITE == 0x02, "found 0x%.8x\n",