# Set this true to check file contents
verify=${verify:-0}
+# test targets
+targets=${targets:-""}
+# test case
+case=${case:-"disk"}
+
# total size (MBytes) per obd instance
# large enough to avoid cache effects
# and to make test startup/shutdown overhead insignificant
esac
}
+# for "echo_client + obdfilter" case, "prep + commit" mode should be used
+# for "echo_client + osc" case, "BRW" mode should be used
+testcase2mode() {
+ case $case in
+ disk) echo "p$1";;
+ *) echo "g";;
+ esac
+}
+
print_summary () {
if [ "$1" = "-n" ]; then
minusn=$1; shift
#####################################################################
# One can change variable values in this section as per requirements
-targets=${targets:-""}
-case=${case:-"disk"}
if [ -n "$targets" ]; then
declare -a ost_names
declare -a client_names
echo >> ${cmdsf}_${host} \
"$lctl > $tmpfi 2>&1 \\
--threads $thr -$snap $devno \\
- test_brw $count `testname2type $test` q $pages ${thr_per_obj}t${first_obj} &"
+ test_brw $count `testname2type $test` q $pages \\
+ ${thr_per_obj}t${first_obj} `testcase2mode $pages` &"
done
pidcount=0
for host in ${unique_hosts[@]}; do
#include <cl_object.h>
#include <lustre_fid.h>
#include <lustre_acl.h>
+#include <lustre_net.h>
#include "echo_internal.h"
obd_size count, int async,
struct obd_trans_info *oti)
{
- struct echo_client_obd *ec = ed->ed_ec;
struct lov_stripe_md *lsm = eco->eo_lsm;
obd_count npages;
struct brw_page *pga;
oa->o_id, off, pgp->count);
}
- if (ed->ed_next == NULL) {
- struct obd_info oinfo = { { { 0 } } };
- oinfo.oi_oa = oa;
- oinfo.oi_md = lsm;
- rc = obd_brw(rw, ec->ec_exp, &oinfo, npages, pga, oti);
- } else
- rc = cl_echo_object_brw(eco, rw, offset, pages, npages, async);
+ /* brw mode can only be used at client */
+ LASSERT(ed->ed_next != NULL);
+ rc = cl_echo_object_brw(eco, rw, offset, pages, npages, async);
out:
if (rc != 0 || rw != OBD_BRW_READ)
static int echo_client_prep_commit(struct obd_export *exp, int rw,
struct obdo *oa, struct echo_object *eco,
obd_off offset, obd_size count,
- obd_size batch, struct obd_trans_info *oti)
+ obd_size batch, struct obd_trans_info *oti,
+ int async)
{
struct lov_stripe_md *lsm = eco->eo_lsm;
struct obd_ioobj ioo;
if (page == NULL && lnb[i].rc == 0)
continue;
+ if (async)
+ lnb[i].flags |= OBD_BRW_ASYNC;
+
if (oa->o_id == ECHO_PERSISTENT_OBJID ||
(oa->o_valid & OBD_MD_FLFLAGS) == 0 ||
(oa->o_flags & OBD_FL_DEBUG_CHECK) == 0)
struct echo_object *eco;
int rc;
int async = 1;
+ long test_mode;
ENTRY;
LASSERT(oa->o_valid & OBD_MD_FLGROUP);
oa->o_valid &= ~OBD_MD_FLHANDLE;
- switch((long)data->ioc_pbuf1) {
- case 1:
+ /* obdfilter doesn't support obd_brw now, simulate via prep + commit */
+ test_mode = (long)data->ioc_pbuf1;
+ if (test_mode == 1)
async = 0;
+
+ if (ed->ed_next == NULL && test_mode != 3) {
+ test_mode = 3;
+ data->ioc_plen1 = data->ioc_count;
+ }
+
+ /* Truncate batch size to maximum */
+ if (data->ioc_plen1 > PTLRPC_MAX_BRW_SIZE)
+ data->ioc_plen1 = PTLRPC_MAX_BRW_SIZE;
+
+ switch (test_mode) {
+ case 1:
/* fall through */
case 2:
rc = echo_client_kbrw(ed, rw, oa,
rc = echo_client_prep_commit(ec->ec_exp, rw, oa,
eco, data->ioc_offset,
data->ioc_count, data->ioc_plen1,
- &dummy_oti);
+ &dummy_oti, async);
break;
default:
rc = -EINVAL;
.o_create = filter_create,
.o_setattr = filter_setattr,
.o_destroy = filter_destroy,
- .o_brw = filter_brw,
.o_punch = filter_truncate,
.o_sync = filter_sync,
.o_preprw = filter_preprw,
int filter_commitrw(int cmd, struct obd_export *, struct obdo *, int objcount,
struct obd_ioobj *, struct niobuf_remote *, int,
struct niobuf_local *, struct obd_trans_info *, int rc);
-int filter_brw(int cmd, struct obd_export *, struct obd_info *oinfo,
- obd_count oa_bufs, struct brw_page *pga, struct obd_trans_info *);
void filter_release_cache(struct obd_device *, struct obd_ioobj *,
struct niobuf_remote *, struct inode *);
return -EPROTO;
}
-int filter_brw(int cmd, struct obd_export *exp, struct obd_info *oinfo,
- obd_count oa_bufs, struct brw_page *pga,
- struct obd_trans_info *oti)
-{
- struct obd_ioobj ioo;
- struct niobuf_local *lnb;
- struct niobuf_remote *rnb;
- obd_count i;
- int ret = 0, npages;
- ENTRY;
-
- OBD_ALLOC(lnb, oa_bufs * sizeof(struct niobuf_local));
- OBD_ALLOC(rnb, oa_bufs * sizeof(struct niobuf_remote));
-
- if (lnb == NULL || rnb == NULL)
- GOTO(out, ret = -ENOMEM);
-
- for (i = 0; i < oa_bufs; i++) {
- lnb[i].page = pga[i].pg;
- rnb[i].offset = pga[i].off;
- rnb[i].len = pga[i].count;
- lnb[i].flags = rnb[i].flags = pga[i].flag;
- }
-
- obdo_to_ioobj(oinfo->oi_oa, &ioo);
- ioo.ioo_bufcnt = oa_bufs;
-
- npages = oa_bufs;
- ret = filter_preprw(cmd, exp, oinfo->oi_oa, 1, &ioo,
- rnb, &npages, lnb, oti, oinfo_capa(oinfo));
- if (ret != 0)
- GOTO(out, ret);
- LASSERTF(oa_bufs == npages, "%u != %u\n", oa_bufs, npages);
-
- ret = filter_commitrw(cmd, exp, oinfo->oi_oa, 1, &ioo, rnb,
- npages, lnb, oti, ret);
-
-out:
- if (lnb)
- OBD_FREE(lnb, oa_bufs * sizeof(struct niobuf_local));
- if (rnb)
- OBD_FREE(rnb, oa_bufs * sizeof(struct niobuf_remote));
- RETURN(ret);
-}
}
run_test 1b "Object Storage Targets survey, async journal"
+test_1c () {
+ nobjlo=1 nobjhi=1 thrlo=128 thrhi=128 rszlo=1024 rszhi=1024 size=8192\
+ obdflter_survey_run disk
+}
+run_test 1c "Object Storage Targets survey, big batch"
+
test_2a () {
obdflter_survey_run netdisk
}