Lines Matching refs:offs
60 static int rand_len(int offs) in rand_len() argument
62 return get_random_u32_below(bufsize - offs); in rand_len()
68 int offs = rand_offs(); in do_read() local
69 int len = rand_len(offs); in do_read()
73 if (offs >= mtd->erasesize) in do_read()
74 offs -= mtd->erasesize; in do_read()
75 if (offs + len > mtd->erasesize) in do_read()
76 len = mtd->erasesize - offs; in do_read()
78 addr = (loff_t)eb * mtd->erasesize + offs; in do_read()
84 int eb = rand_eb(), offs, err, len; in do_write() local
87 offs = offsets[eb]; in do_write()
88 if (offs >= mtd->erasesize) { in do_write()
92 offs = offsets[eb] = 0; in do_write()
94 len = rand_len(offs); in do_write()
96 if (offs + len > mtd->erasesize) { in do_write()
98 len = mtd->erasesize - offs; in do_write()
106 addr = (loff_t)eb * mtd->erasesize + offs; in do_write()
110 offs += len; in do_write()
111 while (offs > mtd->erasesize) { in do_write()
113 offs -= mtd->erasesize; in do_write()
115 offsets[eb] = offs; in do_write()