Lines Matching defs:frag
500 struct jffs2_node_frag *frag;
534 for (frag = frag_first(&f->fragtree); frag; frag = frag_next(frag)) {
535 if (frag->node && frag->node->raw == raw) {
536 fn = frag->node;
537 end = frag->ofs + frag->size;
539 start = frag->ofs;
540 if (nrfrags == frag->node->frags)
549 frag->node->raw = f->inocache->nodes;
1018 struct jffs2_node_frag *frag;
1056 /* FIXME: We could possibly deal with this by writing new holes for each frag */
1083 frag = frag_last(&f->fragtree);
1084 if (frag)
1087 ilen = frag->ofs + frag->size;
1126 * replacing had more than one frag, so we kept the same version
1131 pr_warn("%s(): Replacing fn with %d frag(s) but new ver %d != highest_version %d of ino #%d\n",
1139 for (frag = jffs2_lookup_node_frag(&f->fragtree, fn->ofs);
1140 frag; frag = frag_next(frag)) {
1141 if (frag->ofs > fn->size + fn->ofs)
1143 if (frag->node == fn) {
1144 frag->node = new_fn;
1193 struct jffs2_node_frag *frag;
1199 frag = jffs2_lookup_node_frag(&f->fragtree, start);
1201 /* BUG_ON(!frag) but that'll happen anyway... */
1203 BUG_ON(frag->ofs != start);
1206 while((frag = frag_prev(frag)) && frag->ofs >= min) {
1208 /* If the previous frag doesn't even reach the beginning, there's
1210 if (frag->ofs > min) {
1211 jffs2_dbg(1, "Expanding down to cover partial frag (0x%x-0x%x)\n",
1212 frag->ofs, frag->ofs+frag->size);
1213 start = frag->ofs;
1216 /* OK. This frag holds the first byte of the page. */
1217 if (!frag->node || !frag->node->raw) {
1218 jffs2_dbg(1, "First frag in page is hole (0x%x-0x%x). Not expanding down.\n",
1219 frag->ofs, frag->ofs+frag->size);
1223 /* OK, it's a frag which extends to the beginning of the page. Does it live
1227 struct jffs2_raw_node_ref *raw = frag->node->raw;
1233 jffs2_dbg(1, "Expanding down to cover frag (0x%x-0x%x) in gcblock at %08x\n",
1234 frag->ofs,
1235 frag->ofs + frag->size,
1237 start = frag->ofs;
1241 jffs2_dbg(1, "Not expanding down to cover frag (0x%x-0x%x) in clean block %08x\n",
1242 frag->ofs,
1243 frag->ofs + frag->size,
1248 jffs2_dbg(1, "Expanding down to cover frag (0x%x-0x%x) in dirty block %08x\n",
1249 frag->ofs,
1250 frag->ofs + frag->size,
1252 start = frag->ofs;
1259 /* Find last frag which is actually part of the node we're to GC. */
1260 frag = jffs2_lookup_node_frag(&f->fragtree, end-1);
1262 while((frag = frag_next(frag)) && frag->ofs+frag->size <= max) {
1264 /* If the previous frag doesn't even reach the beginning, there's lots
1266 if (frag->ofs+frag->size < max) {
1267 jffs2_dbg(1, "Expanding up to cover partial frag (0x%x-0x%x)\n",
1268 frag->ofs, frag->ofs+frag->size);
1269 end = frag->ofs + frag->size;
1273 if (!frag->node || !frag->node->raw) {
1274 jffs2_dbg(1, "Last frag in page is hole (0x%x-0x%x). Not expanding up.\n",
1275 frag->ofs, frag->ofs+frag->size);
1279 /* OK, it's a frag which extends to the beginning of the page. Does it live
1283 struct jffs2_raw_node_ref *raw = frag->node->raw;
1289 jffs2_dbg(1, "Expanding up to cover frag (0x%x-0x%x) in gcblock at %08x\n",
1290 frag->ofs,
1291 frag->ofs + frag->size,
1293 end = frag->ofs + frag->size;
1297 jffs2_dbg(1, "Not expanding up to cover frag (0x%x-0x%x) in clean block %08x\n",
1298 frag->ofs,
1299 frag->ofs + frag->size,
1304 jffs2_dbg(1, "Expanding up to cover frag (0x%x-0x%x) in dirty block %08x\n",
1305 frag->ofs,
1306 frag->ofs + frag->size,
1308 end = frag->ofs + frag->size;