[Devel] ploop vs. BTRFS conflict resolved
Sergey Bronnikov
sergeyb at openvz.org
Wed Dec 30 00:45:33 PST 2015
Konstantin, please reply.
On 21:25 Mon 28 Dec , gremlin at gremlin.ru wrote:
> Functions extent_map_init(), extent_map_exit() and alloc_extent_map()
> from drivers/block/ploop/io_direct_map.c had conflicting names versus
> fs/btrfs/extent_map.c when kernel is built with CONFIG_BTRFS_FS
>
> Said that, they have to be renamed to ploop_* - see attached patch.
>
>
> --
> Alexey V. Vissarionov aka Gremlin from Kremlin
> GPG: 8832FE9FA791F7968AC96E4E909DAC45EF3B1FA8
> Functions extent_map_init(), extent_map_exit() and alloc_extent_map()
> from drivers/block/ploop/io_direct_map.c had conflicting names versus
> fs/btrfs/extent_map.c when kernel is built with CONFIG_BTRFS_FS
>
> Said that, they are renamed to ploop_*
>
> diff -burp vzkernel.orig/drivers/block/ploop/io_direct.c vzkernel/drivers/block/ploop/io_direct.c
> --- vzkernel.orig/drivers/block/ploop/io_direct.c 2015-12-21 00:26:58.000000000 +0300
> +++ vzkernel/drivers/block/ploop/io_direct.c 2015-12-28 20:21:48.958125326 +0300
> @@ -141,7 +141,7 @@ dio_submit(struct ploop_io *io, struct p
>
> if (em->start <= sec)
> sec = em->end;
> - extent_put(em);
> + ploop_extent_put(em);
>
> while (sec < end) {
> em = extent_lookup_create(io, sec, end - sec);
> @@ -151,7 +151,7 @@ dio_submit(struct ploop_io *io, struct p
> goto write_unint_fail;
>
> sec = em->end;
> - extent_put(em);
> + ploop_extent_put(em);
> }
>
> goto write_unint;
> @@ -187,7 +187,7 @@ dio_submit(struct ploop_io *io, struct p
> }
>
> if (sec >= em->end) {
> - extent_put(em);
> + ploop_extent_put(em);
> em = extent_lookup_create(io, sec, size);
> if (IS_ERR(em))
> goto out_em_err;
> @@ -230,7 +230,7 @@ flush_bio:
> size -= copy >> 9;
> sec += copy >> 9;
> }
> - extent_put(em);
> + ploop_extent_put(em);
>
> bio_num = 0;
> while (bl.head) {
> @@ -272,7 +272,7 @@ write_unint:
> goto out;
>
> write_unint_fail:
> - extent_put(em);
> + ploop_extent_put(em);
> err = -EIO;
> ploop_msg_once(io->plo, "A part of cluster is in uninitialized extent.");
> goto out;
> @@ -566,7 +566,7 @@ dio_submit_pad(struct ploop_io *io, stru
> }
>
> if (sec >= em->end) {
> - extent_put(em);
> + ploop_extent_put(em);
> em = extent_lookup_create(io, sec, end_sec - sec);
> if (IS_ERR(em))
> goto out_em_err;
> @@ -600,7 +600,7 @@ flush_bio:
> BUG_ON(plen == 0);
> sec += plen;
> }
> - extent_put(em);
> + ploop_extent_put(em);
>
> while (bl.head) {
> unsigned long rw;
> @@ -1029,7 +1029,7 @@ dio_sync_io(struct ploop_io * io, int rw
>
> if (!em || sec >= em->end) {
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
> em = extent_lookup_create(io, sec, len>>9);
> if (IS_ERR(em))
> goto out_em_err;
> @@ -1062,7 +1062,7 @@ flush_bio:
> }
>
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
>
> while (bl.head) {
> struct bio * b = bl.head;
> @@ -1150,7 +1150,7 @@ dio_sync_iovec(struct ploop_io * io, int
>
> if (!em || sec >= em->end) {
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
> em = extent_lookup_create(io, sec, len>>9);
> if (IS_ERR(em))
> goto out_em_err;
> @@ -1186,7 +1186,7 @@ flush_bio:
> }
>
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
>
> while (bl.head) {
> struct bio * b = bl.head;
> @@ -1383,7 +1383,7 @@ dio_io_page(struct ploop_io * io, unsign
>
> if (!em || sec >= em->end) {
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
> em = extent_lookup_create(io, sec, len>>9);
> if (IS_ERR(em))
> goto out_em_err;
> @@ -1416,7 +1416,7 @@ flush_bio:
> }
>
> if (em)
> - extent_put(em);
> + ploop_extent_put(em);
>
> bio_num = 0;
> while (bl.head) {
> @@ -1508,7 +1508,7 @@ dio_fastmap(struct ploop_io * io, struct
>
> if (isec + (orig_bio->bi_size>>9) > em->end) {
> io->plo->st.fast_neg_shortem++;
> - extent_put(em);
> + ploop_extent_put(em);
> return 1;
> }
>
> @@ -1518,7 +1518,7 @@ dio_fastmap(struct ploop_io * io, struct
> orig_bio->bi_vcnt * sizeof(struct bio_vec));
>
> bio->bi_sector = dio_isec_to_phys(em, isec);
> - extent_put(em);
> + ploop_extent_put(em);
>
> bio->bi_bdev = io->files.bdev;
> bio->bi_rw = orig_bio->bi_rw;
> @@ -1566,7 +1566,7 @@ dio_disable_merge(struct ploop_io * io,
> if (em) {
> if (isector + len > em->end)
> ret = 1;
> - extent_put(em);
> + ploop_extent_put(em);
> }
> return ret;
> }
> @@ -1898,11 +1898,11 @@ static int __init pio_direct_mod_init(vo
> if (min_extent_map_entries == 0)
> min_extent_map_entries = 64;
>
> - err = extent_map_init();
> + err = ploop_extent_map_init();
> if (!err) {
> err = ploop_register_io(&ploop_io_ops_direct);
> if (err)
> - extent_map_exit();
> + ploop_extent_map_exit();
> }
>
> return err;
> @@ -1911,7 +1911,7 @@ static int __init pio_direct_mod_init(vo
> static void __exit pio_direct_mod_exit(void)
> {
> ploop_unregister_io(&ploop_io_ops_direct);
> - extent_map_exit();
> + ploop_extent_map_exit();
> BUG_ON(atomic_long_read(&ploop_io_images_size));
> }
>
> diff -burp vzkernel.orig/drivers/block/ploop/io_direct_map.c vzkernel/drivers/block/ploop/io_direct_map.c
> --- vzkernel.orig/drivers/block/ploop/io_direct_map.c 2015-12-21 00:26:58.000000000 +0300
> +++ vzkernel/drivers/block/ploop/io_direct_map.c 2015-12-28 20:22:36.418539421 +0300
> @@ -220,7 +220,7 @@ int ploop_dio_upgrade(struct ploop_io *
>
> static struct kmem_cache *extent_map_cache;
>
> -int __init extent_map_init(void)
> +int __init ploop_extent_map_init(void)
> {
> extent_map_cache = kmem_cache_create("ploop_itree",
> sizeof(struct extent_map), 0,
> @@ -234,7 +234,7 @@ int __init extent_map_init(void)
> return 0;
> }
>
> -void extent_map_exit(void)
> +void ploop_extent_map_exit(void)
> {
> if (extent_map_cache)
> kmem_cache_destroy(extent_map_cache);
> @@ -248,7 +248,7 @@ static void extent_map_tree_init(struct
> rwlock_init(&tree->lock);
> }
>
> -struct extent_map *alloc_extent_map(gfp_t mask)
> +struct extent_map *ploop_alloc_extent_map(gfp_t mask)
> {
> struct extent_map *em;
>
> @@ -261,7 +261,7 @@ struct extent_map *alloc_extent_map(gfp_
> return em;
> }
>
> -void extent_put(struct extent_map *em)
> +void ploop_extent_put(struct extent_map *em)
> {
> if (!em)
> return;
> @@ -435,7 +435,7 @@ static int add_extent_mapping(struct ext
> rb_erase(rb, &tree->map);
> list_del_init(&tmp->lru_link);
> tree->map_size--;
> - extent_put(tmp);
> + ploop_extent_put(tmp);
> } else {
> list_add_tail(&em->lru_link, &tree->lru_list);
> tree->map_size++;
> @@ -456,7 +456,7 @@ static int add_extent_mapping(struct ext
> list_del_init(&victim_em->lru_link);
> tree->map_size--;
> rb_erase(&victim_em->rb_node, &tree->map);
> - extent_put(victim_em);
> + ploop_extent_put(victim_em);
> }
> }
> } while (rb);
> @@ -474,7 +474,7 @@ static int add_extent_mapping(struct ext
> rb_erase(&merge->rb_node, &tree->map);
> list_del_init(&merge->lru_link);
> tree->map_size--;
> - extent_put(merge);
> + ploop_extent_put(merge);
> }
> }
> }
> @@ -488,7 +488,7 @@ static int add_extent_mapping(struct ext
> rb_erase(&merge->rb_node, &tree->map);
> list_del_init(&merge->lru_link);
> tree->map_size--;
> - extent_put(merge);
> + ploop_extent_put(merge);
> }
> }
>
> @@ -600,11 +600,11 @@ again:
> } else if (!create) {
> return em;
> }
> - extent_put(em);
> + ploop_extent_put(em);
> }
> BUG_ON(gfp_mask & GFP_ATOMIC);
>
> - em = alloc_extent_map(gfp_mask);
> + em = ploop_alloc_extent_map(gfp_mask);
> if (!em)
> return ERR_PTR(-ENOMEM);
>
> @@ -619,7 +619,7 @@ again:
> */
> ret = tree->_get_extent(inode, start, len, &nstart, &result, create);
> if (ret < 0) {
> - extent_put(em);
> + ploop_extent_put(em);
> return ERR_PTR(ret);
> }
>
> @@ -629,7 +629,7 @@ again:
>
> ret = add_extent_mapping(tree, em);
> if (ret == -EEXIST) {
> - extent_put(em);
> + ploop_extent_put(em);
> goto again;
> }
> return em;
> @@ -661,7 +661,7 @@ again:
> } else {
> return em;
> }
> - extent_put(em);
> + ploop_extent_put(em);
> }
>
> BUG_ON(gfp_mask & GFP_ATOMIC);
> @@ -669,7 +669,7 @@ again:
> if (!inode->i_op->fiemap)
> return ERR_PTR(-EINVAL);
>
> - em = alloc_extent_map(gfp_mask);
> + em = ploop_alloc_extent_map(gfp_mask);
> if (!em)
> return ERR_PTR(-ENOMEM);
>
> @@ -704,7 +704,7 @@ again:
> set_fs(old_fs);
>
> if (ret) {
> - extent_put(em);
> + ploop_extent_put(em);
> return ERR_PTR(ret);
> }
>
> @@ -714,7 +714,7 @@ again:
> " (mapped=%d i_size=%llu off=%llu)",
> fieinfo.fi_extents_mapped,
> i_size_read(inode), start_off);
> - extent_put(em);
> + ploop_extent_put(em);
> return ERR_PTR(-EINVAL);
> }
>
> @@ -728,7 +728,7 @@ again:
>
> ret = add_extent_mapping(tree, em);
> if (ret == -EEXIST) {
> - extent_put(em);
> + ploop_extent_put(em);
> goto again;
> }
> }
> @@ -782,7 +782,7 @@ struct extent_map *map_extent_get_block(
> break;
>
> last = em->end;
> - extent_put(em);
> + ploop_extent_put(em);
> em = __map_extent(io, mapping, last, len, create,
> gfp_mask, get_block);
> if (IS_ERR(em) || !em)
> @@ -795,7 +795,7 @@ struct extent_map *map_extent_get_block(
> if (!em || IS_ERR(em) || em->start > start ||
> start + len > em->end) {
> if (em && !IS_ERR(em))
> - extent_put(em);
> + ploop_extent_put(em);
> em = __map_extent(io, mapping, start, len, create,
> gfp_mask, get_block);
> }
> @@ -824,7 +824,7 @@ static int drop_extent_map(struct extent
> rb_erase(node, &tree->map);
> list_del_init(&em->lru_link);
> tree->map_size--;
> - extent_put(em);
> + ploop_extent_put(em);
> }
> write_unlock_irq(&tree->lock);
> return 0;
> @@ -838,10 +838,10 @@ void trim_extent_mappings(struct extent_
> remove_extent_mapping(tree, em);
> WARN_ON(atomic_read(&em->refs) != 2);
> /* once for us */
> - extent_put(em);
> + ploop_extent_put(em);
> /* No concurrent lookups due to ploop_quiesce(). See WARN_ON above */
> /* once for the tree */
> - extent_put(em);
> + ploop_extent_put(em);
> }
> }
>
> diff -burp vzkernel.orig/drivers/block/ploop/io_direct_map.h vzkernel/drivers/block/ploop/io_direct_map.h
> --- vzkernel.orig/drivers/block/ploop/io_direct_map.h 2015-12-21 00:26:58.000000000 +0300
> +++ vzkernel/drivers/block/ploop/io_direct_map.h 2015-12-28 19:05:19.797910631 +0300
> @@ -42,7 +42,7 @@ struct extent_map *extent_lookup_create(
> sector_t start, sector_t len);
> struct extent_map *extent_lookup(struct extent_map_tree *tree,
> sector_t start);
> -void extent_put(struct extent_map *em);
> +void ploop_extent_put(struct extent_map *em);
>
> struct extent_map *map_extent_get_block(struct ploop_io *io,
> struct address_space *mapping,
> @@ -55,7 +55,7 @@ struct extent_map_tree * ploop_dio_open(
> void ploop_dio_downgrade(struct address_space * mapping);
> int ploop_dio_upgrade(struct ploop_io * io);
>
> -int __init extent_map_init(void);
> -void extent_map_exit(void);
> +int __init ploop_extent_map_init(void);
> +void ploop_extent_map_exit(void);
>
> #endif
More information about the Devel
mailing list