struct uninc ui;
ui.pending_cnt = 0;
- ibuf = map_iblock(ib);
+ /* Cannot use kmap_atomic as handle might sleep when
+ * looking up segusage blocks
+ */
+ if (test_bit(B_InoIdx, &ib->b.flags)) {
+ ibuf = kmap(LAFSI(ib->b.inode)->dblock->page);
+ ibuf += dblock_offset(LAFSI(ib->b.inode)->dblock);
+ } else
+ ibuf = map_iblock(ib);
if (test_bit(B_InoIdx, &ib->b.flags))
offset = LAFSI(ib->b.inode)->metadata_size;
else
printk("X: %s\n", strblk(&ib->b));
BUG(); // FIXME should be IO error ??
}
- unmap_iblock(ib, ibuf);
+ if (test_bit(B_InoIdx, &ib->b.flags))
+ kunmap(LAFSI(ib->b.inode)->dblock->page);
+
}
static void share_list(struct block **ibp, struct block **newp, u32 next)