dm.c (7b6d91daee5cac6402186ff224c3af39d79f4a0e) | dm.c (144d6ed551ce430084489b198826c89bac5680dc) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 1441 unchanged lines hidden (view full) --- 1450 struct mapped_device *md = q->queuedata; 1451 1452 if (dm_request_based(md)) 1453 return dm_make_request(q, bio); 1454 1455 return _dm_request(q, bio); 1456} 1457 | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 1441 unchanged lines hidden (view full) --- 1450 struct mapped_device *md = q->queuedata; 1451 1452 if (dm_request_based(md)) 1453 return dm_make_request(q, bio); 1454 1455 return _dm_request(q, bio); 1456} 1457 |
1458/* 1459 * Mark this request as flush request, so that dm_request_fn() can 1460 * recognize. 1461 */ 1462static void dm_rq_prepare_flush(struct request_queue *q, struct request *rq) 1463{ 1464 rq->cmd_type = REQ_TYPE_LINUX_BLOCK; 1465 rq->cmd[0] = REQ_LB_OP_FLUSH; 1466} 1467 | |
1468static bool dm_rq_is_flush_request(struct request *rq) 1469{ | 1458static bool dm_rq_is_flush_request(struct request *rq) 1459{ |
1470 if (rq->cmd_type == REQ_TYPE_LINUX_BLOCK && 1471 rq->cmd[0] == REQ_LB_OP_FLUSH) | 1460 if (rq->cmd_flags & REQ_FLUSH) |
1472 return true; 1473 else 1474 return false; 1475} 1476 1477void dm_dispatch_request(struct request *rq) 1478{ 1479 int r; --- 427 unchanged lines hidden (view full) --- 1907 md->queue->backing_dev_info.congested_data = md; 1908 blk_queue_make_request(md->queue, dm_request); 1909 blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY); 1910 md->queue->unplug_fn = dm_unplug_all; 1911 blk_queue_merge_bvec(md->queue, dm_merge_bvec); 1912 blk_queue_softirq_done(md->queue, dm_softirq_done); 1913 blk_queue_prep_rq(md->queue, dm_prep_fn); 1914 blk_queue_lld_busy(md->queue, dm_lld_busy); | 1461 return true; 1462 else 1463 return false; 1464} 1465 1466void dm_dispatch_request(struct request *rq) 1467{ 1468 int r; --- 427 unchanged lines hidden (view full) --- 1896 md->queue->backing_dev_info.congested_data = md; 1897 blk_queue_make_request(md->queue, dm_request); 1898 blk_queue_bounce_limit(md->queue, BLK_BOUNCE_ANY); 1899 md->queue->unplug_fn = dm_unplug_all; 1900 blk_queue_merge_bvec(md->queue, dm_merge_bvec); 1901 blk_queue_softirq_done(md->queue, dm_softirq_done); 1902 blk_queue_prep_rq(md->queue, dm_prep_fn); 1903 blk_queue_lld_busy(md->queue, dm_lld_busy); |
1915 blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN_FLUSH, 1916 dm_rq_prepare_flush); | 1904 blk_queue_ordered(md->queue, QUEUE_ORDERED_DRAIN_FLUSH, NULL); |
1917 1918 md->disk = alloc_disk(1); 1919 if (!md->disk) 1920 goto bad_disk; 1921 1922 atomic_set(&md->pending[0], 0); 1923 atomic_set(&md->pending[1], 0); 1924 init_waitqueue_head(&md->wait); --- 864 unchanged lines hidden --- | 1905 1906 md->disk = alloc_disk(1); 1907 if (!md->disk) 1908 goto bad_disk; 1909 1910 atomic_set(&md->pending[0], 0); 1911 atomic_set(&md->pending[1], 0); 1912 init_waitqueue_head(&md->wait); --- 864 unchanged lines hidden --- |