io->flags |= (1U << bit);
}
-static inline void dm_io_inc_pending(struct dm_io *io)
-{
- atomic_inc(&io->io_count);
-}
-
-void dm_io_dec_pending(struct dm_io *io, blk_status_t error);
-
static inline struct completion *dm_get_completion_from_kobject(struct kobject *kobj)
{
return &container_of(kobj, struct dm_kobject_holder, kobj)->completion;
return DM_MAPIO_KILL;
}
- /*
- * The target map function may issue and complete the IO quickly.
- * Take an extra reference on the IO to make sure it does disappear
- * until we run dm_zone_map_bio_end().
- */
- dm_io_inc_pending(io);
-
/* Let the target do its work */
r = ti->type->map(ti, clone);
switch (r) {
break;
}
- /* Drop the extra reference on the IO */
- dm_io_dec_pending(io, sts);
-
if (sts != BLK_STS_OK)
return DM_MAPIO_KILL;
}
}
+static void dm_io_inc_pending(struct dm_io *io)
+{
+ atomic_inc(&io->io_count);
+}
+
/*
* Decrements the number of outstanding ios that a bio has been
* cloned into, completing the original io if necc.
spin_unlock_irqrestore(&io->lock, flags);
}
-void dm_io_dec_pending(struct dm_io *io, blk_status_t error)
+static void dm_io_dec_pending(struct dm_io *io, blk_status_t error)
{
if (unlikely(error))
dm_io_set_error(io, error);