dm.c (692d0eb9e02cf81fb387ff891f53840db2f3110a) | dm.c (df12ee996378a5917e9555169fe278ecca0612d4) |
---|---|
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" --- 1423 unchanged lines hidden (view full) --- 1432static void dm_wq_work(struct work_struct *work) 1433{ 1434 struct mapped_device *md = container_of(work, struct mapped_device, 1435 work); 1436 struct bio *c; 1437 1438 down_write(&md->io_lock); 1439 | 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" --- 1423 unchanged lines hidden (view full) --- 1432static void dm_wq_work(struct work_struct *work) 1433{ 1434 struct mapped_device *md = container_of(work, struct mapped_device, 1435 work); 1436 struct bio *c; 1437 1438 down_write(&md->io_lock); 1439 |
1440next_bio: 1441 spin_lock_irq(&md->deferred_lock); 1442 c = bio_list_pop(&md->deferred); 1443 spin_unlock_irq(&md->deferred_lock); | 1440 while (1) { 1441 spin_lock_irq(&md->deferred_lock); 1442 c = bio_list_pop(&md->deferred); 1443 spin_unlock_irq(&md->deferred_lock); |
1444 | 1444 |
1445 if (c) { | 1445 if (!c) { 1446 clear_bit(DMF_BLOCK_IO, &md->flags); 1447 break; 1448 } 1449 |
1446 __split_and_process_bio(md, c); | 1450 __split_and_process_bio(md, c); |
1447 goto next_bio; | |
1448 } 1449 | 1451 } 1452 |
1450 clear_bit(DMF_BLOCK_IO, &md->flags); 1451 | |
1452 up_write(&md->io_lock); 1453} 1454 1455static void dm_queue_flush(struct mapped_device *md) 1456{ 1457 queue_work(md->wq, &md->work); 1458 flush_workqueue(md->wq); 1459} --- 300 unchanged lines hidden --- | 1453 up_write(&md->io_lock); 1454} 1455 1456static void dm_queue_flush(struct mapped_device *md) 1457{ 1458 queue_work(md->wq, &md->work); 1459 flush_workqueue(md->wq); 1460} --- 300 unchanged lines hidden --- |