• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/md/

Lines Matching defs:io

17 #include <linux/dm-io.h>
19 #define DM_MSG_PREFIX "io"
29 * Aligning 'struct io' reduces the number of bits required to store
32 struct io {
96 * We need to keep track of which region a bio is doing io for.
98 * ensure the 'struct io' pointer is aligned so enough low bits are
102 static void store_io_and_region_in_bio(struct bio *bio, struct io *io,
105 if (unlikely(!IS_ALIGNED((unsigned long)io, DM_IO_MAX_REGIONS))) {
106 DMCRIT("Unaligned struct io pointer %p", io);
110 bio->bi_private = (void *)((unsigned long)io | region);
113 static void retrieve_io_and_region_from_bio(struct bio *bio, struct io **io,
118 *io = (void *)(val & -(unsigned long)DM_IO_MAX_REGIONS);
123 * We need an io object to keep track of the number of bios that
124 * have been dispatched for a particular io.
126 static void dec_count(struct io *io, unsigned int region, int error)
129 set_bit(region, &io->error_bits);
131 set_bit(region, &io->eopnotsupp_bits);
134 if (atomic_dec_and_test(&io->count)) {
135 if (io->sleeper)
136 wake_up_process(io->sleeper);
139 unsigned long r = io->error_bits;
140 io_notify_fn fn = io->callback;
141 void *context = io->context;
143 mempool_free(io, io->client->pool);
151 struct io *io;
158 * The bio destructor in bio_put() may use the io object.
160 retrieve_io_and_region_from_bio(bio, &io, &region);
164 dec_count(io, region, error);
169 * destination page for io.
262 struct io *io;
264 retrieve_io_and_region_from_bio(bio, &io, &region);
266 bio_free(bio, io->client->bios);
298 struct dpages *dp, struct io *io)
318 bio = bio_alloc_bioset(GFP_NOIO, num_bvecs, io->client->bios);
323 store_io_and_region_in_bio(bio, io, region);
339 atomic_inc(&io->count);
346 struct io *io, int sync)
363 do_region(rw, i, where + i, dp, io);
368 * the io being completed too early.
370 dec_count(io, 0, 0);
383 volatile char io_[sizeof(struct io) + __alignof__(struct io) - 1];
384 struct io *io = (struct io *)PTR_ALIGN(&io_, __alignof__(struct io));
392 io->error_bits = 0;
393 io->eopnotsupp_bits = 0;
394 atomic_set(&io->count, 1); /* see dispatch_io() */
395 io->sleeper = current;
396 io->client = client;
398 dispatch_io(rw, num_regions, where, dp, io, 1);
403 if (!atomic_read(&io->count))
410 if (io->eopnotsupp_bits && (rw & REQ_HARDBARRIER)) {
416 *error_bits = io->error_bits;
418 return io->error_bits ? -EIO : 0;
425 struct io *io;
433 io = mempool_alloc(client->pool, GFP_NOIO);
434 io->error_bits = 0;
435 io->eopnotsupp_bits = 0;
436 atomic_set(&io->count, 1); /* see dispatch_io() */
437 io->sleeper = NULL;
438 io->client = client;
439 io->callback = fn;
440 io->context = context;
442 dispatch_io(rw, num_regions, where, dp, io, 0);
502 _dm_io_cache = KMEM_CACHE(io, 0);