dm.c (8fbf26ad5b16ad3a826ca7fe3e86700420abed1f) dm.c (ab4c1424882be9cd70b89abf2b484add355712fa)
1/*
2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

--- 821 unchanged lines hidden (view full) ---

830static int __split_bio(struct mapped_device *md, struct bio *bio)
831{
832 struct clone_info ci;
833 int error = 0;
834
835 ci.map = dm_get_table(md);
836 if (unlikely(!ci.map))
837 return -EIO;
1/*
2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include "dm.h"

--- 821 unchanged lines hidden (view full) ---

830static int __split_bio(struct mapped_device *md, struct bio *bio)
831{
832 struct clone_info ci;
833 int error = 0;
834
835 ci.map = dm_get_table(md);
836 if (unlikely(!ci.map))
837 return -EIO;
838
838 if (unlikely(bio_barrier(bio) && !dm_table_barrier_ok(ci.map))) {
839 dm_table_put(ci.map);
840 bio_endio(bio, -EOPNOTSUPP);
841 return 0;
842 }
839 ci.md = md;
840 ci.bio = bio;
841 ci.io = alloc_io(md);
842 ci.io->error = 0;
843 atomic_set(&ci.io->io_count, 1);
844 ci.io->bio = bio;
845 ci.io->md = md;
846 ci.sector = bio->bi_sector;

--- 67 unchanged lines hidden (view full) ---

914 */
915static int dm_request(struct request_queue *q, struct bio *bio)
916{
917 int r = -EIO;
918 int rw = bio_data_dir(bio);
919 struct mapped_device *md = q->queuedata;
920 int cpu;
921
843 ci.md = md;
844 ci.bio = bio;
845 ci.io = alloc_io(md);
846 ci.io->error = 0;
847 atomic_set(&ci.io->io_count, 1);
848 ci.io->bio = bio;
849 ci.io->md = md;
850 ci.sector = bio->bi_sector;

--- 67 unchanged lines hidden (view full) ---

918 */
919static int dm_request(struct request_queue *q, struct bio *bio)
920{
921 int r = -EIO;
922 int rw = bio_data_dir(bio);
923 struct mapped_device *md = q->queuedata;
924 int cpu;
925
922 /*
923 * There is no use in forwarding any barrier request since we can't
924 * guarantee it is (or can be) handled by the targets correctly.
925 */
926 if (unlikely(bio_barrier(bio))) {
927 bio_endio(bio, -EOPNOTSUPP);
928 return 0;
929 }
930
931 down_read(&md->io_lock);
932
933 cpu = part_stat_lock();
934 part_stat_inc(cpu, &dm_disk(md)->part0, ios[rw]);
935 part_stat_add(cpu, &dm_disk(md)->part0, sectors[rw], bio_sectors(bio));
936 part_stat_unlock();
937
938 /*

--- 809 unchanged lines hidden ---
926 down_read(&md->io_lock);
927
928 cpu = part_stat_lock();
929 part_stat_inc(cpu, &dm_disk(md)->part0, ios[rw]);
930 part_stat_add(cpu, &dm_disk(md)->part0, sectors[rw], bio_sectors(bio));
931 part_stat_unlock();
932
933 /*

--- 809 unchanged lines hidden ---