Lines Matching refs:bl
255 ext_tree_insert(struct pnfs_block_layout *bl, struct pnfs_block_extent *new) in ext_tree_insert() argument
264 root = &bl->bl_ext_rw; in ext_tree_insert()
268 root = &bl->bl_ext_ro; in ext_tree_insert()
275 spin_lock(&bl->bl_ext_lock); in ext_tree_insert()
317 spin_unlock(&bl->bl_ext_lock); in ext_tree_insert()
345 ext_tree_lookup(struct pnfs_block_layout *bl, sector_t isect, in ext_tree_lookup() argument
350 spin_lock(&bl->bl_ext_lock); in ext_tree_lookup()
352 found = __ext_tree_lookup(&bl->bl_ext_ro, isect, ret); in ext_tree_lookup()
354 found = __ext_tree_lookup(&bl->bl_ext_rw, isect, ret); in ext_tree_lookup()
355 spin_unlock(&bl->bl_ext_lock); in ext_tree_lookup()
360 int ext_tree_remove(struct pnfs_block_layout *bl, bool rw, in ext_tree_remove() argument
366 spin_lock(&bl->bl_ext_lock); in ext_tree_remove()
367 err = __ext_tree_remove(&bl->bl_ext_ro, start, end, &tmp); in ext_tree_remove()
369 err2 = __ext_tree_remove(&bl->bl_ext_rw, start, end, &tmp); in ext_tree_remove()
373 spin_unlock(&bl->bl_ext_lock); in ext_tree_remove()
405 ext_tree_mark_written(struct pnfs_block_layout *bl, sector_t start, in ext_tree_mark_written() argument
408 struct rb_root *root = &bl->bl_ext_rw; in ext_tree_mark_written()
414 spin_lock(&bl->bl_ext_lock); in ext_tree_mark_written()
418 err = __ext_tree_remove(&bl->bl_ext_ro, start, end, &tmp); in ext_tree_mark_written()
475 if (bl->bl_lwb < lwb) in ext_tree_mark_written()
476 bl->bl_lwb = lwb; in ext_tree_mark_written()
477 spin_unlock(&bl->bl_ext_lock); in ext_tree_mark_written()
483 static size_t ext_tree_layoutupdate_size(struct pnfs_block_layout *bl, size_t count) in ext_tree_layoutupdate_size() argument
485 if (bl->bl_scsi_layout) in ext_tree_layoutupdate_size()
523 static int ext_tree_encode_commit(struct pnfs_block_layout *bl, __be32 *p, in ext_tree_encode_commit() argument
529 spin_lock(&bl->bl_ext_lock); in ext_tree_encode_commit()
530 for (be = ext_tree_first(&bl->bl_ext_rw); be; be = ext_tree_next(be)) { in ext_tree_encode_commit()
536 if (ext_tree_layoutupdate_size(bl, *count) > buffer_size) { in ext_tree_encode_commit()
542 if (bl->bl_scsi_layout) in ext_tree_encode_commit()
548 *lastbyte = bl->bl_lwb - 1; in ext_tree_encode_commit()
549 bl->bl_lwb = 0; in ext_tree_encode_commit()
550 spin_unlock(&bl->bl_ext_lock); in ext_tree_encode_commit()
558 struct pnfs_block_layout *bl = BLK_LO2EXT(NFS_I(arg->inode)->layout); in ext_tree_prepare_commit() local
572 ret = ext_tree_encode_commit(bl, start_p + 1, buffer_size, &count, &arg->lastbytewritten); in ext_tree_prepare_commit()
576 buffer_size = ext_tree_layoutupdate_size(bl, count); in ext_tree_prepare_commit()
595 arg->layoutupdate_len = ext_tree_layoutupdate_size(bl, count); in ext_tree_prepare_commit()
617 struct pnfs_block_layout *bl = BLK_LO2EXT(NFS_I(arg->inode)->layout); in ext_tree_mark_committed() local
618 struct rb_root *root = &bl->bl_ext_rw; in ext_tree_mark_committed()
625 spin_lock(&bl->bl_ext_lock); in ext_tree_mark_committed()
646 spin_unlock(&bl->bl_ext_lock); in ext_tree_mark_committed()