Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
106e231
)
test_brw/echo: verify == (objid != 0), highmem == (objid & 1), test default objid...
author
eeb
<eeb>
Thu, 22 Aug 2002 13:34:20 +0000
(13:34 +0000)
committer
eeb
<eeb>
Thu, 22 Aug 2002 13:34:20 +0000
(13:34 +0000)
lustre/obdclass/class_obd.c
patch
|
blob
|
history
lustre/obdecho/echo.c
patch
|
blob
|
history
diff --git
a/lustre/obdclass/class_obd.c
b/lustre/obdclass/class_obd.c
index
4c67ad4
..
4b2b079
100644
(file)
--- a/
lustre/obdclass/class_obd.c
+++ b/
lustre/obdclass/class_obd.c
@@
-53,8
+53,6
@@
unsigned long obd_fail_loc = 0;
unsigned long obd_timeout = 100;
char obd_recovery_upcall[128] = "/usr/lib/lustre/ha_assist";
unsigned long obd_timeout = 100;
char obd_recovery_upcall[128] = "/usr/lib/lustre/ha_assist";
-int obdclass_highmem = 0;
-
extern struct obd_type *class_nm_to_type(char *nm);
/* opening /dev/obd */
extern struct obd_type *class_nm_to_type(char *nm);
/* opening /dev/obd */
@@
-498,6
+496,8
@@
static int obd_class_ioctl (struct inode * inode, struct file * filp,
struct brw_page *pga, *pgp;
int j;
unsigned long off;
struct brw_page *pga, *pgp;
int j;
unsigned long off;
+ int highmem;
+ int verify;
__u64 id;
if (!cbd)
__u64 id;
if (!cbd)
@@
-517,11
+517,13
@@
static int obd_class_ioctl (struct inode * inode, struct file * filp,
memset(&smd, 0, sizeof(smd));
id = smd.lmd_object_id = data->ioc_obdo1.o_id;
memset(&smd, 0, sizeof(smd));
id = smd.lmd_object_id = data->ioc_obdo1.o_id;
-
+ highmem = (id & 1) != 0;
+ verify = (id != 0);
+
off = data->ioc_offset;
for (j = 0, pgp = pga; j < pages; j++, off += PAGE_SIZE, pgp++){
off = data->ioc_offset;
for (j = 0, pgp = pga; j < pages; j++, off += PAGE_SIZE, pgp++){
- pgp->pg = alloc_pages(
obdclass_
highmem ? GFP_HIGHUSER : GFP_KERNEL, 0);
+ pgp->pg = alloc_pages(highmem ? GFP_HIGHUSER : GFP_KERNEL, 0);
if (!pgp->pg) {
CERROR("no memory for brw pages\n");
GOTO(brw_cleanup, err = -ENOMEM);
if (!pgp->pg) {
CERROR("no memory for brw pages\n");
GOTO(brw_cleanup, err = -ENOMEM);
@@
-530,7
+532,7
@@
static int obd_class_ioctl (struct inode * inode, struct file * filp,
pgp->off = off;
pgp->flag = 0;
pgp->off = off;
pgp->flag = 0;
- if (
rw == OBD_BRW_WRITE
) {
+ if (
verify && (rw == OBD_BRW_WRITE)
) {
page_debug_setup(kmap(pgp->pg), pgp->count,
pgp->off, id);
kunmap(pgp->pg);
page_debug_setup(kmap(pgp->pg), pgp->count,
pgp->off, id);
kunmap(pgp->pg);
@@
-542,15
+544,17
@@
static int obd_class_ioctl (struct inode * inode, struct file * filp,
brw_cleanup:
for (j = 0, pgp = pga; j < pages; j++, pgp++) {
if (pgp->pg != NULL) {
brw_cleanup:
for (j = 0, pgp = pga; j < pages; j++, pgp++) {
if (pgp->pg != NULL) {
- int err2;
- void *addr = kmap(pgp->pg);
-
- err2 = page_debug_check("test_brw", addr,
- PAGE_SIZE, pgp->off,id);
+ if (verify)
+ {
+ void *addr = kmap(pgp->pg);
+ int err2 = page_debug_check("test_brw", addr,
+ PAGE_SIZE, pgp->off,id);
+
+ if (!err)
+ err = err2;
+ }
kunmap(pgp->pg);
__free_pages(pgp->pg, 0);
kunmap(pgp->pg);
__free_pages(pgp->pg, 0);
- if (!err)
- err = err2;
}
}
brw_free:
}
}
brw_free:
diff --git
a/lustre/obdecho/echo.c
b/lustre/obdecho/echo.c
index
a63f67e
..
3d05d60
100644
(file)
--- a/
lustre/obdecho/echo.c
+++ b/
lustre/obdecho/echo.c
@@
-11,8
+11,8
@@
* by Peter Braam <braam@clusterfs.com>
*/
* by Peter Braam <braam@clusterfs.com>
*/
-static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.2
5 2002/08/21 22:17:39
eeb Exp $";
-#define OBDECHO_VERSION "$Revision: 1.2
5
$"
+static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.2
6 2002/08/22 13:34:20
eeb Exp $";
+#define OBDECHO_VERSION "$Revision: 1.2
6
$"
#define EXPORT_SYMTAB
#define EXPORT_SYMTAB
@@
-43,8
+43,6
@@
static long echo_pages = 0;
static atomic_t echo_page_rws;
static atomic_t echo_getattrs;
static atomic_t echo_page_rws;
static atomic_t echo_getattrs;
-int obdecho_highmem = 0;
-
#define ECHO_PROC_STAT "sys/obdecho"
int
#define ECHO_PROC_STAT "sys/obdecho"
int
@@
-152,10
+150,12
@@
int echo_preprw(int cmd, struct lustre_handle *conn, int objcount,
*desc_private = (void *)DESC_PRIV;
for (i = 0; i < objcount; i++, obj++) {
*desc_private = (void *)DESC_PRIV;
for (i = 0; i < objcount; i++, obj++) {
+ int highmem = (obj->ioo_id & 1) != 0;
+ int verify = obj->ioo_id != 0;
int j;
for (j = 0 ; j < obj->ioo_bufcnt ; j++, nb++, r++) {
int j;
for (j = 0 ; j < obj->ioo_bufcnt ; j++, nb++, r++) {
- r->page = alloc_pages(
obdecho_
highmem ? GFP_HIGHUSER : GFP_KERNEL, 0);
+ r->page = alloc_pages(highmem ? GFP_HIGHUSER : GFP_KERNEL, 0);
if (!r->page) {
CERROR("can't get page %d/%d for id "LPU64"\n",
j, obj->ioo_bufcnt, obj->ioo_id);
if (!r->page) {
CERROR("can't get page %d/%d for id "LPU64"\n",
j, obj->ioo_bufcnt, obj->ioo_id);
@@
-169,7
+169,8
@@
int echo_preprw(int cmd, struct lustre_handle *conn, int objcount,
CDEBUG(D_PAGE, "$$$$ get page %p, addr %p@"LPU64"\n",
r->page, r->addr, r->offset);
CDEBUG(D_PAGE, "$$$$ get page %p, addr %p@"LPU64"\n",
r->page, r->addr, r->offset);
- if (cmd & OBD_BRW_READ)
+
+ if (verify && (cmd & OBD_BRW_READ) != 0)
page_debug_setup(r->addr, r->len, r->offset,
obj->ioo_id);
}
page_debug_setup(r->addr, r->len, r->offset,
obj->ioo_id);
}
@@
-215,6
+216,7
@@
int echo_commitrw(int cmd, struct lustre_handle *conn, int objcount,
LASSERT(desc_private == (void *)DESC_PRIV);
for (i = 0; i < objcount; i++, obj++) {
LASSERT(desc_private == (void *)DESC_PRIV);
for (i = 0; i < objcount; i++, obj++) {
+ int verify = obj->ioo_id != 0;
int j;
for (j = 0 ; j < obj->ioo_bufcnt ; j++, r++) {
int j;
for (j = 0 ; j < obj->ioo_bufcnt ; j++, r++) {
@@
-233,7
+235,8
@@
int echo_commitrw(int cmd, struct lustre_handle *conn, int objcount,
CDEBUG(D_PAGE, "$$$$ use page %p, addr %p@"LPU64"\n",
r->page, addr, r->offset);
CDEBUG(D_PAGE, "$$$$ use page %p, addr %p@"LPU64"\n",
r->page, addr, r->offset);
- if (cmd & OBD_BRW_WRITE)
+
+ if (verify && (cmd & OBD_BRW_WRITE))
page_debug_check("echo", addr, r->len,
r->offset, obj->ioo_id);
page_debug_check("echo", addr, r->len,
r->offset, obj->ioo_id);